Jump to content
  • Advertisement


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


draw "infrared aiming point"

This topic is 5298 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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!