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,449 guests, and 6 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
3rd person camera with tilt #377381
07/12/11 16:38
07/12/11 16:38
Joined: Apr 2011
Posts: 40
germany
W
Wollez Offline OP
Newbie
Wollez  Offline OP
Newbie
W

Joined: Apr 2011
Posts: 40
germany
hi,
my 3rd person camera script looks like so:
Code:
function camera_follow(ENTITY* ent_for_camera)
{
	vec_set(camera.pan,vector(ent_for_camera.pan,-30,0)); // look in player direction, slighty down  
	while(1) 
	{
		vec_set(camera.x,vector(-275,0,200));  // camera position relative to the player      
		vec_rotate(camera.x,ent_for_camera.pan); // rotate the camera position with the player
		vec_add(camera.x,ent_for_camera.x);      // add player position
	
		wait(1);
	}
}


but like that I can only look left and right, but not up and down.
How do I do that?

Re: 3rd person camera with tilt [Re: Wollez] #377382
07/12/11 16:43
07/12/11 16:43
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
camera.tilt -= 0.5 * mickey.y * time_step;


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 3rd person camera with tilt [Re: 3run] #377390
07/12/11 17:26
07/12/11 17:26
Joined: Apr 2011
Posts: 40
germany
W
Wollez Offline OP
Newbie
Wollez  Offline OP
Newbie
W

Joined: Apr 2011
Posts: 40
germany
thx for the quick answer
but it doesn't work. if i move the mouse up and down nothing happens exept that it trembles a bit.
I think its because of:
vec_set(camera.pan,vector(ent_for_camera.pan,-30,0));
but i'm not sure
valle

Re: 3rd person camera with tilt [Re: Wollez] #377391
07/12/11 17:39
07/12/11 17:39

M
Malice
Unregistered
Malice
Unregistered
M





Wouldn't it work fin if you removed the whole line?
Code:
function camera_follow(ENTITY* ent_for_camera)
{
	 
	while(1) 
	{
		vec_set(camera.x,vector(-275,0,200));  // camera position relative to the player      
		vec_rotate(camera.x,ent_for_camera.pan); // rotate the camera position with the player
		vec_add(camera.x,ent_for_camera.x);      // add player position
	       camera.tile -= 0.5*mickey.y* time_Step;
		wait(1);
	}
}



Last edited by Malice; 07/12/11 17:43.
Re: 3rd person camera with tilt [Re: ] #377658
07/15/11 11:18
07/15/11 11:18
Joined: Apr 2011
Posts: 40
germany
W
Wollez Offline OP
Newbie
Wollez  Offline OP
Newbie
W

Joined: Apr 2011
Posts: 40
germany
that doesn't work either, cause now the camera doesn't change pan-position anymore
of course I could add
camera.pan -= 0.5*mickey.x* time_step;
but then the camera doesn't rotate around the players axis

Re: 3rd person camera with tilt [Re: Wollez] #377686
07/15/11 15:30
07/15/11 15:30

M
Malice
Unregistered
Malice
Unregistered
M



Why don't you take a look inside the improved 3rd person camera code.. HERE>

I used Google translate to change the comment tags and better understand whats going on.

Re: 3rd person camera with tilt [Re: ] #377687
07/15/11 16:04
07/15/11 16:04
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
use ent_for_camera.tilt instead of camera.tilt...


Visit my site: www.masterq32.de
Re: 3rd person camera with tilt [Re: MasterQ32] #377688
07/15/11 16:10
07/15/11 16:10

M
Malice
Unregistered
Malice
Unregistered
M



Richi007 > That would tilt the player model. If I remember his code right.

He needs to set up some temp vectors to hold operations.

Last edited by Malice; 07/15/11 16:11.

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