Archived

This topic is now archived and is closed to further replies.

Drawing a Console

This topic is 5143 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I how would I draw a console similar to the one in Q3. I think I could do it using transformed coordinates, like x,y,z,rhw. But Im currently using un-transformed vertices for my world and clearing the z-buffer everyframe. To use transformed vertices you cant clear the z-buffer. How would I get around of this problem. Go on an Intense Rampage

Share this post


Link to post
Share on other sites
If you''re just tryiny to render a console, I would imagine that you could just render everything to a texture, and then place that on a square a render that, just render the square before you set the view matrix, and you''ll always be able to set it a predictable distance from the screen. Also, you could get a pointer to the back buffer, lock it, and just draw directly to that, after you''ve done your rendering, just some thoughts.

Share this post


Link to post
Share on other sites
quote:

If you're just tryiny to render a console, I would imagine that you could just render everything to a texture, and then place that on a square a render that, just render the square before you set the view matrix...



That is not going to work because the square "Quad" is using world space coordinates. Therefore, when you set the view matrix, the Camera will not longer be facing the Quad. If you want to use a World Space Quad then you will have to render it as a billboard.

Depending on the shape of your console, you may also want to look creating multiple viewports with the SetViewport function. I have never used them, but I believe that you could also use a Stencil Buffer?


_______________________________________
Understanding is a three edged sword...


[edited by - Sean Doherty on November 11, 2003 7:20:50 PM]

Share this post


Link to post
Share on other sites
"Why don''t you just draw the whole world then switch to ortho mode and draw a quad where you want the console to be, texture it, write text on top of it..etc? "

How can you switch to ortho mode, like you suggest. I am thinking that the D3DXSprite would be easiest. But would is support the transparency effects that the Q3 console has.

Share this post


Link to post
Share on other sites
Im using ID3DXSprite::Draw() but the image drawn in always slightly stretched horizontally and vetically even though I use NULL for the strretch paramater. When I make the stretch values 1 and 1, it is still stretched. Anyone else have problems like this using D3DXSPRITE.
The Texture Im drawing is 1024 by 272. Is the error caused by the dimensions.?

[edited by - Graham on November 11, 2003 10:07:59 PM]

Share this post


Link to post
Share on other sites
My resolution is 1024 by 768.
edit. Looks like the scalling will only work corectly if the dimension of both sides of the texture are a power of 2.

[edited by - Graham on November 11, 2003 10:47:44 PM]

Share this post


Link to post
Share on other sites