Changeset 4907 for nanovis/trunk
- Timestamp:
- Dec 23, 2014, 5:24:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nanovis/trunk/VolumeInterpolator.cpp
r3630 r4907 5 5 */ 6 6 #include <string.h> 7 #include <memory.h>8 #include <time.h>9 7 #include <sys/time.h> 10 #include <math.h>11 #include <stdlib.h>12 8 13 9 #include <vrmath/Vector3f.h> … … 21 17 22 18 VolumeInterpolator::VolumeInterpolator() : 23 _volume( 0),19 _volume(NULL), 24 20 _interval(8.0), 25 21 _started(false), … … 55 51 float interp; 56 52 57 computeKeys(fraction, _volumes.size(), &interp, &key1, &key2);53 computeKeys(fraction, (int)_volumes.size(), &interp, &key1, &key2); 58 54 59 55 if (interp == 0.0f) { … … 70 66 normal1 = (*(Vector3f*)(data1 + 1) - 0.5) * 2; 71 67 normal2 = (*(Vector3f*)(data2 + 1) - 0.5) * 2; 72 normal = (normal2 - normal 2) * interp + normal1;68 normal = (normal2 - normal1) * interp + normal1; 73 69 normal = normal.normalize(); 74 70 normal = normal * 0.5 + 0.5; … … 90 86 int *key1, int *key2) 91 87 { 92 int limit = (int)count - 1;88 int limit = count - 1; 93 89 if (fraction <= 0) { 94 90 *key1 = *key2 = 0; … … 99 95 } else { 100 96 int n; 101 for (n = 0; n < limit; n++) {102 if (fraction >= (n / (count - 1.0f)) && 97 for (n = 0; n < limit; n++) { 98 if (fraction >= (n / (count - 1.0f)) && 103 99 fraction < ((n+1)/(count-1.0f))) { 104 100 break;
Note: See TracChangeset
for help on using the changeset viewer.