Hi Lee,
You did not initialize the distanceGain in
sound.setDistanceGain(distanceGain);
if we do
distanceGain[0] = new Point2f(0, 1);
distanceGain[1] = new Point2f(20, 0);
then you will not hear the sound if distanceToSound approach 20.
- Kelvin
-------------
Java 3D Team
Sun Microsystems Inc.
>MIME-Version: 1.0
>Date: Fri, 23 Jun 2000 08:06:29 -0400
>From: "J. Lee Dixon" <[EMAIL PROTECTED]>
>Subject: Re: [JAVA3D] PointSound HELP!
>To: [EMAIL PROTECTED]
>
>I posted this email a week ago... I figured I would attach a piece of
>test code that shows my problem. The viewer is at the origin. The
>"distanceGain" curve and "distanceToSound" values are private members at
>the top of the class. When I run this program, changing the
>"distanceToSound" has no effect... the sound _always_ plays at full gain
>as if it were located at the origin.
>
>Can somebody else try this and tell me if I'm just having a driver
>issue. You will need to play with the "distanceToSound" member and
>recompile to run each test.
>
> <<TestBed.java>> <<CRICKETS.WAV>>
>
>Thanks in advance,
>Lee
>
>
>J. Lee Dixon
>Software Engineer
>SAIC - Celebration, FL
>[EMAIL PROTECTED]
>
>
>> -----Original Message-----
>> From: J. Lee Dixon [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, June 16, 2000 9:17 AM
>> To: JAVA3D-INTEREST (E-mail)
>> Subject: PointSound HELP!
>>
>> Okay, I must be losing it. Using PointSound seems very simple, but I
>> cannot get the sound to eminate from anywhere but the origin (0,0,0).
>> I place the sound at (75,0,0), and set an attenuation curve that makes
>> it so that you must be within 5 units to hear the noise.
>>
>> But no matter how I change the position of the PointSound, it ALWAYS
>> plays at the origin. Can someone see anything from my code snippets
>> that I am doing wrong?
>>
>> static Point2f[] distanceGain = new Point2f[]
>> {
>> new Point2f(0.0f, 1.0f),
>> new Point2f(5.0f, 0.0f)
>> };
>> ...
>> soundNode.setPosition(new Point3f(75.0f, 0.0f, 0.0f));
>> soundNode.setLoop(-1);
>> soundNode.setSchedulingBounds(
>> new BoundingSphere(new Point3d(0, 0, 0), 50000.0));
>> soundNode.setDistanceGain(distanceGain);
>>
>> This is VERY disturbing because I CANNOT have owl and rattlesnake
>> noises in the same spot. :^)
>>
>> (JDK 1.3, Java3D 1.2)
>>
>> J. Lee Dixon
>> Software Engineer
>> SAIC - Celebration, FL
>> [EMAIL PROTECTED]
>>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".