Results 1 to 3 of 3
Thread: 3d trigonometry
- 03-19-2010, 06:04 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 10
- Rep Power
- 0
3d trigonometry
i am trying to figure out how to move a camera around in jogl. the function to set the camera takes the arguments 0f x position,y position,z position, x coordinates to look at, y coordinates to look at, and z coordinates to look at. if i know the x and y angles that my camera is at, how i calculate the change in x, y, and z coordinates, and which coordinates to look at?
Jocks rule the highschools, but GEEKS RULE THE WORLD MWAHAHAHA!!
- 03-20-2010, 11:32 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
Let (xc, yx, zc) be the location of the camera and let (xt, yt, xt) be the target position (where the camera is looking at). Translate over position T, so the camera is at position (xc-xt, yt-yc, zc-zt) and looking at (0, 0, 0) (the origin). You can rotate this new point however you want (and find new x, y, z, coordinates for the camera). When you're done translate the new coordinates back over position T (see above). Google is your friend w.r.t. 3D rotation matrixes.
kind regards,
Jos
- 03-21-2010, 01:56 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 10
- Rep Power
- 0
sorry man, but that's right over my head. the look at function takes (posx,posy,posz) as where the camera is,(lookx,looky,lookz) as where you're looking at, and(headx,heady,headz) as where the top of the head is pointing. how do i use this function if i know (x position,y position, zposition,yaw,pitch,roll) ? please send code because i have no idea how to implement it myself.
Jocks rule the highschools, but GEEKS RULE THE WORLD MWAHAHAHA!!


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks