Sign in to follow this  
sriniatig

Rotating Triangles Problem

Recommended Posts

sriniatig    151
hi I have got two triangles, one in ABC(x, z) plane and another in LMN(y, z) plane. One point of both triangles is at origin. Now I want to rotate these triangles along X and Y axis. Following are the equations. /*********************/ Triangle 1 (ABC) /*********************/ Point1.x = 0; Point1.y = 0; Point1.z = 0; TempAngle = 270-(FOV/2)-Camera_Y_Angle Point2.x = cos(TempAngle); Point2.y = sin(Camera_X_Angle); Point2.z = sin(TempAngle)*cos(Camera_X_Angle); TempAngle = 270+(FOV/2)-Camera_Y_Angle Point3.x = cos(TempAngle); Point3.y = sin(Camera_X_Angle); Point3.z = sin(TempAngle)*cos(Camera_X_Angle); /*********************/ Triangle 2 (LMN) /*********************/ Point1.x = 0; Point1.y = 0; Point1.z = 0; TempAngle = Camera_X_Angle+FOV/2 Point2.x = cos(Camera_Y_Angle+270); Point2.y = sin(TempAngle); Point2.z = sin(Camera_Y_Angle+270)*cos(TempAngle); TempAngle = Camera_X_Angle-FOV/2 Point3.x = cos(Camera_Y_Angle+270); Point3.y = sin(TempAngle); Point3.z = sin(Camera_Y_Angle+270)*cos(TempAngle); Problems faced: I'm not getting positive Z co-ordinates when rotating about X axis. Rest everything works fine. Plz advice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this