Forum

CSQC camera?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

CSQC camera?

Postby ceriux » Thu Mar 24, 2011 5:52 am

is it possible to code a sidescroller camera that doesnt move with the character in csqc?

if so, where do i start? i may need a bit of assistance in this. i honestly am just jumping into this hoping to accomplish and learn something at the same time.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Spike » Thu Mar 24, 2011 12:29 pm

quick pseudo code for csqc main loop:

clearscene();
setviewprop(ORIGIN, neworg);
setviewprop(ANGLES, newang);
addentities(MASK_ENGINE|MASK_VIEWMODEL);
renderscene();
drawcustomhuddoodads();


how you work out the neworg and newang is up to you.
it is feasable to use the engine defaults for the most part, and override only ORIGIN_X, as well as angles. this would cause the view to track with the normal location, but offset at a fixed position upon one axis. you can then force the angles to face the player.
you probably also want to force their viewangles too.


the 'proper' way to get the origin is actually quite awkward, although if you're using fte, registering the player model for entity update notifications may be quite handy - the engine will do all the deltaing/interpolation for you.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby ceriux » Thu Mar 24, 2011 4:57 pm

so those are all of the functions ill be using? i'v never coded a camera from scratch. would it be anything similar to a ssqc camera ?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest