Sign in to follow this  
devronious

help with ucsicon please

Recommended Posts

I'm trying to create a ucsicon for my viewport. I want it to always appear at the lower left corner and always at the same scale. I thought I would use CustomVertex.TransformedColored for my verticies so that I can just point to that position, but I found that my points can't have Z depth otherwise they don't render. If I set the points to 0.5 Z depth then it works. Is there a way to allow Z depth for this type of verticy? Thanks in advance, Devin

Share this post


Link to post
Share on other sites
Couple of things:

You can render it last with z-testing disabled though this will cause some artifacts without sorting - I assume this is what is making your vertices dissapear at other depths, as your axis go behind objects in the scene or the near/far planes.

You can clear the zbuffer before you render it to avoid this problem (even if only in the area that the axis are displayed).

To render in the corner simply setup a viewport in the bottom left and render as if you wanted it in the centre of the screen, orientating it to the camera's orientation transform - you don't need to use pretransformed vertices in this way.

Share this post


Link to post
Share on other sites
How can I setup a viewport in the lower left corner. I'm unfamiliar with this approach as I'm fairly new to d3d. And can I overlay the new viewport over the first viewport so that both show their objects?

Share this post


Link to post
Share on other sites
i'm not familiar with managed directx but you would normally just use the D3DDevice->SetViewport() function to set the viewport to something other than the default (the whole client rectangle).

Then everything you render will be mapped into that screen space.

Simply set the viewport back to the whole screen afterwards and everything should be fine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this