3d drawing

0 pts.
Tags:
Development
IT architecture
how i draw 3d line's with vb without useing Direct X or OpenGL
ASKED: March 9, 2005  6:02 AM
UPDATED: March 10, 2005  3:42 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Depending on what level of detail and accuracy you need this is either going to be easy or painful! If you are not using a 3D API like OpenGL or DirectX, you need to do the math yourself to project your 3D drawing onto a 2D surface and then just use the normal line drawing commands. Obviously, this won’t give you any of the lighting, shading, texturing etc. that appears in most 3D scenes but it will allow you to draw, for example, wireframe representations of quite complex 3D geometric objects.

As a very simple starting point, imagine you have a cube that you wish to draw in 3D (i.e. using a perspective projection) – each vertex of the cube will be defined by an (x, y, z) coordinate. The simplest way to draw this shape on a 2D surface is to divide each (x, y) by the corresponding z (or some multiple thereof). If that’s all you need then your done! If you need to animate your drawing – by rotating shapes for example, you must use conventional 3D geometry to transform your starting vertices (the x,y,z’s) according to the effect you desire, and then project onto 2D using the simplistic “divide by z” method as the final step.

The above will not allow you to do things that OpenGL and DirectX will do easily though – there will be no hidden line removal (i.e. lines *behind* other shapes will still be visible), but like I said at the outset, it really depends on your application.

Hope that helps,
Roger

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following