Is there any C# 3D Graphics Library that can help me calculating 2D positions of 3D object in space?

578 Views Asked by At

My goal is that I put some objects in a 3D space and call Render(),then this library could tell me the rendering position on 2d screen of each object.

Or like a 3d game engine,but I want to take over the rendering part,I want to render these objects myself.

Can any one help me?

2

There are 2 best solutions below

2
On BEST ANSWER

What about XNAMath? That should be good enough to satisfy all your needs. In fact it is now a part of DirectX SDK.

Edit: If you want some practical insight into geometry for computer graphics, here's a comprehensive book that covers all the topics. And no matter what graphics you're designing, a game, cg demo or anything, math is the same everywhere.

1
On

Any library supporting matrix operations may be helpful but I recommend you to use Managed DirectX. It has many utility functions especially for 3D graphics.

After you select a library, make a proper view matrix and a projection matrix using that. Multiply the two matrices into a matrix, and then multiply the matrix with a position in 3D(the center of a object or some vertex). The result vecter will point the position of the object in 2D screen. This is a standard pipeline of 3D graphics, you can find many references using the keyword.