Archived

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

Need to create a 50% opacity quad to display text on, in my 3d scene

This topic is 5008 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 have a 3d scene with bouncing balls and all kinds of good stuff. However, I need to draw a rectangle which is 50% opaque... which I can then draw text on... such as: R: Toggle Rotation S: Increase Speed etc.. I know one way to do this is to use 2 triangles with black, 50% alpha vertices... but then It seems a pain to remember where to draw these triangles. Is there a simple way to draw a 2d triangle on my 3d scene? I thank you for your time.. and feel free to point me to a tutorial. Have a great day!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You answered your own question. Draw two triangles (or a quad if your environment allows it) at 50% alpha. That''s how I do it (and I assume most programmers).

You could wrap this in a function so that you can ignore the details.

Share this post


Link to post
Share on other sites
when you use the RHW flag it is transform vertex and that it will not get transform when it go through the vertex transformation pipeline. So when you create the vertex with this flag you will get it to where you want (you can specify its coordinate in screen position).

Share this post


Link to post
Share on other sites
To the anonymous poster... I did not answer my own question. I asked if there was a simpler way than going through all that trouble... but thanks for the suggestion.

Thank you for the help guys, it is much appreciated.

Share this post


Link to post
Share on other sites
Hmm.. I thought I understood this earlier...

If I specify the coordinates in screen position, isn''t that 2-dimensional?

If I want a quad from 50,50 to 250,250 ... Am I going to have to mess with Z coordinates?

I''m trying to figure out exactly how this RHW business works.

Thanks!

Share this post


Link to post
Share on other sites
AFAIK, with RHW, the Z coordinate only specifies the z-order.. eg. with two objects overlapping, the one with the lower z value will be on top. But you won't actually see any depth to objects, nor will they actually look as though they go back into the screen.

[Edit:] Scratch that, after some playing round, it seems as though Z coord. has no effect whatsoever... But the order in which the polys are drawn determines their z-order.

[edited by - henrym on March 28, 2004 6:29:07 PM]

Share this post


Link to post
Share on other sites