Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Lightweight Ray class and operations for openFrameworks (e.g. hit detection, intersection). For more intense use check bullet physics
branch: master
Failed to load latest commit information.
ofxRayLib Plane::fitToPoints
ofxRay_example remove old examples
ofxRay_ofPlaneExample remove old examples
ofxRay_ofPlanePrimitiveExample little app name changes in example
ofxRay_ofProjectorExample remove old examples
src
.gitignore move the intersection method to update
readme.md Mention the 0.8.0 tag in Readme

readme.md

ofxRay

Introduction

A lightweight set of tools for intersection testings (e.g. does a ray intersect a plane).

Note

The current code in this repository is designed for openFrameworks 0.9.0 (which has different base classes). If you are looking for a version of ofxRay which is compatible with previous versions of openFrameworks, please check https://github.com/elliotwoods/ofxRay/tree/0.8.0 .

Objects

ofxRay::Ray

A Ray is defined by the starting point s and the transmission vector t . Check equation (5) at http://mathworld.wolfram.com/Line.html

We define a ray as an infinite line (continuing infinitely forwards and backwards along the line t and - t starting at s .

The line is defined by points s + u * t , where {-inf < u < +inf}.

A Line segment is a line which has finite length. We denote a line segment as a ofRay between s and t where infinite is set to false , i.e. a Line segment is a finite section along a ray

ofxRay::Plane

A Plane is defined by a position on the plane c and a normal vector n .

We can also define the plane using the notation a x + b y + c z + d = 0 (by using the appropriate constructor).

For a non-infinite plane, we define the bounds of the Plane segment with the 2D vector bounds, and the up vector up. We presume that the up vector and n vectors are perpendicular.

ofxRay::Projector

A Projector is defined by projection matrix and its pose (defined by ofNode which it inherits from).

We can use a projector to preview a projector or camera in a scene, and to generate pixel _ofRay_s.

ofxRay::Camera

A Camera is defined the same as a Projector, but has distortion coefficients also.

ofxRay::Geometric

All objects within ofxRay inherit from ofGeometric.

Something went wrong with that request. Please try again.