Ok.  I’ve looked around the web to find out how to do this but it never seems to work properly.

What I want to do is point an object at a wall and create a sphere on the wall where it hits.  This I can do but if I rotate the object, the value I get bears no resemblance to the amount the object has rotated.  Here is the code snippet:

 

tempTrans2.get(currentRot);

currentRot.get(rotValues);

 

cosAngle  = rotValues[3];

                        angle     = Math.toDegrees(Math.acos( cosAngle ) * 2);

                        sinAngle  = Math.sqrt( 1.0 - cosAngle * cosAngle );

                        if ( Math.abs( sinAngle ) < 0.0005d )

                                    sinAngle = 1.0d;

 

                        rotX = (float)(rotValues[0] / sinAngle) * (float)angle;

This is based on the info I found on the web.

This is due for demonstration at university (as part of a larger project) on Friday so please feel free to respond quickly!

Cheers

Rich Bone

Birmingham University, UK

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