[ 
https://issues.apache.org/jira/browse/GEOMETRY-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17116105#comment-17116105
 ] 

Matt Juntunen commented on GEOMETRY-95:
---------------------------------------

I'm just trying to get a sense of what you have in mind for visibility 
determination since there are many ways to do that. One way (which is one that 
we've done at my day job), is to take a number of rays from certain vantage 
points and cast them against the objects in the scene. If the ray intersection 
with object {{A}} is closer than the ray intersection for object {{B}}, then 
object {{B}} is occluded by {{A}} at that point. This is effective and quick 
but it does not give a completely full picture of the situation since only a 
finite number of rays can be cast. It is possible that the object visibility is 
not what is expected at one of the points that was not tested. However, this 
approach can also given you valuable information about the visible point, such 
as the point coordinates and normal.

Another option is to take the objects being tested, project them onto a 2D 
plane (see GEOMETRY-67), and compute the difference of the regions. In this 
case, you would take object {{B}}, project it onto a plane orthogonal to your 
look direction, and then subtract the projection of object {{A}} onto that same 
plane. If the resulting 2D region is not empty, then some portion of {{B}} is 
not occluded by {{A}}. This provides a completely full picture of the 
visibility (using an orthographic projection) but would not be able to provide 
visible point coordinates or surface normals. 

Which of the above approaches is best depends on a number of factors, such how 
much accuracy is required, how complex the models in question are, whether 
surface normals are needed, whether or not the models must be transformed 
before comparison, etc. That's why I was asking for more details on your 
particular use case.

> CSG Examples
> ------------
>
>                 Key: GEOMETRY-95
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-95
>             Project: Apache Commons Geometry
>          Issue Type: New Feature
>            Reporter: Matt Juntunen
>            Priority: Major
>              Labels: beta1
>
> Adding Constructive Solid Geometry examples and userguide entries to help new 
> users to the library use these features.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to