diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-25 08:12:41 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-25 08:12:41 (GMT) |
commit | 4f7d83c00fa2cd56d60cf399ccf848fdd63e1703 (patch) | |
tree | 81d5f09437bf0606bd4c0cf07b46dfda52407f08 /polyset.cc | |
parent | bea704f141c92d2076a0102556203dab0246e39f (diff) |
Clifford Wolf:
Added CsgChain structure
Added first OpenCSG demo code
git-svn-id: http://svn.clifford.at/openscad/trunk@19 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'polyset.cc')
-rw-r--r-- | polyset.cc | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -41,8 +41,12 @@ void PolySet::insert_vertex(double x, double y, double z) polygons.last().insert(0, Point(x, y, z)); } -void PolySet::render_opengl() const +void PolySet::render_surface(colormode_e colormode) const { + if (colormode == COLOR_MATERIAL) + glColor3ub(249, 215, 44); + if (colormode == COLOR_CUTOUT) + glColor3ub(157, 203, 81); for (int i = 0; i < polygons.size(); i++) { const Polygon *poly = &polygons[i]; glBegin(GL_POLYGON); @@ -54,6 +58,23 @@ void PolySet::render_opengl() const } } +void PolySet::render_edges(colormode_e colormode) const +{ + if (colormode == COLOR_MATERIAL) + glColor3ub(255, 236, 94); + if (colormode == COLOR_CUTOUT) + glColor3ub(171, 216, 86); + for (int i = 0; i < polygons.size(); i++) { + const Polygon *poly = &polygons[i]; + glBegin(GL_LINE_STRIP); + for (int j = 0; j < poly->size(); j++) { + const Point *p = &poly->at(j); + glVertex3d(p->x, p->y, p->z); + } + glEnd(); + } +} + #ifdef ENABLE_CGAL class CGAL_Build_PolySet : public CGAL::Modifier_base<CGAL_HDS> |