Sign in to follow this  
Meshboy

Make Sprite always face the camera

Recommended Posts

Meshboy    130
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
cabbar    127
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
Dave Hunt    4872
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this