|
-
October 29th, 2005, 02:30 PM
#1
Transforming 2D Shapes
Currently, I have a 3D scene (game) that has interface elements. One interface element in particular is a 2D triangle. This triangle should be measured in screen units (pixels). Currently, my FVF uses D3DFVF_XYZRHW. This means that I cannot apply transformations to any of my 2D shapes because D3DFVF_XYZRHW is a transformed vertex. My triangle object is created using a vertex buffer.
I set my transformations via a call to IDirect3DDevice9::SetTransform(). I was wondering if someone could show me how to create 2D shapes measured in pixels that are able to have transformations.
Currently, I am a bit clueless as to how this would be done. If someone could provide detailed explanations with code samples, it would help me a lot. Thank you!
--MrDoomMaster
--C++ Game Programmer
Don't forget to rate me if I was helpful!
-
October 30th, 2005, 03:51 AM
#2
Re: Transforming 2D Shapes
D3DFVF_XYZRHW are "Transformed" vertices, so you cannot "transform" them further.
Either you'll have to it yourself which requires locking the vertex buffer etc.
OR switch to untransformed vertices (D3DFVF_XYZ) and use an orthogonal view matrix. Also take a look at D3DXMatrixOrthoOffCenter and http://www.gamedev.net/community/for...opic_id=119782 .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|