how to do billboarding in HLSL

Started by
0 comments, last by dhanji 19 years, 7 months ago
Correct my if im wrong, but if i wanna do billboarding in HLSL i just have to pass the inverse in the view matrix then get data in it to apply rotaton to the vertecies. Now any clues how to do this ? Not the complet code but the logic. I know how to manupulate and set the .FX files.
************THOUE*****Spec:Intel: 2.8GHzAti Radeon 9800 pro1024mg RAMDevelopping C# DX 9.0c appsThx you!
Advertisement
why would u want to? I find its better to use the ID3DXSprite interface then use ID3DXEffect to apply your shaders on transformed/lit verts.
Also think that would be faster.

If you pass the inverse of the view transform then you pretty much are operating in camera-space, unless Im much mistaken this is NOT what u want. Billboarding is just rotating a quad to face the camera, this can be done by simply keeping track of the angle between the camera and its lookat position (camera yaw) and assigning that value to the yaw of a billboard.
If u use Sprites you wont have to worry about that either I believe.
________________
"I'm starting to think that maybe it's wrong to put someone who thinks they're a Vietnamese prostitute on a bull"       -- Stan from South Park
Lab74 Entertainment | Project Razor Online: the Future of Racing (flashsite preview)

This topic is closed to new replies.

Advertisement