Projecting a line segment onto a polygon mesh

mhjlam

I am working on a 3d application and am currently looking for a way to project a line segment defined by two points in screen-space onto a three-dimensional polygonal mesh (in my case a triangle mesh). The goal is to find the intersection points in world-space of the line segment with the edges of the mesh.

I can only think of two ways to do this, but neither is ideal. The first is to sample the line segment (in screen-space) at small intervals and ray trace at those intervals to find the world-space coordinates where the ray hits the mesh, but this does not easily give me the intersection points of the line segment with the mesh edges.

The other way I can think of is to somehow back-project the mesh into screen-space, find the intersections there (in 2d) and then project those intersection points back to 3d. The problem with this is that the screen-space coordinate system may change between the selection of the first and second endpoints of the line segment (due to moving the camera).

If any of that was confusing, then here is an image that approximately shows what I'm trying to do (the white dots indicate the points that I want to find). However, in my case the yellow curve is simply a line segment.

enter image description here [Yunjin Lee, et al. "Mesh scissoring with minima rule and part salience." 2005]

Any help is very much appreciated.

Gareth Rees

Here's my suggestion:

  1. Project the screen line into world space (getting a plane in world space).

  2. Intersect the plane with the triangles in the mesh, getting a set of edges.

  3. Add the edges to a data structure that keeps only the parts of the edges that are closest to the camera plane (see the diagram below, in which the red line segments and their endpoints are the ones we want to keep). This is like building up an image via a Z-buffer, except that because we know that this set is piecewise linear, we don't have to rasterize it, we can just maintain a sorted list of endpoints.

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Intersection of line segment and convex polygon

From Dev

How to split a general closed polygon by a line segment

From Dev

Finding whether a line segment is completely inside the Polygon or not

From Dev

Cesium how to 'drape' a polygon or line onto terrain surface

From Dev

Automapper query for projecting an anonymous type onto a viewmodel

From Dev

projecting points onto a plane given by a normal and a point

From Dev

Determining best start and end points for line segment on polygon

From Dev

HoloLens polygon rendering with mesh

From Dev

Looking for a function allowing to select/identify polygon that share a line segment with a source polygon

From Dev

Looking for a function allowing to select/identify polygon that share a line segment with a source polygon

From Dev

texture mapping onto triangle mesh

From Dev

Intersection of segment with polygon

From Dev

Intersection of segment with polygon

From Dev

Projecting a point onto the intersection of n-dimensional spaces in Python

From Dev

Projecting 3D Model onto 2d plane

From Dev

Summing While Projecting a Dictionary Onto a Sub-Tuple Key

From Dev

Unity + Mapbox IFeaturePropertySettable on Generated Mesh from Polygon?

From Dev

Create a polygon around a line

From Dev

Render scene onto custom mesh with three.js

From Dev

Find out if segment is fully inside of polygon

From Dev

Interpolating data onto a line of points

From Dev

Overlaying line segments onto a circle

From Dev

Orthogonal Projection of Point onto Line

From Dev

Orthogonal Projection of Point onto Line

From Dev

Line segment intersection

From Dev

Line Segment and Circle Intersection

From Dev

Ray to Line Segment Intersection

From Dev

JavaFX Line segment width

From Dev

determinate: is point on line segment

Related Related

  1. 1

    Intersection of line segment and convex polygon

  2. 2

    How to split a general closed polygon by a line segment

  3. 3

    Finding whether a line segment is completely inside the Polygon or not

  4. 4

    Cesium how to 'drape' a polygon or line onto terrain surface

  5. 5

    Automapper query for projecting an anonymous type onto a viewmodel

  6. 6

    projecting points onto a plane given by a normal and a point

  7. 7

    Determining best start and end points for line segment on polygon

  8. 8

    HoloLens polygon rendering with mesh

  9. 9

    Looking for a function allowing to select/identify polygon that share a line segment with a source polygon

  10. 10

    Looking for a function allowing to select/identify polygon that share a line segment with a source polygon

  11. 11

    texture mapping onto triangle mesh

  12. 12

    Intersection of segment with polygon

  13. 13

    Intersection of segment with polygon

  14. 14

    Projecting a point onto the intersection of n-dimensional spaces in Python

  15. 15

    Projecting 3D Model onto 2d plane

  16. 16

    Summing While Projecting a Dictionary Onto a Sub-Tuple Key

  17. 17

    Unity + Mapbox IFeaturePropertySettable on Generated Mesh from Polygon?

  18. 18

    Create a polygon around a line

  19. 19

    Render scene onto custom mesh with three.js

  20. 20

    Find out if segment is fully inside of polygon

  21. 21

    Interpolating data onto a line of points

  22. 22

    Overlaying line segments onto a circle

  23. 23

    Orthogonal Projection of Point onto Line

  24. 24

    Orthogonal Projection of Point onto Line

  25. 25

    Line segment intersection

  26. 26

    Line Segment and Circle Intersection

  27. 27

    Ray to Line Segment Intersection

  28. 28

    JavaFX Line segment width

  29. 29

    determinate: is point on line segment

HotTag

Archive