m_pD3DDevice->SetTexture(1,m_texAimPt);
m_pD3DDevice->SetTransform(D3DTS_TEXTURE1,&m_mtxAimPt);
// if i set the 3rd param to D3DTTFF_PROJECTED, the point will keep still, not moving a bit.
m_pD3DDevice->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT3);
m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
m_pD3DDevice->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_CURRENT );
can anybody help me , thanks in advance!
draw "infrared aiming point"
suppose a beam of infrared ray cast to a sphere, and there will be a "aiming point" on the sphere. i want to draw the point( infact , a circle) , but just cannot get the right result.
i''ve tried two methods:
1. calculate the exact position of the contact point of the ray and the sphere, and CREATE a new small surface and "paste" it on the ball. that will have z-bias problems and, if the "small surface" is not so small, it should be a curved surface and hard to cover perfectly on the ball.
2. use multi-texture. draw the "aiming point" on a bitmap and set it as the 2nd texture of the ball. this gives a good result, but i''ve got problems moving the "aiming point". the code looks like below:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement