Jump to content
  • Advertisement
Sign in to follow this  

Rotating a plane

This topic is 3743 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 All, Im have a floor in my game which can be rotated about. Seperately i have also defined a plane object which represents the plane the floor is sitting on. I draw and rotate my floor like such:
void SomeDrawMethod()
{
...
glPushMatrix();
glRotate(someValue, 0, 0, 1) // rotate by somevalue around z axis
drawFloor();
glPopMatrix();


}
What i would like to know is how i can rotate the plane to lie on the new position of the floor? My Plane is just a basic objet containing a point and normal
class Plane
{
public:
Plane();
~Plane();

// Some Accessors here

private:
vector4f point;
vector4f normal;
}
If any1 could help me out it would be much apprechiated. Cheers.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by furby100
Rotate the normal.


Thanks for the reply, That wouldnt work as the floor is being rotated around a centre point, not its own centre. ie imagine the floor at point (0,-2,0) and rotating around the point (0,0,0). This should be a really simple problem but has lost me toatlly, if i can find the new plane point then the normal can be got from that.

Cheers

Share this post


Link to post
Share on other sites
transform both the point and the normal.

If you set the w coordinates correctly (1 for a point, 0 for a vector/normal) then you can apply transformations to your plane in exactly the same way as you would for anything else.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!