Jump to content
  • Advertisement
Sign in to follow this  
TAlchemist

3d mesh oriented to camera

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

i want to draw a 3d mesh so that is always oriented to the camera and just in front of it, always drawing over the entire area of the screen as an interface. That way i can just do a subset intersection test with D3DX to determine interface clicking. But so far i tried using billboarding like i do for my crappy little tree billboards but it doesnt seem to work right. is there a good way to draw this mesh over everything else and then check it for collisions?

Share this post


Link to post
Share on other sites
Advertisement
This is a post someone else made that should give you an idea about how to do interfaces in 2D with Direct3D.

ace

Share this post


Link to post
Share on other sites
is there no way to just get the mesh to align? that would be easy for me. i am working on using quads but would prefer to use my meshes.

Share this post


Link to post
Share on other sites
Consider this. If you have a camera and take pictures using it (that is, render the world) you get clean pictures of the world. But if you put your finger slightly in front of the camera you take the world and the finger in front of it. Move the camera to any target but keep the finger. Then you render the world but the finger is still there. The finger becomes your GUI...

The idea, consider the camera like an additional 3d object in the scene. As any object it should be rendered and as any object you assign a mesh to it and a texture set and a shader. So, you can move the camera and point any section of your game, as the mesh is attached to the camera it will always be rendered from the same viewpoint. The world will be rendered behind it.

Luck!
Guimo

Share this post


Link to post
Share on other sites
i have a major weird problem with point sprites.

i borrowed the code from the pointsprite sample in D3D 8.1 and got a nicelooking particle emitter going in my world now but when ever i rotate the camera to look down the X axis or cross over the X axis i loose the entire screen to horribly scaled particles and my FPS drops from 150 to 2-7.

any idea what could cause this or what can fix it?

Share this post


Link to post
Share on other sites
Billboarding is indeed aligning a quad, so if that doesn't work, then you may have something else wrong. The easiest way in my opinion is to change the view to orthographic, setting its width and height parameters to 1, then drawing the quad with vertices at 0,0 and 1,1 (or with a 0.5 pixel offset as required). However, this would be a lot of stuff and wasted frame time if you are just trying to get the x,y positions of where the user clicked the mouse on the screen. You can simply catch the MOUSECLICK windows messages and get that info.

EDIT: I would recommend posting your second question as a new topic as it doesn't relate to this topic, and most people probably aren't going to read it if they don't know it's in here.

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.

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!