Skip to main content
gamedev.net
🔒 Locked

Need billboard help/tutorial

Started by johnnyBravo Jul 17, 2003 at 1:57 AM 3 replies 1.9k views
Original Post
johnnyBravo
johnnyBravo
Hi, I''m trying to learn billboards using directx 9. I''ve looked at the sdk but its example of billboards seems extremely messy, like the rest of them, which i cannot understand. So i''m wondering if anyone can provided a quick tutorial on how to draw a simple billboard picture. If you do not have time for this, could you just give me a few pointers, such as, do i load the picture the same way i load up a 2D sprite, with D3DXCreateTextureFromFileEx using colour keys? and from loading it, what do i type in to display it from there?
RaphaelMun
RaphaelMun
Billboards... yup, i hate the sdk sample programs. Not documented well enough in my opinion. But yea, basically define 4 vertices, load up the texture, set the texture, draw trianglestrip, then set the texture to null. Simple as that.
quote:
do i load the picture the same way i load up a 2D sprite, with D3DXCreateTextureFromFileEx using colour keys?

yup, good easy way of loading textures I''d say. Supports a good number of formats too!
If you want the color keys, you''re gonna have to use either alpha testing or alpha blend to complete transparency when rendering.
Syrillix
Syrillix
im assuming you know how to make vertex buffers.. but any tutorial (open gl or direct x) can teach you what you need to know about how to make billboards.. gl''s a touch easier since you go straight ahead and define the vertices on the fly, i think the direct x way is to use rotation matrices to make a quad face you.. at any rate i think its a good idea to learn both, it can only help you...


Get busy livin'' or get busy dyin''... - Shawshank Redemption
Altered Vision
Get busy livin' or get busy dyin'... - Shawshank RedemptionIf a man is talking in the forest, and no woman is around to hear him, is he still wrong? - UnknownFulcrum
johnnyBravo
johnnyBravo
yes i know how to make vertex buffers.

so basically a billboard is just a square that you manually rotate towards the camera?
RaphaelMun
RaphaelMun
If the size is to be constant you could use the transformed vertex format (xyzrhwtex1 or somethin like that) to display the billboard (for menus and such). Then you don't have to worry about the billboard being smaller or larger than you'd like and I'm pretty sure it'd be drawn on top of everything else. Good luck dude!

EDIT: I just realized you had two posts... oops. Well I'm guessing this is related to the other post so yea, um I hope I helped somewhat. Sorry if I didn't. Good luck though!

[edited by - RaphaelMun on July 17, 2003 3:52:11 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.