[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] libvob/include/vob/vobs Fillet.hxx
From: |
Janne V. Kujala |
Subject: |
[ff-cvs] libvob/include/vob/vobs Fillet.hxx |
Date: |
Tue, 19 Aug 2003 05:32:37 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/08/19 05:32:37
Modified files:
include/vob/vobs: Fillet.hxx
Log message:
use fract-based color interp
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Fillet.hxx.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
Patches:
Index: libvob/include/vob/vobs/Fillet.hxx
diff -u libvob/include/vob/vobs/Fillet.hxx:1.51
libvob/include/vob/vobs/Fillet.hxx:1.52
--- libvob/include/vob/vobs/Fillet.hxx:1.51 Thu Aug 14 08:24:41 2003
+++ libvob/include/vob/vobs/Fillet.hxx Tue Aug 19 05:32:35 2003
@@ -641,11 +641,11 @@
vector<Vec> v;
vector<float> tex;
- float x0 = cos(conn.a) * r;
for (i = 0; i < ndice; i++) {
- Vec p = f1.point((float)i / ndice);
+ float f = (float)i / ndice;
+ Vec p = f1.point(f);
v.push_back(p);
- tex.push_back((p.x - x0) / (d - x0));
+ tex.push_back(1 - f);
}
for (i = 0; i <= ndice; i++) {
@@ -733,7 +733,7 @@
typedef Filletoid<StretchedCircleFillet> Conn;
ZVec blend(Conn *conns[], int N, float r, ZVec pt,
- int *maxip = NULL, float *distfract = NULL) const {
+ int *maxip = NULL) const {
int i, num = 0;
double sum = 0;
float x[N];
@@ -742,8 +742,6 @@
pt = pt.normalized();
- if (distfract) *distfract = 0;
-
//cout << "Blending " << pt << ": ";
// Compute distances from the node for each fillet surface
for (i = 0; i < N; i++) {
@@ -753,10 +751,6 @@
if (t > maxt) {
maxt = t;
maxi = i;
- if (distfract) {
- float x0 = cos(conns[i]->f.tangentAngle) * r;
- *distfract = (t * conns[i]->dir.dot(pt) - x0) /
(conns[i]->c.d - x0);
- }
}
x[num++] = (t - r) / r;
@@ -1031,6 +1025,7 @@
for (int k = 0; k < N; k++) {
std::vector<ZVec> pt((ndice + 1) * ndice);
+ std::vector<float> tex(pt.size());
ZVec ref = t0.transform(ZVec(0,0,1)) - t0.transform(ZVec(0,0,0));
ZVec e0 = conns[k]->dir;
@@ -1049,22 +1044,21 @@
v.x * e0
+ v.y * cos(a) * e1
+ v.y * sin(a) * e2;
+ tex[i * ndice + j] = 1 - f;
}
}
std::vector<bool> clip(pt.size());
- std::vector<float> tex(pt.size());
// note: not blending the connection mid-point
for (j = 0; j < ndice; j++) {
pt[j] += p0;
clip[j] = false;
- tex[j] = 1;
}
for (i = 1; i <= ndice; i++) {
for (j = 0; j < ndice; j++) {
int ind = i * ndice + j;
int maxi;
- pt[ind] = blend(conns, N, r, pt[ind], &maxi, &tex[ind]) +
p0;
+ pt[ind] = blend(conns, N, r, pt[ind], &maxi) + p0;
clip[ind] = (maxi != k);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ff-cvs] libvob/include/vob/vobs Fillet.hxx,
Janne V. Kujala <=