3D object parallel projection, filtering of facets

Arjan82
Messages
625
Reaction score
619
TL;DR
If you have some object consisting of vertices in 3D and some facets. What algorithm is used to visualize this in any 3D program?
I'm sorry if the wording is a bit clunky, but this is not a common topic for me.

Say you have some 3D object consisting of vertices and facets. There are many tools that can visualize this and they only show its projection on 2D, i.e. on your screen. I presume that you would filter the faces which need to be drawn on the screen before any actual drawing occurs since only the visible facets should be drawn. Could anyone point me to an algorithm that is used to do this filtering?

I'm only interested in parallel projection (i.e. no perspective). And I also want to show the 'back side' of a facet if it is visible.
 
Technology news on Phys.org
X and Y are the screen surface, Z is distance behind screen

A conceptually 'simple' approach for transparent objects:
A) Sort the points by their Z co-ordinate
B) Plot each point starting with the point furthest from the screen

For opaque objects you must remove or suppress any/all points that are obscured by (enclosed within) an opaque polygon that is closer to the screen.
C) Display the points starting with the point closest to the screen
D) For each point of greater Z, if the display point is enclosed within an opaque polygon, discard it.
NOTE: when doing perspective projections, opaque objects are much more difficult because the opaque planes are seldom parallel to the display surface.

These operations would typically be done in a buffer in main memory and sent to the screen when completed. It's is generally faster that way, but you may want to animate the image by generating it in display memory (or displaying the result of each point). This can be useful for debugging.

Overall, use an existing library or public domain code if possible; you will probably spend less time looking than you would doing original coding!

Cheers,
Tom
 
Tom.G said:
D) For each point of greater Z, if the display point is enclosed within an opaque polygon, discard it.
NOTE: when doing perspective projections, opaque objects are much more difficult because the opaque planes are seldom parallel to the display surface.

Yes, this is exactly what I am hoping to do :). But I do not need polygon intersections, I only need to determine if a polygon is (partly) obscured by others. See below.

[edit]: and I don't need perspective projections, only parallel (orthographic projection, is it called?)

Tom.G said:
These operations would typically be done in a buffer in main memory and sent to the screen when completed. It's is generally faster that way, but you may want to animate the image by generating it in display memory (or displaying the result of each point). This can be useful for debugging.

Luckily I don't have to be fast. I'm not trying to draw an interactive moving object.

Actually, what I'm trying to do is a bit of a hack. I have a solution of a computation given on a grid (i.e. vertices + connectivity of a 20-node brick element). The grid is of a volume but I'm only interested in the solution of the outer faces of the outer bricks, 'which I can see' (luckily for me the object is topographically a sphere, so no obscured faces on the outside). Thus I need a 'filter' to get me the faces of the bricks that I need. Unfortunately there is no trivial way to get this out of the solution files I have (normals may be flipped, it is not always the same face of the brick element that is on the outside, there are completely enclosed elements).

So I was thinking if I could steal an algorithm from the graphics department of computer science to get me this filter. I reckoned/thought/hoped that there where algorithms available that do the kind of filtering I need before drawing something on a screen.

Or maybe someone has a better idea :)
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 0 ·
Replies
0
Views
832
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
6
Views
3K
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
2
Views
3K