Three-dimensional graphics classes and functions.
Drawing in 3d no matter the API you are using (openGL, directX...) usually involves:
-
Representing the geometry you want to draw. For that openFrameworks has some classes like ofMesh or the different 3d primitives.
-
Positioning that geometry in 3d space. openFrameworks provides the class ofNode contained also in this module which allows to easily work with 3d transformations, it can be used to position, rotate, scale or make an object look at some position or other object in an easy way. openFrameworks objects that can be positioned in 3d in this module or others are ofNodes (extend ofNode), for example ofCamera or ofLight
-
Defining which kind of camera we use to look at the scene, the perspective transformation we use to represent the scene. openFrameworks has 2 types of camera that you can use to render the scene using diffent perspective settings. ofCamera allows to set such perspective ajusting parameters like it's FOV (field of vision) and it's also an ofNode which allows to position it in 3d space or make it look at other objects in the scene in an easy way. ofEasyCam is a quick way to set a camera in a scene that can be directly manipulated with the mouse.
When working with 3d geometry in openFrameworks it's recomended to use of3dPrimitive since it's already an ofNode so it's really easy to position it in 3d space. of3dPrimitive is also optimized to use the fastest way to draw the geometry in each platform.
Apart from this classes this module also contains some functions to quickly draw the most used primitives like spheres, cones, boxes... although this is a really easy way to draw something, if you are going to need to position several objects on a scene it's recommended to use of3dPrimitive instead since it'll allow to transform the object in an easier way than using global transformations.
- of3dGraphics
- of3dGraphics()
- drawArrow()
- drawAxis()
- drawBox()
- drawCone()
- drawCylinder()
- drawGrid()
- drawGridPlane()
- drawIcoSphere()
- drawPlane()
- drawRotationAxes()
- drawSphere()
- getBoxResolution()
- getConeResolution()
- getCylinderResolution()
- getIcoSphereResolution()
- getPlaneResolution()
- getSphereResolution()
- setBoxResolution()
- setConeResolution()
- setCylinderResolution()
- setIcoSphereResolution()
- setPlaneResolution()
- setSphereResolution()
- ofDrawBox()
- ofDrawCone()
- ofDrawCylinder()
- ofDrawIcoSphere()
- ofDrawPlane()
- ofDrawSphere()
- ofGetBoxResolution()
- ofGetConeResolution()
- ofGetCylinderResolution()
- ofGetIcoSphereResolution()
- ofGetPlaneResolution()
- ofGetSphereResolution()
- ofSetBoxResolution()
- ofSetConeResolution()
- ofSetCylinderResolution()
- ofSetIcoSphereResolution()
- ofSetPlaneResolution()
- ofSetSphereResolution()
- of3dPrimitive
- of3dPrimitive()
- ~of3dPrimitive()
- disableColors()
- disableNormals()
- disableTextures()
- draw()
- drawAxes()
- drawFaces()
- drawNormals()
- drawVertices()
- drawWireframe()
- enableColors()
- enableNormals()
- enableTextures()
- getMesh()
- getMeshPtr()
- getTexCoords()
- getTexCoordsPtr()
- hasNormalsEnabled()
- hasScaling()
- isUsingVbo()
- mapTexCoords()
- mapTexCoordsFromTexture()
- operator=()
- setUseVbo()
- ofBoxPrimitive
- ofBoxPrimitive()
- ~ofBoxPrimitive()
- getDepth()
- getHeight()
- getResolution()
- getResolutionDepth()
- getResolutionHeight()
- getResolutionWidth()
- getSideIndices()
- getSideMesh()
- getSize()
- getWidth()
- resizeToTexture()
- set()
- setDepth()
- setHeight()
- setMode()
- setResolution()
- setResolutionDepth()
- setResolutionHeight()
- setResolutionWidth()
- setSideColor()
- setWidth()
- ofCamera
- ofCamera()
- ~ofCamera()
- begin()
- cameraToWorld()
- disableOrtho()
- drawFrustum()
- enableOrtho()
- end()
- getAspectRatio()
- getFarClip()
- getForceAspectRatio()
- getFov()
- getImagePlaneDistance()
- getLensOffset()
- getModelViewMatrix()
- getModelViewProjectionMatrix()
- getNearClip()
- getOrtho()
- getProjectionMatrix()
- isVFlipped()
- screenToWorld()
- setAspectRatio()
- setFarClip()
- setForceAspectRatio()
- setFov()
- setLensOffset()
- setNearClip()
- setRenderer()
- setVFlip()
- setupOffAxisViewPortal()
- setupPerspective()
- worldToCamera()
- worldToScreen()
- ofConePrimitive
- ofConePrimitive()
- ~ofConePrimitive()
- getCapIndices()
- getCapMesh()
- getConeIndices()
- getConeMesh()
- getHeight()
- getRadius()
- getResolution()
- getResolutionCap()
- getResolutionHeight()
- getResolutionRadius()
- set()
- setCapColor()
- setHeight()
- setMode()
- setRadius()
- setResolution()
- setResolutionCap()
- setResolutionHeight()
- setResolutionRadius()
- setTopColor()
- ofCylinderPrimitive
- ofCylinderPrimitive()
- ~ofCylinderPrimitive()
- getBottomCapIndices()
- getBottomCapMesh()
- getCapped()
- getCylinderIndices()
- getCylinderMesh()
- getHeight()
- getRadius()
- getResolution()
- getResolutionCap()
- getResolutionHeight()
- getResolutionRadius()
- getTopCapIndices()
- getTopCapMesh()
- set()
- setBottomCapColor()
- setCapped()
- setCylinderColor()
- setHeight()
- setMode()
- setRadius()
- setResolution()
- setResolutionCap()
- setResolutionHeight()
- setResolutionRadius()
- setTopCapColor()
- ofEasyCam
- ofEasyCam()
- addInteraction()
- begin()
- clearControlArea()
- disableInertia()
- disableMouseInput()
- disableMouseMiddleButton()
- enableInertia()
- enableMouseInput()
- enableMouseMiddleButton()
- getControlArea()
- getDistance()
- getDrag()
- getInertiaEnabled()
- getMouseInputEnabled()
- getMouseMiddleButtonEnabled()
- getRelativeYAxis()
- getTarget()
- getTranslationKey()
- getUpAxis()
- hasInteraction()
- removeAllInteractions()
- removeInteraction()
- reset()
- setAutoDistance()
- setControlArea()
- setDistance()
- setDrag()
- setEvents()
- setRelativeYAxis()
- setRotationSensitivity()
- setTarget()
- setTranslationKey()
- setTranslationSensitivity()
- setUpAxis()
- ofMesh
- ofMesh_()
- ~ofMesh_()
- addColor()
- addColors()
- addIndex()
- addIndices()
- addNormal()
- addNormals()
- addTexCoord()
- addTexCoords()
- addTriangle()
- addVertex()
- addVertices()
- append()
- axis()
- box()
- clear()
- clearColors()
- clearIndices()
- clearNormals()
- clearTexCoords()
- clearVertices()
- cone()
- cylinder()
- disableColors()
- disableIndices()
- disableNormals()
- disableTextures()
- draw()
- drawFaces()
- drawVertices()
- drawWireframe()
- enableColors()
- enableIndices()
- enableNormals()
- enableTextures()
- flatNormals()
- getCentroid()
- getColor()
- getColors()
- getColorsPointer()
- getFace()
- getFaceNormals()
- getIndex()
- getIndexPointer()
- getIndices()
- getMeshForIndices()
- getMode()
- getNormal()
- getNormals()
- getNormalsPointer()
- getNumColors()
- getNumIndices()
- getNumNormals()
- getNumTexCoords()
- getNumVertices()
- getTexCoord()
- getTexCoords()
- getTexCoordsPointer()
- getUniqueFaces()
- getVertex()
- getVertices()
- getVerticesPointer()
- hasColors()
- hasIndices()
- hasNormals()
- hasTexCoords()
- hasVertices()
- icosahedron()
- icosphere()
- load()
- mergeDuplicateVertices()
- plane()
- removeColor()
- removeIndex()
- removeNormal()
- removeTexCoord()
- removeVertex()
- save()
- setColor()
- setColorForIndices()
- setFromTriangles()
- setIndex()
- setMode()
- setNormal()
- setTexCoord()
- setVertex()
- setupIndicesAuto()
- smoothNormals()
- sphere()
- usingColors()
- usingIndices()
- usingNormals()
- usingTextures()
- ofNode
- ofNode()
- ~ofNode()
- boom()
- clearParent()
- customDraw()
- dolly()
- draw()
- getGlobalOrientation()
- getGlobalPosition()
- getGlobalScale()
- getGlobalTransformMatrix()
- getHeadingDeg()
- getHeadingRad()
- getLocalTransformMatrix()
- getLookAtDir()
- getOrientationEulerDeg()
- getOrientationEulerRad()
- getOrientationQuat()
- getParent()
- getPitchDeg()
- getPitchRad()
- getPosition()
- getRollDeg()
- getRollRad()
- getScale()
- getSideDir()
- getUpDir()
- getX()
- getXAxis()
- getY()
- getYAxis()
- getZ()
- getZAxis()
- lookAt()
- move()
- operator=()
- orbitDeg()
- orbitRad()
- panDeg()
- panRad()
- resetTransform()
- restoreTransformGL()
- rollDeg()
- rollRad()
- rotate()
- rotateAround()
- rotateAroundDeg()
- rotateAroundRad()
- rotateDeg()
- rotateRad()
- setGlobalOrientation()
- setGlobalPosition()
- setOrientation()
- setParent()
- setPosition()
- setScale()
- tiltDeg()
- tiltRad()
- transformGL()
- truck()