How do you rotate the cameras viewpoint
in 3d space?
Does anybody have any fast algorithms to
do this?
From what I understand you dont really
move the camera itself, you move all the polygons
in the game around the camera.
If I wanted to move an object around my
camera, would I first have to move its
center around the camera, and then all the
objects points in the opposite direction?
any posts would be appreciated. =)

# 3d camera movement

Started by Jeremiah, Jan 01 2000 03:38 PM

6 replies to this topic

Sponsor:

###
#2
Members - Reputation: **130**

Posted 01 January 2000 - 04:32 PM

im not a 3d programemr but i think i have a solution

you should have a uniform vector for camera (x,y,z = 1,1,1) and then rotate this value using cos and sin an all

then you should multipl this vector for all game objects (easy if you use matrices

i hope it helps

akura

you should have a uniform vector for camera (x,y,z = 1,1,1) and then rotate this value using cos and sin an all

then you should multipl this vector for all game objects (easy if you use matrices

i hope it helps

akura

###
#3
Members - Reputation: **174**

Posted 02 January 2000 - 04:36 PM

It''s not quite that simple. If you did that the object''s vertices would rotate but the object itself would not. What you need to do is translate the object so that it''s origin is equal to the camera position. Then you rotate the object''s points. Next you translate the object back to where it was and last rotate the the translation around the camera. If that doesn''t make sense let me give you this example. Say you want rotate a camera looking at a cube. Not only do you want the cube''s points to rotate reverse of the camera, but you also want the cube itself(thus rotating the translation variables)around the camera. I really hope this helps.

###
#5
Members - Reputation: **208**

Posted 03 January 2000 - 08:10 PM

Yup, the way I think of it is that if I need to move my camera up then I move the world down and put that negative number into the view matrix. Same if I want to rotate the camera to the left, I rotate the objects in my world to the right. Now don''t laugh... but to help me out to see this better I used an empty transparent cassette tape sleve and drew one vertical and one horizontal line on a paper and I moved the sleve around through which I could see the grid lines in the x-z plane. I use to do this a lot in the beginning especially with that wacky rotate first translate second thing in first person view games;-)

###
#6
Members - Reputation: **230**

Posted 06 January 2000 - 08:01 PM

I don''t know a lot about this (still working on getting my own engine to do want I want) but I think you guessed right to begin with. If you have your camera set at a fixed position then transform all the points in your 3D world around the camera (I think you can program a moving viewpoint but your way sounds simpler to me). You could then use matrices (you can read all about them in text books) to rotate, translate your world points around the camera. That''s the way I am trying to do it anyway. Later, Paulcoz.