Jump to content
  • Advertisement
Sign in to follow this  
healeyx76

How would I draw a 3D Solid Plane? (in data)

This topic is 5143 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

Im looking for the most basic techniques to draw a plane. Say i have just a 3d array and I need a plane drawn in it. The only way I've thought of is to use Bresenham line drawing in 3d. I draw a "thickness" line, and then from each pixel on that line draw a perpindicular line and from each pixel on that line, draw yet another perpindicular line(to both previous). The problem with this is that it leaves gaps inside the plane sometimes. I figured I could just have it draw 4 pixels at once in an effort to get rid of gaps, but now I have the need to store the vectors of the plane and if I just do a 4 block, it messes it up. Any other ideas? Thanks a bunch.

Share this post


Link to post
Share on other sites
Advertisement
ax+by+cz+d==0;

Equation of a plane if I remember correctly.

Save a,b,c,d into a struct. Voila!

To actually draw it, do mathematical intersection with the cube that represents the maximal and minimal values of your x,y,z system. This should yield 4 lines, whose intersections form 4 vertices needed for a DX or OGL quad [rectangle].


Share this post


Link to post
Share on other sites
sorry, this is a discrete system that does not use graphics at all. By "draw" I would mean "change the pixel at [x][y][z] to a new value for all of the plane".

Its just a big 3D grid that I have to make planes in. Im using C, but any programming method will help, i just need a better way to do this, or an alternative that I can improve upon.

Share this post


Link to post
Share on other sites
Quote:
Original post by healeyx76
sorry, this is a discrete system that does not use graphics at all. By "draw" I would mean "change the pixel at [x][y][z] to a new value for all of the plane".


Actually, I found "draw" clearer than "change the pixel..." :) What I understand is than you are going to draw the plane in a 3D space (and not a projection of a 3D plane onto a 2D device). Just as if you had a real 3D screen. Am I right ? I will assume that I'm right :)

Bresenham will not allow you to correctly fill the whole surface. You'll probably have holes. Maybe some kind of 3D rasterisation method would work - I think it is the way to go : add one dimension to the classic polygon filler.

HTH

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!