reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

of3dGraphics.h
Go to the documentation of this file.
1//
2// of3dGraphics.h
3// openFrameworksLib
4//
5// Created by Nick Hardeman on 9/14/12.
6//
7//
8
9#pragma once
10
11#include "of3dPrimitives.h"
12
13
15
23void ofSetPlaneResolution( int columns, int rows );
24
29glm::vec2 ofGetPlaneResolution();
30
40void ofDrawPlane(float x, float y, float width, float height);
41
52void ofDrawPlane(float x, float y, float z, float width, float height);
53
62void ofDrawPlane(const glm::vec3& position, float width, float height);
63
67void ofDrawPlane( float width, float height );
68
70
79void ofSetSphereResolution(int res);
80
84
94void ofDrawSphere(float x, float y, float radius);
95
105void ofDrawSphere(float x, float y, float z, float radius);
106
113void ofDrawSphere(const glm::vec3& position, float radius);
114
122void ofDrawSphere(float radius);
123
124OF_DEPRECATED_MSG("Use ofDrawSphere instead.", void ofSphere(float x, float y, float radius) );
125OF_DEPRECATED_MSG("Use ofDrawSphere instead.", void ofSphere(float x, float y, float z, float radius) );
126OF_DEPRECATED_MSG("Use ofDrawSphere instead.", void ofSphere(const glm::vec3& position, float radius) );
127OF_DEPRECATED_MSG("Use ofDrawSphere instead.", void ofSphere(float radius) );
128
136void ofSetIcoSphereResolution( int res );
137
142
152void ofDrawIcoSphere(float x, float y, float z, float radius);
153
163void ofDrawIcoSphere(float x, float y, float radius);
164
172void ofDrawIcoSphere(const glm::vec3& position, float radius);
173
181void ofDrawIcoSphere(float radius);
182
184
193void ofSetCylinderResolution( int radiusSegments, int heightSegments, int capSegments=2 );
194
203glm::vec3 ofGetCylinderResolution();
204
216void ofDrawCylinder(float x, float y, float radius, float height);
217
229void ofDrawCylinder(float x, float y, float z, float radius, float height);
230
241void ofDrawCylinder(const glm::vec3& position, float radius, float height);
242
250void ofDrawCylinder(float radius, float height);
251
253
264void ofSetConeResolution( int radiusSegments, int heightSegments, int capSegments=2);
265
279glm::vec3 ofGetConeResolution();
280
292void ofDrawCone(float x, float y, float z, float radius, float height);
293
304void ofDrawCone(float x, float y, float radius, float height);
305
315void ofDrawCone(const glm::vec3& position, float radius, float height);
316
325void ofDrawCone(float radius, float height);
326
327OF_DEPRECATED_MSG("Use ofDrawCone instead.", void ofCone(float x, float y, float z, float radius, float height) );
328OF_DEPRECATED_MSG("Use ofDrawCone instead.", void ofCone(float x, float y, float radius, float height) );
329OF_DEPRECATED_MSG("Use ofDrawCone instead.", void ofCone(const glm::vec3& position, float radius, float height) );
330OF_DEPRECATED_MSG("Use ofDrawCone instead.", void ofCone(float radius, float height) );
331
333
338void ofSetBoxResolution( int res );
339
344void ofSetBoxResolution( int resWidth, int resHeight, int resDepth );
345
353glm::vec3 ofGetBoxResolution();
354
369void ofDrawBox( float x, float y, float z, float width, float height, float depth);
370
386void ofDrawBox(float x, float y, float z, float size);
387
401void ofDrawBox(const glm::vec3& position, float width, float height, float depth);
402
413void ofDrawBox(const glm::vec3& position, float size);
414
421void ofDrawBox(float size);
422
435void ofDrawBox( float width, float height, float depth );
436
437// deprecated methods //
438OF_DEPRECATED_MSG("Use ofDrawBox instead.", void ofBox( float x, float y, float z, float width, float height, float depth) );
439OF_DEPRECATED_MSG("Use ofDrawBox instead.", void ofBox(float x, float y, float z, float size) );
440OF_DEPRECATED_MSG("Use ofDrawBox instead.", void ofBox(const glm::vec3& position, float width, float height, float depth) );
441OF_DEPRECATED_MSG("Use ofDrawBox instead.", void ofBox(const glm::vec3& position, float size) );
442OF_DEPRECATED_MSG("Use ofDrawBox instead.", void ofBox(float size) );
443OF_DEPRECATED_MSG("Use ofDrawBox instead.", void ofBox( float width, float height, float depth ) );
444
446public:
450 of3dGraphics(ofBaseRenderer * renderer);
451
453
458 void setPlaneResolution( int columns, int rows );
459
467 glm::vec2 getPlaneResolution() const;
468
479 void drawPlane(float x, float y, float width, float height) const;
480
491 void drawPlane(float x, float y, float z, float width, float height) const;
492
501 void drawPlane(const glm::vec3& position, float width, float height) const;
502
510 void drawPlane( float width, float height ) const;
511
513
523 void setSphereResolution(int res);
524
529 int getSphereResolution() const;
530
540 void drawSphere(float x, float y, float radius) const;
541
548 void drawSphere(float x, float y, float z, float radius) const;
549
557 void drawSphere(const glm::vec3& position, float radius) const;
558
565 void drawSphere(float radius) const;
566
575 void setIcoSphereResolution( int res );
576
581 int getIcoSphereResolution() const;
582
592 void drawIcoSphere(float x, float y, float z, float radius) const;
593
603 void drawIcoSphere(float x, float y, float radius) const;
604
612 void drawIcoSphere(const glm::vec3& position, float radius) const;
613
621 void drawIcoSphere(float radius) const;
622
624
634 void setCylinderResolution( int radiusSegments, int heightSegments, int capSegments=2 );
635
643 glm::vec3 getCylinderResolution() const;
644
656 void drawCylinder(float x, float y, float radius, float height) const;
657
669 void drawCylinder(float x, float y, float z, float radius, float height) const;
670
682 void drawCylinder(const glm::vec3& position, float radius, float height) const;
683
692 void drawCylinder(float radius, float height) const;
693
695
704 void setConeResolution( int radiusSegments, int heightSegments, int capSegments=2);
705
720 glm::vec3 getConeResolution() const;
721
733 void drawCone(float x, float y, float z, float radius, float height) const;
734
746 void drawCone(float x, float y, float radius, float height) const;
747
757 void drawCone(const glm::vec3& position, float radius, float height) const;
758
767 void drawCone(float radius, float height) const;
768
770
775 void setBoxResolution( int res );
776
784 void setBoxResolution( int resWidth, int resHeight, int resDepth );
785
793 glm::vec3 getBoxResolution() const;
794
809 void drawBox( float x, float y, float z, float width, float height, float depth) const;
810
828 void drawBox(float x, float y, float z, float size) const;
829
843 void drawBox(const glm::vec3& position, float width, float height, float depth) const;
844
856 void drawBox(const glm::vec3& position, float size) const;
857
864 void drawBox(float size) const;
865
877 void drawBox( float width, float height, float depth ) const;
878
886 void drawAxis(float size) const;
887
896 void drawGrid(float stepSize, size_t numberOfSteps, bool labels, bool x, bool y, bool z) const;
897
902 void drawGridPlane(float stepSize, size_t numberOfSteps, bool labels) const;
903
908 void drawArrow(const glm::vec3& start, const glm::vec3& end, float headSize) const;
909
919 void drawRotationAxes(float radius, float stripWidth, int circleRes) const;
920
921private:
922 void renderCached3dPrimitive( const of3dPrimitive& model ) const;
923 mutable ofBaseRenderer * renderer;
924 ofPlanePrimitive plane;
925 ofSpherePrimitive sphere;
926 ofIcoSpherePrimitive icoSphere;
927 ofBoxPrimitive box;
928 ofConePrimitive cone;
929 ofCylinderPrimitive cylinder;
930 ofBoxPrimitive boxWireframe;
931 of3dPrimitive axis;
932
933};
Definition of3dGraphics.h:445
void drawCylinder(float x, float y, float radius, float height) const
Draw a cylinder using x, y, radius, and height.
Definition of3dGraphics.cpp:241
void drawPlane(float x, float y, float width, float height) const
Draw a plane using x, y, width, and height.
Definition of3dGraphics.cpp:112
void drawGridPlane(float stepSize, size_t numberOfSteps, bool labels) const
Draw a coordinate system plane using the y and z axes.
Definition of3dGraphics.cpp:427
glm::vec3 getCylinderResolution() const
Get the current cylinder resolution as a 3D vector.
Definition of3dGraphics.cpp:236
void setConeResolution(int radiusSegments, int heightSegments, int capSegments=2)
Set the resolution to use when drawing cones.
Definition of3dGraphics.cpp:273
void setBoxResolution(int res)
Set the resolution to use when drawing boxes.
Definition of3dGraphics.cpp:317
void setSphereResolution(int res)
Set the resolution to use when drawing spheres.
Definition of3dGraphics.cpp:143
void drawRotationAxes(float radius, float stripWidth, int circleRes) const
Draw the coordinate system's rotation axes.
Definition of3dGraphics.cpp:499
glm::vec3 getBoxResolution() const
Get the current box resolution as a 3D vector.
Definition of3dGraphics.cpp:329
void drawArrow(const glm::vec3 &start, const glm::vec3 &end, float headSize) const
Draw an arrow between two 3D points.
Definition of3dGraphics.cpp:482
void drawSphere(float x, float y, float radius) const
Draw a sphere.
Definition of3dGraphics.cpp:165
void drawIcoSphere(float x, float y, float z, float radius) const
Draw an icosphere.
Definition of3dGraphics.cpp:198
glm::vec3 getConeResolution() const
Get the cone resolution.
Definition of3dGraphics.cpp:280
void drawAxis(float size) const
Draw the coordinate system's axes.
Definition of3dGraphics.cpp:374
int getIcoSphereResolution() const
Get the current icosphere resolution.
Definition of3dGraphics.cpp:193
void drawGrid(float stepSize, size_t numberOfSteps, bool labels, bool x, bool y, bool z) const
Draw the coordinate system's axes as a grid.
Definition of3dGraphics.cpp:383
void setIcoSphereResolution(int res)
Set the resolution to use when drawing icospheres.
Definition of3dGraphics.cpp:186
void setPlaneResolution(int columns, int rows)
Set the plane resolution using column and rows.
Definition of3dGraphics.cpp:101
void drawBox(float x, float y, float z, float width, float height, float depth) const
Draw a cube.
Definition of3dGraphics.cpp:334
void setCylinderResolution(int radiusSegments, int heightSegments, int capSegments=2)
Set the resolution to use when drawing cylinders.
Definition of3dGraphics.cpp:229
int getSphereResolution() const
Get the current sphere resolution.
Definition of3dGraphics.cpp:150
glm::vec2 getPlaneResolution() const
Get the current plane resolution as a 2D vector.
Definition of3dGraphics.cpp:107
void drawCone(float x, float y, float z, float radius, float height) const
Draw a cone.
Definition of3dGraphics.cpp:285
A class representing a 3d primitive.
Definition of3dPrimitives.h:12
The base renderer interface.
Definition ofGraphicsBaseTypes.h:279
The ofBoxPrimitive allows you to create cubes and cuboids.
Definition of3dPrimitives.h:511
The ofConePrimitive allows you to create a 3D cone. Like all primitives it allows you to set the size...
Definition of3dPrimitives.h:408
The ofCylinderPrimitive allows you to create an cylinder mesh.
Definition of3dPrimitives.h:316
The ofIcoSpherePrimitive allows you to create an icosphere. An icosphere is a sphere not based on UV ...
Definition of3dPrimitives.h:256
The ofPlanePrimitive allows you to create an UV plane. Can be used for example as simple canvas for p...
Definition of3dPrimitives.h:120
The ofSpherePrimitive allows you to create a UV sphere. A UV spherewhich is a sphere based on UV slic...
Definition of3dPrimitives.h:204
void ofBox(float x, float y, float z, float width, float height, float depth)
Definition of3dGraphics.cpp:782
void ofSphere(float x, float y, float z, float radius)
Definition of3dGraphics.cpp:739
void ofCone(float x, float y, float z, float radius, float height)
Definition of3dGraphics.cpp:759
void ofDrawSphere(float x, float y, float radius)
Draw a sphere with the current renderer.
Definition of3dGraphics.cpp:579
void ofSetPlaneResolution(int columns, int rows)
Set the resolution to use when drawing planes.
Definition of3dGraphics.cpp:537
void ofDrawCone(float x, float y, float z, float radius, float height)
Draw a cone with the current renderer.
Definition of3dGraphics.cpp:673
glm::vec3 ofGetConeResolution()
Get the current cone resolution.
Definition of3dGraphics.cpp:668
void ofDrawCylinder(float x, float y, float radius, float height)
Draw a cylinder with the current renderer.
Definition of3dGraphics.cpp:643
glm::vec2 ofGetPlaneResolution()
Get the current renderer's plane resolution as a vector.
Definition of3dGraphics.cpp:542
int ofGetIcoSphereResolution()
Get the icosphere resolution used by the current renderer.
Definition of3dGraphics.cpp:606
glm::vec3 ofGetCylinderResolution()
Get the current renderer's cylinder resolution as a 3D vector.
Definition of3dGraphics.cpp:638
void ofSetConeResolution(int radiusSegments, int heightSegments, int capSegments=2)
Set the cone resolution for the current renderer.
Definition of3dGraphics.cpp:663
void ofSetBoxResolution(int res)
Set the resolution the current renderer uses when drawing boxes.
Definition of3dGraphics.cpp:693
void ofSetSphereResolution(int res)
Set the sphere resolution for the current renderer.
Definition of3dGraphics.cpp:569
void ofDrawIcoSphere(float x, float y, float z, float radius)
Draw an icosphere with the current renderer.
Definition of3dGraphics.cpp:611
void ofDrawBox(float x, float y, float z, float width, float height, float depth)
Draw a cube with the current renderer.
Definition of3dGraphics.cpp:708
int ofGetSphereResolution()
Get the sphere resolution used by the current renderer.
Definition of3dGraphics.cpp:574
void ofDrawPlane(float x, float y, float width, float height)
Draw a plane with the current renderer.
Definition of3dGraphics.cpp:547
glm::vec3 ofGetBoxResolution()
Get the current renderer's box resolution as a 3D vector.
Definition of3dGraphics.cpp:703
void ofSetIcoSphereResolution(int res)
Set the icosphere resolution for the current renderer.
Definition of3dGraphics.cpp:601
void ofSetCylinderResolution(int radiusSegments, int heightSegments, int capSegments=2)
Set the cylinder resolution for the current renderer.
Definition of3dGraphics.cpp:633
unsigned int height
Definition ofAppEGLWindow.cpp:125
unsigned int width
Definition ofAppEGLWindow.cpp:124
#define OF_DEPRECATED_MSG(message,...)
Definition ofConstants.h:78