|
|
| Who | When |
Messages | |
|
|
|
| prakash
|
1
|
 |
|
06-05-2003 08:51 AM ET (US)
|
|
How can I do orientation in OpenGL
|
lucasw
|
2
|
 |
|
06-05-2003 11:27 AM ET (US)
|
|
Check out the orientation page that's the link below this page's in the OpenGL section of the lefthand side links. If you want, send me an email with more detailed description of what you already know how to do and what you need to know.
|
| prakash
|
3
|
 |
|
06-05-2003 02:56 PM ET (US)
|
|
I've now given the UpX, UpY, UpZ of the gluLookAt as sin(angle), cos(angle),0 for z-axis orientation. Is this enough for getting orientation in OpenGL.
|
| Lucas Walter
|
4
|
 |
|
06-05-2003 03:18 PM ET (US)
|
|
> > I've now given the UpX, UpY, UpZ of the gluLookAt as sin(angle), > > cos(angle),0 for z-axis orientation. Is this enough for getting > orientation > in OpenGL.
I think that will get you some really strange results if you've tried that. UpX,Y,Z should be something like (0,1,0), and then something like (x + cos(angle), y + 0, z + sin(angle)) and (sin(angle),0,-cos(angle)) for the forwarding looking and right hand vector parameters. x,y,z is the location of the view, make them zero and you'll be able to rotate but not move.
-Luke
|
| prakash venkiteswaran
|
5
|
 |
|
06-06-2003 06:11 AM ET (US)
|
|
Dear Luke, Can u give me the details of the forwarding looking and right hand vector parameters that you have given me. How will I give the specifications that you have given, in my program . I have to give orientation to an object( say a cone) in the screen and will gluLookAt will do it. Regards Prakash ___________________________________________________ Get www. mycompany .com and 5 matching email ids. Just Rs. 1499/ year. Click here http://www.rediffmailpro.com
|
| Lucas Walter
|
6
|
 |
|
06-06-2003 01:00 PM ET (US)
|
|
gluLookAt takes three sets of three floats, the first for the location of the eye/camera, the second for the location of whatever the camera is to be pointed at, and the last for the direction of 'up':
So before drawing the cone:
gluLookAt( locX, locY, locZ, locX + cos(angle), locY + 0 , locZ + sin(angle), 0, 1 , 0); /* always be oriented with y as up */
.... draw cone etc.
Now that I look at it, my earlier message was giving you the wrong sets of parameters, but this one should work.
|
|
|