Yet another question from me =) Camera thingy..

Started by
0 comments, last by kenwi 22 years, 5 months ago
I''m bugging you guys once again. =) well, this time it''s about a camera.. I want the camera to have the same height above the ground all the time.. meaning the camera will follow the ground beneat it.. Ie: it there is a stair or something (Imported .3ds file) I want the camera to go up the stairs.. and down the stair... another thing: I can move the camera around 360 degrees, and go in the direction I rotated the camera.. I thought.. hm, if I want a player as well.. I want the player to be exact like the camera.. considering the movement you know.. rotate and go in the direction.. So I added another class entirely based on the camera class.. This seem to be working ok, but.. I am not sure how I can rotate and move the player(model)... what I mean is, the camera is moved and rotated and all that with gluLookAt(gCamera.mPosition.x, gCamera.mPosition.y, gCamera.mPosition.z, gCamera.mView.x, gCamera.mView.y, gCamera.mView.z, gCamera.mUpVector.x, gCamera.mUpVector.y, gCamera.mUpVector.z); ... and moved back and forth with the gCamera.MoveCameraZ(SPEED); function of the class. Now, if I want to do the same thing to my model.. I tried to play around a little with glRotatef and glTranslatef... but I just couldnt get it work.. I hope you understand what I''m trying to accomplish without sounding too dumb =) also hope my questions arent to silly, and/or easy. I''m just a newbie you know Thanks in advance Kenneth Wilhelmsen Download my little game project HERE -------------------------- He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would fully suffice. This disgrace to civilization should be done away with at once. Heroism at command, senseless brutality, deplorable love-of-country stance, how violently I hate all this, how despicable and ignoble war is; I would rather be torn to shreds than be a part of so base an action! It is my conviction that killing under the cloak of war is nothing but an act of murder
Advertisement
That''s what we''re here for. Perhaps to find the ground you could cast a ray "down" to find the point it intersects with the ground. Use the distance formula to see if it''s as high as you want, if not move it in the "up" direction to the correct height in relation to the ground point. Just a thought, maybe not a good one. Good luck with it. I''m a little lost on the 2nd question, so all I can say is good luck with it.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"

This topic is closed to new replies.

Advertisement