I have the following lines in my code:

System.out.println("Before:i:j:X: "+i+":"+j+":"+hldx);
//        thePoints[0][j] = new Vector3f(hldx, thePoints[0][j].y, hldz);
System.out.println("After:i:j:X: "+i+":"+j+":"+hldx);

Which prints:

Before:i:j:X: 2:1:4.048341
After:i:j:X: 2:1:4.048341
Before:i:j:X: 2:2:4.09195
After:i:j:X: 2:2:4.09195
Before:i:j:X: 2:3:4.1265583
After:i:j:X: 2:3:4.1265583
Before:i:j:X: 2:4:4.148778
After:i:j:X: 2:4:4.148778

If I uncomment the new Vector3f(), I get

System.out.println("Before:i:j:X: "+i+":"+j+":"+hldx);
        thePoints[0][j] = new Vector3f(hldx, thePoints[0][j].y, hldz);
System.out.println("After:i:j:X: "+i+":"+j+":"+hldx);

Before:i:j:X: 2:1:4.0
After:i:j:X: 2:1:4.0
Before:i:j:X: 2:2:4.0
After:i:j:X: 2:2:4.0
Before:i:j:X: 2:3:4.0
After:i:j:X: 2:3:4.0
Before:i:j:X: 2:4:4.0
After:i:j:X: 2:4:4.0

How come the new Vector3f() is changing the value of hldx?  And changing it
*before* the call to new Vector3f()!!??

Must be some code optimization that puts off doing the println until after
hldx gets screwed up....

I have also tried:

       float hldy = thePoints[0][j].y;
System.out.println("Before:i:j:X: "+i+":"+j+":"+hldx);
       thePoints[0][j] = new Vector3f(hldx, hldy, hldz);
System.out.println("After:i:j:X: "+i+":"+j+":"+hldx);

as well as:

       float hldy = thePoints[0][j].y;
System.out.println("Before:i:j:X: "+i+":"+j+":"+hldx);
       thePoints[0][j] = new Vector3f();
       thePoints[0][j].set(hldx, hldy, hldz);
System.out.println("After:i:j:X: "+i+":"+j+":"+hldx);

They all change the value of hldx.

Bob Gray

===========================================================================
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".

Reply via email to