Archived

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

skillfreak

Texture Translation...

Recommended Posts

When I move my mouse, I would like the vertices for the mouse position to change. When I run my program, the picture just sits in the top left corner of my screen. ?? I don''t know why it won''t move. Please help. My cursor coords are changing. ( m_iMouse''x'' ) void CInput::RenderMouse( IDirect3DDevice8 *pDevice ) { D3DXMATRIX matWorld; D3DXMatrixTranslation( &matWorld, m_iMouseX, m_iMouseY, m_iMouseZ ); pDevice->SetTransform( D3DTS_WORLD, &matWorld ); pDevice->SetTexture( 0, m_pMouseTexture ); pDevice->SetStreamSource( 0, m_vbMouse, sizeof( window_vertex ) ); pDevice->SetVertexShader( D3D8T_CUSTOMVERTEX ); pDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 ); } thanks

Share this post


Link to post
Share on other sites
When you''re using a D3DFVF_XYZRHW vertex format, the vertices are already transformed and lit. In this way no transformation is computed and the vertices were rasterized with the values defined in the vertex buffer.
You can lock this buffer and change the coordinates or you use a D3DFVF_XYZ format with an view independent from the scene camera. I do the last to render 2D text with the ability to transform it every rendered frame.

Share this post


Link to post
Share on other sites