constraining the motion of a line in a plane
Hi
I want to constrain the movement(translation and rotation) of a line in a specific plane in opengl. How do i go about it ?
I must also be able to move the plane around space but the line which is contained within must be constrained to the boundaries of the plane and must translate only in the region defined by the plane.
Please help
Utk
For the first point you need to learn about planes, have a look here http://mathworld.wolfram.com/search/?query=plane&x=0&y=0
And for the 2nd point you can use glPushMatrix/glPopMatrix to save your matrix state and do hierarchical translations and rotations.
And for the 2nd point you can use glPushMatrix/glPopMatrix to save your matrix state and do hierarchical translations and rotations.
You can define a co-ordinate frame, select one of its principle planes (e.g. the x-y plane) as the constraining plane, and formulate the box and point motions in 2D. Perhaps you can move both points individually, so that line translation and rotation are reduced to 2 translations. Especially then the restriction to the bounding box is easy. However, you have to define what happens on collision with the box. When rendering you have to complete the current co-ordinates of the points by the 3rd dimension (i.e. z==0 in the chosen case) and use them as local co-ordinates in the aforementioned co-ordinate frame.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement