jbich

06-24-2005, 07:36 AM

Hey all.

Lots of people have hit on the 2d/3d thing and I've looked into all the posts, but I'm still stuck on something... perhaps it's how I'm thinking about it...

In a 3d game, I want to build a 2d interface. You can't (as per the redbook) switch at will between 2d (ortho) and 3d (perspective/frustrum) projection.

If I had a window that's 640x480, how could I draw a box that's say 200 px tall and 100 px wide using a 3d point system?

It seems clunky to use Project/Unproject to do this as it was designed for mouse coordinates, and (again as per the redbook) there are inherant problems at the conceptual level doing project/unproject calculations.

If there are no transformations in my matrices, is there a simple algorithm that I can use to calculate real world pixel information from/to 3d world points?

I did have the thought that perhaps I could make the z coord a large negative, so that the x,y coords matched real world pixels... is that a solution? Is there a better one?

Anyone know how the "pros" do it?

Also, in a normal 3d environment, is it possible to make the origin (0,0) the bottom left hand side of the screen?

Thanks so much for any insight you can provide!

j

Lots of people have hit on the 2d/3d thing and I've looked into all the posts, but I'm still stuck on something... perhaps it's how I'm thinking about it...

In a 3d game, I want to build a 2d interface. You can't (as per the redbook) switch at will between 2d (ortho) and 3d (perspective/frustrum) projection.

If I had a window that's 640x480, how could I draw a box that's say 200 px tall and 100 px wide using a 3d point system?

It seems clunky to use Project/Unproject to do this as it was designed for mouse coordinates, and (again as per the redbook) there are inherant problems at the conceptual level doing project/unproject calculations.

If there are no transformations in my matrices, is there a simple algorithm that I can use to calculate real world pixel information from/to 3d world points?

I did have the thought that perhaps I could make the z coord a large negative, so that the x,y coords matched real world pixels... is that a solution? Is there a better one?

Anyone know how the "pros" do it?

Also, in a normal 3d environment, is it possible to make the origin (0,0) the bottom left hand side of the screen?

Thanks so much for any insight you can provide!

j