Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rotating the camera around the player... #6055
07/24/01 07:52
07/24/01 07:52
Joined: Mar 2001
Posts: 1,825
London, England
Keith B [Ambit] Offline OP
Expert
Keith B [Ambit]  Offline OP
Expert

Joined: Mar 2001
Posts: 1,825
London, England
Hi, just wondering if anyone can help me with this - it should be simple enough but I can't quite get my head around it:

What I want to do is have a camera that moves *around* the player, so that if you move the mouse up, the camera will tilt to look downwards but also move upwards, ie it should move around the character on an axis. Maybe I need to brush up on my trig and get out the old cos and sin, but if someone has already done this I'd be very grateful for any tips...

Another thing I'd like to do - much simpler I hope, is to modify the venture.wdl so that when the cursor reaches the edge of the screen, the player/camera pans in that direction.

Any help much appreciated.
Cheers,
Keith


Re: Rotating the camera around the player... #6056
07/24/01 11:51
07/24/01 11:51
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline
Expert
WildCat  Offline
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
Ambit,
JCL has some Chase cam code that works with the current beta releases. With it, all you would have to do is compute the position of the camera.

Cameras can be a little bit tricky, because if you use the typical method of pointing a camera at a player, (by subtracting the two position vectors and then using vec_to_angle) and the camera points down more than 90 degrees, the view appears to spin at various speeds until it comes to rest at the angle it was looking for. This makes the camera act unprofessional at best, and nauseating at worst!

Position can be found by taking a vector for the distance of the camera to the player, and doing a vec_rotate on the value for what a angle you want the camera to appear at and then adding that displacement to the players position.

Good luck!

-WildCat



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: Rotating the camera around the player... #6057
07/24/01 18:47
07/24/01 18:47
Joined: Mar 2001
Posts: 1,825
London, England
Keith B [Ambit] Offline OP
Expert
Keith B [Ambit]  Offline OP
Expert

Joined: Mar 2001
Posts: 1,825
London, England
Thanks for the reply, Wildcat. The annoying thing is that I actually coded something similar to what I need when ent_vertex wasn't working properly, but I seem to have deleted the project thinking I'd never need it again. D'oh!
Look forward to seeing the chase cam in the next update, until then I guess I'll unearth my trig books.
Cheers,
Keith


Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1