Drawing a Console

Started by
8 comments, last by Graham 20 years, 5 months ago
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
Go on an Intense Rampage
Advertisement
Try D3DXSprite
Editor42 ...builds worlds
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.
Write more poetry.http://www.Me-Zine.org
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]
_______________________________________Understanding is a three edged sword...Freelance Games - Home of XBLIG Starchonwww.FreelanceGames.com
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?
"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.
Go on an Intense Rampage
in C#:
d3dDevice.Transform.Projection = Matrix.OrthoLH(width, height , 1.0f, 100.0f);
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]
Go on an Intense Rampage
It would certainly be stretched if say, your device (or screen!) is not 1024 pixels wide.
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]
Go on an Intense Rampage

This topic is closed to new replies.

Advertisement