diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2009-10-20 23:22:19 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2009-10-20 23:22:19 +0400 |
commit | 5240d39e48f97d032853da63377de23db36d657d (patch) | |
tree | bf36242d4a4c91bfe39e2effecd9bcbab57fc9d2 /source/blender/editors/space_view3d/drawvolume.c | |
parent | 9327dd91124e9ac03370d112b7c016884ad2f727 (diff) |
Smoke:
* Revert "speedup" through not using GL_POLYGON - wasn't helping at all, only confusing the source
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawvolume.c | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 6b9fe0ed259..a1a59fb0e6a 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -463,57 +463,14 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture } } - if(numpoints==3) - { - glBegin(GL_TRIANGLES); - glColor3f(1.0, 1.0, 1.0); - for (i = 0; i < numpoints; i++) { - glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]); - glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); - } - glEnd(); - } - else if(numpoints == 4) - { - glBegin(GL_QUADS); - glColor3f(1.0, 1.0, 1.0); - for (i = 0; i < numpoints; i++) { - glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]); - glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); - } - glEnd(); - } - else if(numpoints == 5) - { - glBegin(GL_TRIANGLES); - glColor3f(1.0, 1.0, 1.0); - for (i = 0; i < 3; i++) { - glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]); - glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); - } - glEnd(); - glBegin(GL_QUADS); - glColor3f(1.0, 1.0, 1.0); - for (i = 2; i < numpoints; i++) { - glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]); - glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); - } - i = 0; + // printf("numpoints: %d\n", numpoints); + glBegin(GL_POLYGON); + glColor3f(1.0, 1.0, 1.0); + for (i = 0; i < numpoints; i++) { glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]); - glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); - glEnd(); - } - else - { - // printf("numpoints: %d\n", numpoints); - glBegin(GL_POLYGON); - glColor3f(1.0, 1.0, 1.0); - for (i = 0; i < numpoints; i++) { - glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]); - glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); - } - glEnd(); + glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); } + glEnd(); } n++; } |