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
1 registered members (TipmyPip), 18,619 guests, and 5 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
adding offset to camera view #403892
06/27/12 23:06
06/27/12 23:06
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
Hi,

Anyone know how i can add a offset to this camera code ==>

camera.x = player.x - camera_dist * cos (camera.pan) * cos(camera.tilt);

camera.y = player.y - camera_dist * sin (camera.pan) * cos (camera.tilt);

camera.z = player.z - camera_dist * sin (camera.tilt);


I use it for a 3rd person camera and i want to add a offset for a "over shoulder camera" so i want to move the camera a little bit too the right of the character.

Thx.

Re: adding offset to camera view [Re: Altarius] #403893
06/27/12 23:21
06/27/12 23:21
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Open manual, learn! Take a look at "vec_add"!!
Simple example of vector with offset from "my" entity:
Code:
vec_set(cam_pos.x, vector(offset_x, offset_y, offset_z));
vec_rotate(cam_pos.x, camera.pan);
vec_add(cam_pos.x, my.x);

I'm not going to help you to add offset to those lines you've posted above.
You have no clue how they work, you just want to copy-post them and to be happy grin
But you won't be happy till you'll start learning! Open "camera.c" from rootfolder.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: adding offset to camera view [Re: 3run] #403947
06/28/12 22:05
06/28/12 22:05
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

Joined: Jul 2009
Posts: 85
loll...

What can i say too that... FOR THE MOTHERLAND?

Last edited by Altarius; 06/28/12 22:06.

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

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