3D object parallel projection, filtering of facets

AI Thread Summary
The discussion centers on the challenge of visualizing a 3D object composed of vertices and facets in a 2D space using parallel projection, specifically focusing on filtering visible facets for rendering. The user seeks an algorithm that can efficiently determine which facets should be displayed, emphasizing the need to show the back sides of facets if they are visible. Key points include the proposed approach for handling transparent and opaque objects. For transparent objects, sorting points by their Z-coordinate and plotting from the furthest to the closest is suggested. For opaque objects, the need to discard points obscured by closer polygons is highlighted. The user expresses a preference for using existing libraries or public domain code to save time on development.The user clarifies that they do not require polygon intersections but rather need to identify if polygons are partially obscured. They are working with a specific computational solution on a grid and aim to filter out the visible outer faces of brick elements, noting that their object resembles a sphere, which simplifies visibility concerns.
Arjan82
Messages
624
Reaction score
618
TL;DR Summary
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 :)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top