Advertisement Jump to content


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


draw "infrared aiming point"

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

If you intended to correct an error in the post then please contact us.

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:
		// if i set the 3rd param to D3DTTFF_PROJECTED, the point will keep still, not moving a bit.

		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 this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!