Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 1 invisible), 620 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
camera calculations #175612
12/31/07 19:43
12/31/07 19:43
Joined: Dec 2007
Posts: 17
Mare Offline OP
Newbie
Mare  Offline OP
Newbie

Joined: Dec 2007
Posts: 17
Hi there, im a new guy in this forum, but i have a simple knowlage about the Game Studio, so u dont need to explain to me as simple as u can Now the question: We all know that the pan value of an entitys orientation ranges from 0 to 360. Im using a simple code for calculating the camera position:
Code:
camera.x = my.x - camera_dist * cos(camera.pan);
camera.y = my.y - camera_dist * sin(camera.pan);
camera.z = my.z + 50;

camera.pan +=(my.pan - camera.pan) / 10 * time_step; // this is used to smooth the camera movement!!!
camera.tilt = my.tilt - 20;



This code works whel but when the pan value of the my entity goes like this:

359 -> 360 -> 0;

The camere spins around. Is there a solution to this problem? I know that it worked fine with older versions of GameStudio because the pan ,roll, and tilt were not clamped..
Thx for all answers!!

Re: camera calculations [Re: Mare] #175613
01/02/08 14:19
01/02/08 14:19
Joined: Dec 2007
Posts: 17
Mare Offline OP
Newbie
Mare  Offline OP
Newbie

Joined: Dec 2007
Posts: 17
Sorry guys, I know you are borred of me, and my dumb question!! But is there a camera movement script that makes the camera folow the entity smoothly? I have ran out of solutions. I mean the script that I have made makes the player look on the character from one single angle thru the whole level..... You know what I mean. Its a racing game, that I am making, and when I want to turn left or right the camera rigidly folows the car, it just destroys the feal that you are actually turning. Pleaseee help!!!


Re: camera calculations [Re: Mare] #175614
01/02/08 15:06
01/02/08 15:06
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
camera.pan += ang(my.pan - camera.pan) / 10 * time_step;


xXxGuitar511
- Programmer
Re: camera calculations [Re: xXxGuitar511] #175615
01/02/08 17:11
01/02/08 17:11
Joined: Dec 2007
Posts: 17
Mare Offline OP
Newbie
Mare  Offline OP
Newbie

Joined: Dec 2007
Posts: 17
thnx a lot man!!!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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