Jump to content
  • Advertisement
Sign in to follow this  
sandy_india

Wireframe 3d image rotation

This topic is 4447 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!