Forum

attaching csqc entities to the hud

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

attaching csqc entities to the hud

Postby daemon » Wed Nov 14, 2007 8:18 am

i'm very curious if there's a proper way to do this that isn't FOV dependant.
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby Spike » Wed Nov 14, 2007 2:31 pm

Draw the view as normal. Then...

clear the scene.
set the viewport min pos, size to place the new scene on the hud. (VF_MIN, VF_SIZE)
I recommend you try setting VF_PERSPECTIVE(200) to 0 too.
set VF_ORIGIN to '0 0 0'.
set VF_ANGLES to '0 0 0' (or some other usable constant).
set VF_DRAWWORLD to 0!
Add an entity with R_AddEntity set to some displacement so that it is visible in the mini scene. With the approriate model and optional rotation.
Call R_RenderScene.

You now have an entity shown on your hud in a place that doesn't move when you change the fov, clamped to within a box.
This is the 'official' method. It does work in FTE. I hear DP doesn't support it though, as DP will clear the colour buffer when you render the second scene - wiping the main view.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby daemon » Thu Nov 15, 2007 4:06 am

Seems to be working in DP. :D

...but with pespective 0 I can't seem to get entities to draw.
-daemon [ daemonforge.org ]
User avatar
daemon
 
Posts: 63
Joined: Wed Nov 07, 2007 11:10 pm

Postby Spike » Thu Nov 15, 2007 1:36 pm

well, disabling perspective (making it isometric/parallel projection or whatever else you want to call it) is an optional feature. But it makes the hud look nicer without making the objects distorted. You can supposedly achieve a similar effect with a very small fov and putting the object further away (I think), although this is less mathematically precise.

In FTE with perspective disabled, the fov specified is not the angle of the view (technically the angle here is always 0). It is instead how wide the view is in qu. That is if you have a model that is 64*64 when drawn 2d, setting the fov to 64 will make the view range from -32 to 32. Its a bit of a kludge though, so set both x/y fov explicitly.
I don't know what happens in DP.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest