ScreenVertex and Matrix Translation

Started by
2 comments, last by intrest86 18 years, 8 months ago
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.
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.
Turring Machines are better than C++ any day ^_~
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?
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.
Turring Machines are better than C++ any day ^_~

This topic is closed to new replies.

Advertisement