#### Archived

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

# draw "infrared aiming point"

This topic is 5150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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:
		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!

##### Share on other sites
Search for decals.

[edited by - Coincoin on April 13, 2004 6:45:42 PM]

• 10
• 18
• 14
• 18
• 15