Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:cpp:libraries:openframeworks:creating_graphics [2015/10/10 09:54] alfred [ofPath] |
wiki2:cpp:libraries:openframeworks:creating_graphics [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 132: | Línea 132: | ||
| ofRect(20,20,20,20); | ofRect(20,20,20,20); | ||
| </code> | </code> | ||
| - | ... enclosed that between ofPush/PopMatrix. But they are also deprecated. Each call to them, or the gl equivalents for that matter, are doing a multiplication of 4x4 matrices. But we can avoid it somehow. Instead of doing all of the multiplications of the matrices every frame, we can use an ofMatrix4x4 for each shape we use, do all of that shape's transformations once (or every time the shape moves), and apply them later when we want to draw that frame: | + | ... enclosed that between ''ofPushMatrix'' or ''ofPopMatrix''. But they are also deprecated. Each call to them, or the gl equivalents for that matter, are doing a multiplication of 4x4 matrices. But we can avoid it somehow. Instead of doing all of the multiplications of the matrices every frame, we can use an ofMatrix4x4 for each shape we use, do all of that shape's transformations once (or every time the shape moves), and apply them later when we want to draw that frame: |
| <code cpp> | <code cpp> | ||
| ofPath path | ofPath path | ||
| Línea 305: | Línea 305: | ||
| </code> | </code> | ||
| + | You can change the way the mesh is drawn using the next constants for the ''setMode'' method: OF_PRIMITIVE_TRIANGLES, OF_PRIMITIVE_TRIANGLE_STRIP, OF_PRIMITIVE_TRIANGLE_FAN, OF_PRIMITIVE_LINES, OF_PRIMITIVE_LINE_STRIP, OF_PRIMITIVE_LINE_LOOP, OF_PRIMITIVE_POINTS. | ||
| + | You can draw the wireframe, the points using the ''drawWireframe()'' and ''drawVertices()'' methods. | ||
| ==== of3dPrimitive ==== | ==== of3dPrimitive ==== | ||