Skip to main content
gamedev.net
🔒 Locked

Screen Space

Started by treeway Apr 26, 2006 at 11:38 AM 0 replies 350+ views
Original Post
treeway
treeway
Hi I was rendering a 3d object to a texture then using that texture as a sprite to position it in screen space. I just realised how dumb that is when i could just set Zenable to false then position the 3d object in screen space. right? but how do i do that. how do i position an object in the view space of a camera as if it were 2d? thanks
programmer_tom
programmer_tom
if you just want to render to the screen, use pre-transformed vertices (rhw).

so, with the pipeline, the FVF looks something like this depending on what you want:

#define D3DFVF ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1 )

(position, color, tex coords ).

or you could go
#define D3DFVF ( D3DFVF_XYZRHW | D3DFVF_TEX1 )

and set the color as a whole with materials, to avoid VB locking to change the vertex colors.

lock a VB and fill it in ( where the positions are in screen space ) just as you would with any other VB.

-programmer_tom

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.