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

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

## 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.

noone? anyone?

##### Share on other sites
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 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 on other sites
Quote:
 Original post by healeyx76sorry, 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 on other sites
Then you'll have gaps. Just like pixel lines have pixellation.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013600
×