Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

ScreenVertex and Matrix Translation

This topic is 4861 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 do not think I've done anything incorrect but I cannot seem to move around my screenQuad with a matrix translation. So it is my conclusion that screen vertices skip the world transformation.

Share this post


Link to post
Share on other sites
Advertisement
Are you using Transformed vertices? If that is what you mean by "Screen vertices" then you are correct, when you use that format you are saying "I know where things should be on screen, so I'll put them there and you don't need to move them."

I'm guessing this is for 2D items? If so and you want to move items with the transformation matrices, you need to use a different approach. Instead of transformed vertices use the standard vertices (what language are you using?). Then set the projection transform to an Orthographic matrix. There is a function to make these, but I need to know the language to know where it is for you.

Share this post


Link to post
Share on other sites
DirectX9 C++
I'm attempting to outline a structure for the ingame menu.

I've got it all down now just trying to find a way to auto sort groups of open menu items and since I cannot move the quad around with a matrix I'm now stuck with having to modify the quad vertex buffer before rendering each piece of have each piece contain its own buffer...


This ortho mode, care to elaborate?

Share this post


Link to post
Share on other sites
Usually when you render in 3D you use a Perspective transofrm which makes far away things appear smaller, close things larger, etc. This obviously is a pain if all we want to do is show a 10x10 pixel square on the screen, because we would have to find the exactly right depth to stick it and the right size, etc.

So we use Orthographic projections, where the distance to an object doesn't change its size. That way the depth won't change the size, and it becomes easy to position things where we want them on screen. To do this you get your projection matrix from D3DXMatrixOrtho* functions. You also have to use a different vertex format that isn't transformed already, and then you can move things around with matrix transformations.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!