Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Akow), 1,359 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Camera MOD? #371018
05/17/11 10:45
05/17/11 10:45
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
I have it so when A/D are pressed the character model rotates, if I set camera.pan = my.pan; it just looks weird, maybe because it was meant for first person mode but how can I have a camera that looks in the same direction? at the moment its fixed to follow at a certain angle and point.

Code:
camera.x = my.x+80; //camera location behind the player
camera.y = my.y;    //camera left/right placement
camera.z = my.z+25; //camera height
camera.tilt = -15;  //make it look downwards
//camera.pan = my.pan;



Re: Camera MOD? [Re: JakeBilbe] #371026
05/17/11 12:00
05/17/11 12:00
Joined: Mar 2009
Posts: 186
V
Valdsator Offline
Member
Valdsator  Offline
Member
V

Joined: Mar 2009
Posts: 186
I assume you want the camera to stay behind the player, as the player rotates, right?

To do this you have to use some trigonometry.
Code:
camera.x = my.x - 150 * cos(my.pan);
camera.y = my.y - 150 * sin(my.pan);



Set the 150 to how far you want the camera to be from the player.
Not sure if you need an explanation of how this works, but here.



Re: Camera MOD? [Re: Valdsator] #371028
05/17/11 12:18
05/17/11 12:18
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Thanks, its doing the same though. When the player looks left the camera also turns left where as I want the camera to stay behind him and turn with him. Like a third person action game. But when my character turns around the camera does and sometimes the camera is infront of the player whilst turned.


Gamestudio download | chip programmers | 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