Page 1 of 1

moving the players view?

Posted: Sat Aug 02, 2014 2:42 pm
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.

Re: moving the players view?

Posted: Sat Aug 02, 2014 3:26 pm
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

Re: moving the players view?

Posted: Sun Aug 03, 2014 4:46 pm
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

Re: moving the players view?

Posted: Sun Aug 03, 2014 5:27 pm
by Spike
try setting it a different way... hint: read my previous post.

Re: moving the players view?

Posted: Sun Aug 03, 2014 5:52 pm
by ceriux
thanks got it =)