Re: [osg-users] Finding the edge of a frustum, or intersection with the edge of a frustum

2019-11-15 Thread Brad Colbert
Hi, I thought I would post my solution for finding the intersection of circles with a rectangle. Used to test were circles are intersecting the edge of my Ortho projection. Code: bool isPointOnSegment(const osg::Vec3d& p1, const osg::Vec3d& p2, const osg::Vec3d& point) { // First test th

Re: [osg-users] Finding the edge of a frustum, or intersection with the edge of a frustum

2019-11-09 Thread Glenn Waldron
Brad, You take the plane that defines the left side of the view frustum; then you intersect your line with that plane. I find this is easiest to do in normalized clip space (which goes from [-1..1] in each dimension). The left plane will be defined as point=(-1,0,0), normal=(1,0,0). You can conver

[osg-users] Finding the edge of a frustum, or intersection with the edge of a frustum

2019-11-08 Thread Brad Colbert
Hi, I'm using an ortho frustum to draw a map. On the map I'm drawing a kind of range ring / sector pattern, starting from an origin using lines. I want to draw text at the edge of the viewport where the lines intersect with the edge (well, just inside so the text is viewable). The problem I'