tracking camera
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
tracking camera
Hello all,how to make a camera that will follow the player
like this cam (camera from portal)

like this cam (camera from portal)

Sorry for my english 
- Max_Salivan
- Posts: 93
- Joined: Thu Dec 15, 2011 1:00 pm
Re: tracking camera
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:
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
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
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest