Re: [Plib-users] API Documentation and Camera Rotation....
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2003-01-18 00:47:16
|
SkyFlash wrote: > Alright, i am experimenting with PLIB right now, but I am kinda lost > without docu or help.... There is SSG documentation on the web site - and several example programs. > I wanna do a few things and how no clue how... > > - Create a floor, which is basicly flat and textured, if possible not > from a 3D model but just from code. Look at (for example) src/ssgAux/ssgaShapes.cxx - look at 'ssgaCube::regenerate()' on about line 184. That builds a cube without loading it from disk. > - Have a camera which is locked in an isometric position, looking down > at a certain angle onto a defined point. There are at least four ways: ssgSetCamera ( sgMat4 mat ) ; -- Give it a matrix describing it's position and orientation. ssgSetCamera ( sgCoord *coord ) ; -- Give it an sgCoord (which contains X,Y,Z and H,P,R) ssgSetCameraLookAt ( sgVec3 eyepoint, sgVec3 center ) ; -- Give it a position and a point in space to look towards. ssgSetCameraLookAt ( sgVec3 eyepoint, sgVec3 center, sgVec3 up ) ; -- Ditto and also specify the "up" direction. > - Have that camera rotate on keypress around that defined point to keep > the angle on it. Read the keypress in whatever way suits your application, figure out the new position - call 'ssgSetCameraLookAt' each time it moves to reposition it and/or it's "look at" point. > Now I know SOME 3D math, but I have no clue how to set the coordinates > for the camera, how to set the angle for the camera, how to make it look > towards some point in space. Which functions are used for that and whats > the argument list? Or better, where can I look up that information and > also for the rest of the API? It's on the web site. Go to http://plib.sf.net/ssg > I pretty much want the setup like in Diablo II, if that helps to > visualize what I want, just that the camera can be rotated around the > center point. (where the map is centered on) I don't know Diablo. I only write computer games - I don't have time to play them too! :-) > For the floor, I just need some floor so I can see when I move the > camera and of course later for the game as a real floor. :P Yep. If you want, you can download either 'Tuxkart' or 'TuxAQFH' and 'steal' one of the 'levelXXX.ac' files to load initially. It's a lot more interesting than just a flat plane - and you can load it with just a single 'ssgLoad ( filename )' call. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net |