moving the players view?

Discuss CSQC related programming.
Post Reply
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

moving the players view?

Post by ceriux »

how would i go about doing this in csqc? i assume it has something to do with this : const float VF_VIEWPORT = 7; , but im not sure.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: moving the players view?

Post by Spike »

first call clearscene(). this resets everything to defaults.

to move the 2d viewport around the screen:
setviewprop(VF_MIN, topleft);
setviewprop(VF_SIZE, topright-topleft);

alternatively:
setviewprop(VF_VIEWPORT, topleft, topright-topleft);

because we're lazy:
setviewprop(VF_DRAWENGINESBAR, TRUE);
setviewprop(VF_DRAWCROSSHAIR, TRUE);

then call addentities as appropriate.

to move the camera around the world, change VF_ORIGIN and VF_ANGLES. good luck determining the desired location. you can do this drawing the predraw function of the player entity if you need, and have one set up.

then call renderscene() to shove it onto screen.

repeat with different subregions
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: moving the players view?

Post by ceriux »

so i tried to set VF_ORIGIN and just got some warnings ?

in function CSQC_UpdateView (line 129),
View.qc:12: warning Q106: Assignment to lvalue
csplat.qc:251: float VF_ORIGIN_Y is defined here
View.qc:12: warning Q106: Assignment to constant VF_ORIGIN_Y
csplat.qc:251: float VF_ORIGIN_Y is defined here
Compile finished: ../csprogs.dat
Done. 2 warnings
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: moving the players view?

Post by Spike »

try setting it a different way... hint: read my previous post.
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: moving the players view?

Post by ceriux »

thanks got it =)
Post Reply