[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: |
Thu, 26 Jun 2003 06:56:59 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/06/26 06:56:59
Modified files:
include/vob/vobs: Fillet.hxx
vob/demo/multifil: fillet3d.py
Log message:
fix normals
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/fillet3d.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.27
libvob/include/vob/vobs/Fillet.hxx:1.28
--- libvob/include/vob/vobs/Fillet.hxx:1.27 Thu Jun 26 05:26:18 2003
+++ libvob/include/vob/vobs/Fillet.hxx Thu Jun 26 06:56:58 2003
@@ -548,7 +548,7 @@
FilletSpan2::Conn conn(thick_t, angle_t, t0, t1, d);
CircularNode node(ZVec(0,0,0), r);
- LinearConnectionHalf c1(node, 0/*angle*/, d, conn.th, 1, 0/*z*/);
+ LinearConnectionHalf c1(node, 0/*angle*/, d, conn.th, -1, 0/*z*/);
StretchedCircleFillet f1(node, c1, conn.a);
@@ -596,19 +596,19 @@
for (j = 0; j <= ndice; j++) {
float a = 2 * M_PI * j / ndice;
- glVertex3f(v[i].x,
- cos(a) * v[i].y,
- sin(a) * v[i].y);
glNormal3f(n[i].x,
cos(a) * n[i].y,
sin(a) * n[i].y);
+ glVertex3f(v[i].x,
+ cos(a) * v[i].y,
+ sin(a) * v[i].y);
- glVertex3f(v[i + 1].x,
- cos(a) * v[i + 1].y,
- sin(a) * v[i + 1].y);
glNormal3f(n[i + 1].x,
cos(a) * n[i + 1].y,
sin(a) * n[i + 1].y);
+ glVertex3f(v[i + 1].x,
+ cos(a) * v[i + 1].y,
+ sin(a) * v[i + 1].y);
}
glEnd();
}
Index: libvob/vob/demo/multifil/fillet3d.py
diff -u libvob/vob/demo/multifil/fillet3d.py:1.1
libvob/vob/demo/multifil/fillet3d.py:1.2
--- libvob/vob/demo/multifil/fillet3d.py:1.1 Thu Jun 26 05:26:18 2003
+++ libvob/vob/demo/multifil/fillet3d.py Thu Jun 26 06:56:58 2003
@@ -29,6 +29,26 @@
from vob.putil.demokeys import *
from vob.paper.texcache import getCachedTexture
+vp = [
+GL.createProgram(cg.compile("""
+void main(
+ float4 pos: POSITION,
+ float3 norm: NORMAL,
+ out float4 opos: POSITION,
+ out float4 col: COLOR
+) {
+ opos = mul(glstate.matrix.mvp, pos);
+ float4x4 foo = glstate.matrix.modelview[0];
+ float3 t = normalize(float3(
+ dot(foo[0].xyz, norm),
+ dot(foo[1].xyz, norm),
+ dot(foo[2].xyz, norm)));
+ col.rgb = 0.5 * t + 0.5;
+ col.a = 1;
+}
+
+""", "arbvp1")),
+]
class Scene:
@@ -52,7 +72,7 @@
def scene(self, vs):
vs.put( background((.5,1,.2)))
vs.put(getDListNocoords("""
- PushAttrib POLYGON_BIT
+ PushAttrib POLYGON_BIT ENABLE_BIT
Enable DEPTH_TEST
DepthFunc LEQUAL
LineWidth 1
@@ -103,7 +123,9 @@
vs.put(getDListNocoords("""
Color 1 1 1
- """))
+ BindProgram VERTEX_PROGRAM_ARB %s
+ Enable VERTEX_PROGRAM_ARB
+ """ % vp[0].getProgId()))
pc(conns)
vs.put(getDListNocoords("""
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul..., Tuomas J. Lukka, 2003/06/06
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul..., Janne V. Kujala, 2003/06/25
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul..., Janne V. Kujala, 2003/06/26
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul...,
Janne V. Kujala <=
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul..., Janne V. Kujala, 2003/06/27
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul..., Janne V. Kujala, 2003/06/27
- [Gzz-commits] libvob include/vob/vobs/Fillet.hxx vob/demo/mul..., Janne V. Kujala, 2003/06/27