Advertisement

Wireframe 3d image rotation

Started by July 20, 2006 12:33 AM
1 comment, last by Thr33d 18 years, 5 months ago
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
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.
------ ----- ---- --- -- -Export-Games.com is searching for talented and friendly developers. Visit our Help Wanted post for more info!My Indie development uber Journal - A game production walk through.
Advertisement
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.

This topic is closed to new replies.

Advertisement