Jump to content
  • Advertisement
Sign in to follow this  

Rotating Triangles Problem

This topic is 4894 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

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!