← Back

ofxGrabCam

github.com/elliotwoods/ofxGrabCam · @elliotwoods
OF 0.12 Graphics

Simple camera (ofEasyCam replacement) for openFrameworks for quickly browsing your scene

76 22 Last commit 1mo ago Created 15y ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

interactiveNode 3 commits ahead · last commit 14y ago
interactive 2 commits ahead · last commit 14y ago

README

ofxGrabCam



<img src="https://raw.github.com/elliotwoods/ofxGrabCam/master/ofxaddons_thumbnail.png" />

Camera for browsing your 3D world in openFrameworks, which 'picks' the xyz position under the cursor, so all your mouse actions are performed relative to that point in 3D space.

Rotations and zoom are then performed with respect to that xyz position. Rotations are performed using a trackball model.

Inspired by Google SketchUp (http://sketchup.google.com/)

Elliot Woods http://www.kimchiandchips.com

Usage



``c++ //in your app .h ofxGrabCam camera
c++ //in your .cpp

void ofApp::draw() { camera.begin(); { //do your 3d drawing } camera.end(); }
``

Controls

ofxGrabCam (general)

Left click drag = rotate

Right click drag = zoom

Mouse wheel = zoom towards the point under the cursor (scroll up to zoom in)

hold 'h' whilst left click drag = pan

'r' key = reset

Example project

'c' = toggle draw cursor

'u' = toggle fix up vector

License

MIT License http://en.wikipedia.org/wiki/MIT_License

Notes



We use glReadPixels to read back the depth buffer around the mouse cursor to find the XYZ position Reading back the depth buffer happens only when required (e.g. mouse down/dragged, or when you enable the 3D cursor)

Testimonials



"this is basically the best thing ever." - kyle mcdonald

"this is absolute crap" - golan levin

Get this addon

HTTPS
SSH