Forum

tracking camera

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

tracking camera

Postby Max_Salivan » Fri Jan 06, 2012 5:30 pm

Hello all,how to make a camera that will follow the player
like this cam (camera from portal)
Image
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm

Re: tracking camera

Postby Seven » Fri Jan 06, 2012 7:38 pm

Hello Max_Salivan,

To give you a littl start help:
Please look into the monsters individual .qc files.
As you know, the monsters usualy face the player.
And that is what you want to.

Look especially into the use of the function:
ai_face() (what it does is declared in fight.qc)

Next step:
I would make the "turnable" camera a model (the static rest can be a mesh).
The camera is spawned at the initial position.

I used this code to make my model look at the player all the time:
Code: Select all
void()   your_camera    =
local vector faceplayer1, faceplayer2;
faceplayer1 = vectoangles (self.enemy.origin - self.origin);    // The player is the "enemy" (declared somewhere before)
makevectors (faceplayer1);
faceplayer2 = normalize (v_forward);
self.angles = vectoangles(faceplayer2); 
};


Important to know is:
ai_face() doesn't take the z axis in account.


Last year in august necros gave exactly instructions on how to do it correctly.
Please jump to the thread and read it carefully here:
viewtopic.php?f=2&t=4246&p=39075&sid=0f5f4444cfb5d86ac9c6efed520aaecb#p39049

Good luck,
Seven
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: tracking camera

Postby Max_Salivan » Sat Jan 07, 2012 5:37 pm

so hard for me=\
Sorry for my english :)
Max_Salivan
 
Posts: 93
Joined: Thu Dec 15, 2011 1:00 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest