Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to move camera - ala Quake Mouse Move


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 arrogantgod   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 September 1999 - 04:15 PM

Ok, I want to emulate the movement found in Quake, Everquest, and most all other 1st person 3d games.

I am not a math genius, so please give me an example.

I have a camera eye x,y,z and a target x,y,z. When I press forward I want the eye to move towards the target at (n) speed and the target to move away from the eye at (n) speed. This way I never catch up to the target but I always move towards it.

When I select to look left or right I want the target to go left in view space and when I select to look right I want the target to pan to the right in view space.

Basically I want to reproduce the mouse look option in quake.

Please help.

I am using Direct3D Immediate Mode, 6.1 with Microsoft Visual C++ 6.0.

Thanks Much,
ArrogantGod
webmaster@arrogantgod.com


Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 11 September 1999 - 11:28 AM

If I understand correctly, what you need to do is:
- when translating the 'camera' vector, translate the 'target' vector by the same amount
- when you want to "rotate" the camera, translate the 'target' vector by the opposite of the 'camera' vector, rotate it (mouse speed*mouse movement left-right around Y axis and mouse speed*mouse movement up-down around X) and then translate by the 'camera' vector again.
I must say, though, I wouldn't use a camera-target vector system for viewing in a 3D engine because it simply isn't enough - you can't rotate the view around the camera-target vector. I recommend either adding the missing angle or rather having 3 angles (around X axis, around Y axis and around Z axis) replacing the 'target' vector.

#3 CJ   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 September 1999 - 01:35 AM

Hmmmmmm......you want to move the mouse over the screen, as soon as the mouse comes near the border of your screen, then you want it to move....right?

I would say that you first just see if you can move the mouse, and target with it.....just show it in 2d on the screen so....it's always the same depth.....and when it comes to the border, then just rotate.....

or is that not what you mean?

------------------
Dance with me......


#4 Khawk   Senior Staff   -  Reputation: 1362

Like
Likes
Like

Posted 12 September 1999 - 06:12 AM

I have some code that I will be posting soon of a terrain project I did for class that uses the "Quake-type mouse" for looking around. It uses OpenGL for rendering.

Kevin


#5 arrogantgod   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 September 1999 - 03:03 PM

Please send me the code!

Thanks,
webmaster@arrogantgod.com


#6 Eternity   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 September 1999 - 05:35 PM

Please post the code soon, as I'm curious to see if I have done it the same way...

#7 Khawk   Senior Staff   -  Reputation: 1362

Like
Likes
Like

Posted 15 September 1999 - 04:15 PM

I'll try to have it up within 2 days. First, I need to find the disk that has it, and second, I need to go through and mark the places of interest. :-)

Kevin





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS