[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul... |
Date: |
Fri, 30 May 2003 10:47:09 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Changes by: Janne V. Kujala <address@hidden> 03/05/30 10:47:09
Modified files:
include/vob/vobs: Fillet.hxx
vob/demo/multifil: multifil.py randgraph.py
Log message:
add non-filleting flag
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/multifil.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/randgraph.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.4
libvob/include/vob/vobs/Fillet.hxx:1.5
--- libvob/include/vob/vobs/Fillet.hxx:1.4 Thu May 29 14:47:17 2003
+++ libvob/include/vob/vobs/Fillet.hxx Fri May 30 10:47:09 2003
@@ -176,57 +176,83 @@
a2, d2, th2, lerp(p0.z, p2.z, .5));
// Render it. XXX -- jvk, you need to make this
// render the solid fillet.
- if(sp.split()) {
- if(flags & 1) {
- ZVec intern;
- glBegin(GL_QUAD_STRIP);
- for(float f = 0; f < .5; f+= 1.0 / ndice) {
- ZVec p = sp.point(f, BlendSimply(), &intern);
- v(p);
- v(intern);
- }
- glEnd();
- glBegin(GL_QUAD_STRIP);
- for(float f = 1; f > .5; f-= 1.0 / ndice) {
- ZVec p = sp.point(f, BlendSimply(), &intern);
- v(p);
- v(intern);
+ if(!(flags & 8)) {
+ if(sp.split()) {
+ if(flags & 1) {
+ ZVec intern;
+ glBegin(GL_QUAD_STRIP);
+ for(float f = 0; f < .5; f+= 1.0 / ndice) {
+ ZVec p = sp.point(f, BlendSimply(), &intern);
+ v(p);
+ v(intern);
+ }
+ glEnd();
+ glBegin(GL_QUAD_STRIP);
+ for(float f = 1; f > .5; f-= 1.0 / ndice) {
+ ZVec p = sp.point(f, BlendSimply(), &intern);
+ v(p);
+ v(intern);
+ }
+ glEnd();
+ }
+ if(flags & 2) {
+ glBegin(GL_LINE_STRIP);
+ for(float f = 0; f < .5; f+= 1.0 / ndice) {
+ ZVec p = sp.point(f, BlendSimply());
+ vl(p);
+ }
+ glEnd();
+ glBegin(GL_LINE_STRIP);
+ for(float f = 1; f > .5; f-= 1.0 / ndice) {
+ ZVec p = sp.point(f, BlendSimply());
+ vl(p);
+ }
+ glEnd();
+ }
+ } else {
+ if(flags & 1) {
+ ZVec intern;
+ glBegin(GL_QUAD_STRIP);
+ for(float f = 0; f < 1; f+= 1.0 / ndice) {
+ ZVec p = sp.point(f, BlendSimply(), &intern);
+ v(p);
+ v(intern);
+ }
+ glEnd();
+ }
+ if(flags & 2) {
+ glBegin(GL_LINE_STRIP);
+ for(float f = 0; f < 1; f+= 1.0 / ndice) {
+ ZVec p = sp.point(f, BlendSimply(), 0);
+ vl(p);
+ }
+ glEnd();
}
- glEnd();
- }
- if(flags & 2) {
- glBegin(GL_LINE_STRIP);
- for(float f = 0; f < .5; f+= 1.0 / ndice) {
- ZVec p = sp.point(f, BlendSimply());
- vl(p);
- }
- glEnd();
- glBegin(GL_LINE_STRIP);
- for(float f = 1; f > .5; f-= 1.0 / ndice) {
- ZVec p = sp.point(f, BlendSimply());
- vl(p);
- }
- glEnd();
}
} else {
+ // Render non-filleted connection
if(flags & 1) {
- ZVec intern;
- glBegin(GL_QUAD_STRIP);
- for(float f = 0; f < 1; f+= 1.0 / ndice) {
- ZVec p = sp.point(f, BlendSimply(), &intern);
+ glBegin(GL_TRIANGLE_FAN);
+ v(ctr);
+ for(float f = 0; f <= 1; f+= 1.0 / ndice) {
+ float a = lerp(a1, a2, f);
+ ZVec p = ctr + dirVec(a) * csize;
v(p);
- v(intern);
}
glEnd();
- }
- if(flags & 2) {
+ }
+ if (flags & 2) {
glBegin(GL_LINE_STRIP);
- for(float f = 0; f < 1; f+= 1.0 / ndice) {
- ZVec p = sp.point(f, BlendSimply(), 0);
+ ZVec p = 0.5 * (p0 + p1);
+ vl(p);
+ for(float f = 0; f <= 1.0; f+= 1.0 / ndice) {
+ float a = lerp(a1, a2, f);
+ ZVec p = ctr + dirVec(a) * csize;
vl(p);
}
glEnd();
}
+
}
}
};
Index: libvob/vob/demo/multifil/multifil.py
diff -u libvob/vob/demo/multifil/multifil.py:1.2
libvob/vob/demo/multifil/multifil.py:1.3
--- libvob/vob/demo/multifil/multifil.py:1.2 Fri May 30 04:59:12 2003
+++ libvob/vob/demo/multifil/multifil.py Fri May 30 10:47:09 2003
@@ -21,6 +21,7 @@
Toggle("drawInside", 1, "Draw inside", "i"),
Toggle("depthColor", 0, "Color from depth", "d"),
Toggle("lines", 0, "Toggle showing lines", "l"),
+ Toggle("fillets", 1, "Toggle filleting", "f"),
)
def scene(self, vs):
putnoc(vs, background((.5,1,.2)))
@@ -28,7 +29,7 @@
PushAttrib POLYGON_BIT
Enable DEPTH_TEST
DepthFunc LEQUAL
- LineWidth 10
+ LineWidth 1
PolygonOffset -100 -100
ShadeModel SMOOTH
"""))
@@ -38,9 +39,9 @@
dice = 200
conns = GLRen.createSortedConnections(
- GLRen.createFilletSpan1(dice, 1 + 4*self.depthColor))
+ GLRen.createFilletSpan1(dice, 1 + 4*self.depthColor +
8*(1-self.fillets)))
conns_l = GLRen.createSortedConnections(
- GLRen.createFilletSpan1(dice, 2 + 4*self.depthColor))
+ GLRen.createFilletSpan1(dice, 2 + 4*self.depthColor +
8*(1-self.fillets)))
size = 50
Index: libvob/vob/demo/multifil/randgraph.py
diff -u libvob/vob/demo/multifil/randgraph.py:1.6
libvob/vob/demo/multifil/randgraph.py:1.7
--- libvob/vob/demo/multifil/randgraph.py:1.6 Fri May 30 06:18:29 2003
+++ libvob/vob/demo/multifil/randgraph.py Fri May 30 10:47:09 2003
@@ -23,6 +23,7 @@
Toggle("lines", 0, "Toggle showing lines", "l"),
SlideLin("N", 21, 3, "N", "-", "+"),
SlideLin("ang", 21, 3, "Rotation angle", "Prior", "Next"),
+ Toggle("fillets", 1, "Toggle filleting", "f"),
)
def scene(self, vs):
putnoc(vs, background((.5,1,.2)))
@@ -40,9 +41,9 @@
dice = 200
conns = GLRen.createSortedConnections(
- GLRen.createFilletSpan1(dice, 1 + 4*self.depthColor))
+ GLRen.createFilletSpan1(dice, 1 + 4*self.depthColor +
8*(1-self.fillets)))
conns_l = GLRen.createSortedConnections(
- GLRen.createFilletSpan1(dice, 2 + 4*self.depthColor))
+ GLRen.createFilletSpan1(dice, 2 + 4*self.depthColor +
8*(1-self.fillets)))
size = 10
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul...,
Janne V. Kujala <=