Jump to content
  • Advertisement
Sign in to follow this  

Make Sprite always face the camera

This topic is 3944 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

Hi! You solve one problem(now i have a plasmagun in my FPS that Fires from Gun Position into the middle of the screen) but at the same moment you always get a new one. this time it is the sprite that not is facing the cameraPosition at any given angle/rotation. Is there any easy way of making the face/flat side of a sprite always face the camera position? here is my view and WorldMatrix for my Sprite: //the View device.Transform.View = Matrix.LookAtLH(mPos, mView, mUp); //the Sprite World Matrix device.Transform.World = Matrix.Multiply(Matrix.Scaling(scale, scale, scale), Matrix.RotationYawPitchRoll(mPosX, pitch, roll) * Matrix.Translation(spritePos.X, spritePos.Y, spritePos.Z)); i have heard somethign about inverting the worldMatrix but i am not sure this is correct???

Share this post


Link to post
Share on other sites
Advertisement
If I am not mistaken point sprites are aligned with the view vector by default. So you can simply use them. Take a look at:

http://www.gamedev.net/reference/programming/features/pointspritevb/page2.asp

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
or use D3DXSprite, its has an easy option to draw view aligned sprites ..


Doh! I completely forgot about that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!