Sign in to follow this  
sandy_india

Wireframe 3d image rotation

Recommended Posts

Hi, I'm working on an embedded project. We are using wireframe modeling to represent 3d images. My requirement is that when that images(consider 12 lines cube) is rotated the lines on the back side should not be visble. Few lines should only e partially visible. But I don't know do I implement this. I'm not using any graphics library. Want to write my own algorithm. Please do help. Thanks, Sandy

Share this post


Link to post
Share on other sites
This doesn't belong in visual arts, it's a code issue and needs attention from a forum which covers the API or language you are using.

Share this post


Link to post
Share on other sites
DogCity is right, this belongs elsewhere (try Graphics Programming section)

I'll start you out though:
The first step you can take is called "back-face culling"
It basically means, when the artists create the mesh, they define a "front" face for each triangle/polygon. This side is determined at lead time by the order the points for each polygon are listed (Clockwise or Counter Clockwise)

Back face culling has to do with polygons, not lines, but you may end up wanting to work with polygons anyway.

Basically, you perform a dot product between the view-vector ->polygon, and the surface normal (normal/perpendicular vector)
if it's positive, it's visible (depending upon how you set up that view-vector -> polygon) negative, it faces away (don't draw it)

However, if you're planning on having wireframe object *occlude* objects behind them, you're *really* doing polygonal rendering - you're just filling all the polygons with the background color, and drawing the wireframe.

(This is rather easy to do, and probably what you'll want in the end)
In this case, you'll want to look up scan-line conversion if you're *really* averse to using Direct3d and OpenGL and don't want to use an already defined polygon filling routine.

HTH,
-Michael g.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this