Archived

This topic is now archived and is closed to further replies.

camera problems

This topic is 5999 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hallo. i got problems to fix my camera-math. i intended to assign the camera direction to the direction-vec of vehicle. n[0] = 0; n[1]=-1; n[2]=0; //origin dir of vehicle double dir[] = new double[3]; OM.transform(n,dir); //translated to current orientation matrix double ax = -dir[1]; //rotation axis double ay = dir[0]; double az = 0; double angle = Math.acos(dir[2]); Matrix3D Q = new Matrix3D(); //calculate a quaternion double w, x,y,z; w = Math.cos(angle/2); x = ax*Math.sin(-angle/2); y = ay*Math.sin(-angle/2); z = 0; Q.quaternion(w, x,y,z); camera.OM.setTransformation(Q); //setup camera matrix can someone help me? thanks.

Share this post


Link to post
Share on other sites