You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(11) |
May
(89) |
Jun
|
Jul
|
Aug
(130) |
Sep
(50) |
Oct
(15) |
Nov
|
Dec
(132) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(11) |
Feb
|
Mar
(4) |
Apr
(18) |
May
(8) |
Jun
|
Jul
|
Aug
(33) |
Sep
(6) |
Oct
(11) |
Nov
|
Dec
|
From: Seth Y. <sya...@us...> - 2006-10-05 23:23:45
|
Update of /cvsroot/opentreelib/otl/src/t In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14043/src/t Added Files: polylinespline3.t Log Message: - iceeey added incomplete unit test for otPolyLineSpline3. Only tests initial state, getLength(), and findNearest() so far. --- NEW FILE: polylinespline3.t --- #include "opentree/utils/otpolylinespline3.h" #include "stdio.h" using namespace opentree; class otPolyLineSpline3Test : public CppUnit::TestFixture { static const float EPSILON = 0.0001f; public: void setUp() { } void tearDown() { } bool nearEqual(float a, float b) { return (fabs(a - b) <= EPSILON); } void testInitial() { otPolyLineSpline3 s; CPPUNIT_ASSERT(s.getLength() == 0); s.setPoint(0, otVector3(0, 0, 0)); CPPUNIT_ASSERT(s.getLength() == 0); } void testLength() { otPolyLineSpline3 s(2); s.setPoint(0, otVector3(0, 0, 0)); s.setPoint(1, otVector3(1, 0, 0)); CPPUNIT_ASSERT(nearEqual(s.getLength(), 1)); s.setPoint(2, otVector3(1, 1, 0)); CPPUNIT_ASSERT(nearEqual(s.getLength(), 2)); } void testFindNearest() { /* 1 | | ____| 0 0 1 */ otPolyLineSpline3 s(2); s.setPoint(0, otVector3(0, 0, 0)); CPPUNIT_ASSERT(s.findNearest(otVector3(0, 99, 0)) == otVector3(0, 0, 0)); s.setPoint(1, otVector3(1, 0, 0)); CPPUNIT_ASSERT(s.findNearest(otVector3(2, 1, 0)) == otVector3(2, 0, 0)); CPPUNIT_ASSERT(s.findNearest(otVector3(.4, .5, 0)) == otVector3(.4, 0, 0)); CPPUNIT_ASSERT(s.findNearest(otVector3(.6, .75, 0)) == otVector3(.6, 0, 0)); s.setPoint(2, otVector3(1, 1, 0)); CPPUNIT_ASSERT(s.findNearest(otVector3(1, 2, 1)) == otVector3(1, 2, 0)); CPPUNIT_ASSERT(s.findNearest(otVector3(.6, .5, 0)) == otVector3(1, .5, 0)); } CPPUNIT_TEST_SUITE(otPolyLineSpline3Test); CPPUNIT_TEST(testInitial); CPPUNIT_TEST(testLength); CPPUNIT_TEST(testFindNearest); CPPUNIT_TEST_SUITE_END(); }; |
From: Seth Y. <sya...@us...> - 2006-10-05 23:23:44
|
Update of /cvsroot/opentreelib/otl/src/utils In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14043/src/utils Modified Files: otpolylinespline3.cpp Log Message: - iceeey added incomplete unit test for otPolyLineSpline3. Only tests initial state, getLength(), and findNearest() so far. Index: otpolylinespline3.cpp =================================================================== RCS file: /cvsroot/opentreelib/otl/src/utils/otpolylinespline3.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- otpolylinespline3.cpp 26 Sep 2006 17:29:37 -0000 1.3 +++ otpolylinespline3.cpp 5 Oct 2006 23:23:42 -0000 1.4 @@ -55,6 +55,8 @@ float otPolyLineSpline3::getLength() { + if (points.getCount() < 2) + return 0; float length = 0; for (unsigned int i=0; i<points.getCount()-1; i++) { |
From: Seth Y. <sya...@us...> - 2006-10-05 23:23:44
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14043/docs Modified Files: history.txt Log Message: - iceeey added incomplete unit test for otPolyLineSpline3. Only tests initial state, getLength(), and findNearest() so far. Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.200 retrieving revision 1.201 diff -u -d -r1.200 -r1.201 --- history.txt 5 Oct 2006 19:53:30 -0000 1.200 +++ history.txt 5 Oct 2006 23:23:42 -0000 1.201 @@ -12,6 +12,8 @@ to test only the 'opentree' module. - iceeey added unit test for otVector3 class. TODO: Test the vector rotation functions. + - iceeey added incomplete unit test for otPolyLineSpline3. + Only tests initial state, getLength(), and findNearest() so far. 01-Oct-2006 - PK implemented access to the billboards generated by BBCSimple. |
From: Seth Y. <sya...@us...> - 2006-10-05 19:53:34
|
Update of /cvsroot/opentreelib/otl/src/t In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24871/src/t Added Files: vector.t Log Message: - iceeey added unit test for otVector3 class. TODO: Test the vector rotation functions. --- NEW FILE: vector.t --- #include "opentree/utils/otvector3.h" using namespace opentree; class otVector3Test : public CppUnit::TestFixture { static const float EPSILON = 0.0001f; public: void setUp() { } void tearDown() { } bool nearEqual(float a, float b) { return (fabs(a - b) <= EPSILON); } void testInitial() { otVector3 vec; CPPUNIT_ASSERT(vec.X == 0 && vec.Y == 0 && vec.Z == 0); CPPUNIT_ASSERT(vec.length() == 0); } void testNormalizeZeroVector() { otVector3 vec; // Should return another zero vector CPPUNIT_ASSERT(vec.normalize() == otVector3()); } void testCopyConstructor() { otVector3 vec = otVector3(1, 2, 3); otVector3 vec2 (vec); CPPUNIT_ASSERT(vec2.X == vec.X && vec2.Y == vec.Y && vec2.Z == vec.Z); } void testLength() { otVector3 vec (1, 0, 0); otVector3 vec2 (0, 1, 0); otVector3 vec3 (0, 0, 1); CPPUNIT_ASSERT(vec.length() == 1 && vec2.length() == 1 && vec3.length() == 1); vec = otVector3(cos(PI/4), sin(PI/4), 0); CPPUNIT_ASSERT(nearEqual(vec.length(), 1)); } void testNormalize() { CPPUNIT_ASSERT(otVector3(0, 0, 0).normalize().length() == 0); CPPUNIT_ASSERT(otVector3(2, 0, 0).normalize().length() == 1); CPPUNIT_ASSERT(nearEqual(otVector3(2, 5, 6).normalize().length(), 1)); CPPUNIT_ASSERT(nearEqual(otVector3(1, 2, 3).normalize().length(), 1)); } // Arithmetic void testAddSubtract() { CPPUNIT_ASSERT(otVector3() + otVector3(1, 2, 3) == otVector3(1, 2, 3)); CPPUNIT_ASSERT(otVector3(1, 2, 3) - otVector3(1, 2, 3) == otVector3()); } void testDotProduct() { CPPUNIT_ASSERT((otVector3() | otVector3()) == 0); CPPUNIT_ASSERT((otVector3(1, 1, 1) | otVector3()) == 0); CPPUNIT_ASSERT((otVector3(1, 1, 1) | otVector3(1, 1, 1)) == 1+1+1); CPPUNIT_ASSERT((otVector3(1, 2, 1) | otVector3(1, 1, 1)) == 1+2+1); CPPUNIT_ASSERT((otVector3(1, 2, 1) | otVector3(1, 5, 1)) == 1+10+1); CPPUNIT_ASSERT((otVector3(1, 2, 3) | otVector3(4, 5, 6)) == 4+10+18); } void testCrossProduct() { CPPUNIT_ASSERT((otVector3() & otVector3()) == otVector3()); otVector3 i (1, 0, 0); otVector3 j (0, 1, 0); otVector3 k (0, 0, 1); CPPUNIT_ASSERT((i & j) == k); CPPUNIT_ASSERT((j & i) == -k); CPPUNIT_ASSERT((i & k) == -j); CPPUNIT_ASSERT((k & i) == j); CPPUNIT_ASSERT((j & k) == i); CPPUNIT_ASSERT((k & j) == -i); CPPUNIT_ASSERT((i & i) == otVector3()); CPPUNIT_ASSERT((j & j) == otVector3()); CPPUNIT_ASSERT((k & k) == otVector3()); } // Rotation // TODO: Write rotation function test cases CPPUNIT_TEST_SUITE(otVector3Test); CPPUNIT_TEST(testInitial); CPPUNIT_TEST(testNormalizeZeroVector); CPPUNIT_TEST(testCopyConstructor); CPPUNIT_TEST(testLength); CPPUNIT_TEST(testNormalize); CPPUNIT_TEST(testAddSubtract); CPPUNIT_TEST(testDotProduct); CPPUNIT_TEST(testCrossProduct); CPPUNIT_TEST_SUITE_END(); }; |
From: Seth Y. <sya...@us...> - 2006-10-05 19:53:34
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24871/docs Modified Files: history.txt Log Message: - iceeey added unit test for otVector3 class. TODO: Test the vector rotation functions. Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.199 retrieving revision 1.200 diff -u -d -r1.199 -r1.200 --- history.txt 5 Oct 2006 14:40:58 -0000 1.199 +++ history.txt 5 Oct 2006 19:53:30 -0000 1.200 @@ -10,6 +10,8 @@ To run all the unit tests on the project, run `jam check' or `jam check_all'. Alternatively, you could run `jam check_opentree' to test only the 'opentree' module. + - iceeey added unit test for otVector3 class. + TODO: Test the vector rotation functions. 01-Oct-2006 - PK implemented access to the billboards generated by BBCSimple. |
From: Seth Y. <sya...@us...> - 2006-10-05 14:41:10
|
Update of /cvsroot/opentreelib/otl/src/t In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30076/src/t Added Files: array.t Log Message: - iceeey added incomplete unit test of otArray class. It is located in src/t/array.t since the 'opentree' module is located in src/. It would be better if it were in src/utils/t/. To run all the unit tests on the project, run `jam check' or `jam check_all'. Alternatively, you could run `jam check_opentree' to test only the 'opentree' module. --- NEW FILE: array.t --- #include "opentree/utils/otarray.h" using namespace opentree; class otArrayTest : public CppUnit::TestFixture { otArray<int> intArray; public: void setUp() { } void tearDown() { } void testInitial() { CPPUNIT_ASSERT(intArray.getCount() == 0); } void testAdd() { intArray.add(1); CPPUNIT_ASSERT(intArray.getCount() == 1); intArray.add(2); CPPUNIT_ASSERT(intArray.getCount() == 2); CPPUNIT_ASSERT(intArray[0] == 1 && intArray[1] == 2); } void testRemove() { intArray.add(1); intArray.add(2); intArray.remove(1); CPPUNIT_ASSERT(intArray.getCount() == 1); CPPUNIT_ASSERT(intArray[0] == 1); } CPPUNIT_TEST_SUITE(otArrayTest); CPPUNIT_TEST(testInitial); CPPUNIT_TEST(testAdd); CPPUNIT_TEST(testRemove); CPPUNIT_TEST_SUITE_END(); }; |
From: Seth Y. <sya...@us...> - 2006-10-05 14:41:05
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30076/docs Modified Files: history.txt Log Message: - iceeey added incomplete unit test of otArray class. It is located in src/t/array.t since the 'opentree' module is located in src/. It would be better if it were in src/utils/t/. To run all the unit tests on the project, run `jam check' or `jam check_all'. Alternatively, you could run `jam check_opentree' to test only the 'opentree' module. Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.198 retrieving revision 1.199 diff -u -d -r1.198 -r1.199 --- history.txt 1 Oct 2006 12:26:11 -0000 1.198 +++ history.txt 5 Oct 2006 14:40:58 -0000 1.199 @@ -3,6 +3,14 @@ ------------------------------------------------------------------------------- +05-Oct-2006 + - iceeey added incomplete unit test of otArray class. + It is located in src/t/array.t since the 'opentree' module is + located in src/. It would be better if it were in src/utils/t/. + To run all the unit tests on the project, run `jam check' or + `jam check_all'. Alternatively, you could run `jam check_opentree' + to test only the 'opentree' module. + 01-Oct-2006 - PK implemented access to the billboards generated by BBCSimple. |
From: Seth Y. <sya...@us...> - 2006-10-05 14:40:04
|
Update of /cvsroot/opentreelib/otl/src/t In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29648/t Log Message: Directory /cvsroot/opentreelib/otl/src/t added to the repository |
From: PK <kir...@us...> - 2006-10-01 12:26:14
|
Update of /cvsroot/opentreelib/otl/include/opentree/mesher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29060/include/opentree/mesher Modified Files: bbcsimple.h Log Message: Implementing access to the billboards generated by BBCSimple. Index: bbcsimple.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/mesher/bbcsimple.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- bbcsimple.h 26 Aug 2006 17:37:45 -0000 1.3 +++ bbcsimple.h 1 Oct 2006 12:26:12 -0000 1.4 @@ -34,7 +34,55 @@ { class BBCSimple { + public: + class Billboard : public iMesher + { + otVector3 max_v; + otVector3 min_v; + otVector3 normal; + + otMatrix trf; + + float j; + + public: + Billboard(const otVector3& max_v, const otVector3& min_v, const otMatrix& trf, float j) + : max_v(max_v), min_v(min_v), trf(trf), j(j) + { + normal = trf.apply(otVector3(0,-1,0)); + } + + ~Billboard() {} + + unsigned int getVerticesCount() { return 4; } + void getVertices(otVertices& vertices) + { + otVector3 v1 = trf.apply(otVector3(min_v.X,j, min_v.Z)); + otVector3 v2 = trf.apply(otVector3(max_v.X,j, min_v.Z)); + otVector3 v3 = trf.apply(otVector3(min_v.X,j, max_v.Z)); + otVector3 v4 = trf.apply(otVector3(max_v.X,j, max_v.Z)); + + otVector3 c(0,0.6f,0); + + vertices.add(otVertex(v1,normal,c,0,0)); + vertices.add(otVertex(v2,normal,c,1,0)); + vertices.add(otVertex(v3,normal,c,0,1)); + vertices.add(otVertex(v4,normal,c,1,1)); + } + + unsigned int getIndicesCount() { return 2; } + void getIndices(otTriangles& triangles, unsigned int offset) + { + triangles.add(otTriangle(0,1,2)+offset); + triangles.add(otTriangle(1,3,2)+offset); + } + + const otVector3& getNormal() { return normal; } + }; + private: + otArray<Billboard*> bbs; + class Linker { public: @@ -126,13 +174,98 @@ printf("\n"); printf("Total count of %d leaves\n", total); printf("Filled groups: %d of %d\n", filled_groups, max_groups); + + calcBillboards(); } ~BBCSimple() { delete [] linkers; delete [] rot_group; + bbs.delAll(); } + unsigned int getBillboardCount() { return bbs.getCount(); } + BBCSimple::Billboard* getBillboard(unsigned int idx) { return bbs.get(idx); } + + void calcBillboards() + { + bbs.setGrowRate(filled_groups * rot_groups); + for (int i=0; i<max_groups; i++) + { + if (!rot_group[i].rot_group) + continue; + + otVector3 n = rot_group[i].normal; + + otVector3 rot = n & otVector3(0,1,0); + float sign = n | otVector3(0,1,0); + + otMatrix trf; + trf.grotateRad(acosf(sign), rot); + otVector3 new_normal = trf * otVector3(0,1,0); + + float length = rot_group[i].dist_max.X-rot_group[i].dist_min.X; + float width = rot_group[i].dist_max.Z-rot_group[i].dist_min.Z; + + float delta = (rot_group[i].dist_max.Y-rot_group[i].dist_min.Y)/(rot_groups-1); + if (delta == 0) delta = 1; + + float j = rot_group[i].dist_min.Y; + + for (int jj=0; jj<rot_groups; jj++) + { + + Linker* link = rot_group[i].rot_group; + + otVector3 max_v = rot_group[i].dist_min, min_v= rot_group[i].dist_max; + + int ctr = 0; + + if (link) + { + if (link->local_pos.Y > j && link->local_pos.Y < j + delta) + { + ctr++; + if (max_v.X < link->local_pos.X ) max_v.X = link->local_pos.X+0.25f; + if (min_v.X > link->local_pos.X ) min_v.X = link->local_pos.X-0.25f; + if (max_v.Y < link->local_pos.Y ) max_v.Y = link->local_pos.Y+0.25f; + if (min_v.Y > link->local_pos.Y ) min_v.Y = link->local_pos.Y-0.25f; + if (max_v.Z < link->local_pos.Z ) max_v.Z = link->local_pos.Z+0.25f; + if (min_v.Z > link->local_pos.Z ) min_v.Z = link->local_pos.Z-0.25f; + } + + while (link != rot_group[i].rot_group_last) + { + if (link->local_pos.Y > j && link->local_pos.Y < j + delta) + { + ctr++; + if (max_v.X < link->local_pos.X ) max_v.X = link->local_pos.X+0.25f; + if (min_v.X > link->local_pos.X ) min_v.X = link->local_pos.X-0.25f; + if (max_v.Y < link->local_pos.Y ) max_v.Y = link->local_pos.Y+0.25f; + if (min_v.Y > link->local_pos.Y ) min_v.Y = link->local_pos.Y-0.25f; + if (max_v.Z < link->local_pos.Z ) max_v.Z = link->local_pos.Z+0.25f; + if (min_v.Z > link->local_pos.Z ) min_v.Z = link->local_pos.Z-0.25f; + } + + link = link->child; + } + + } + + if (ctr == 0) + { + min_v = otVector3(0,0,0); + max_v = otVector3(0,0,0); + } + + bbs.add(new Billboard(max_v, min_v, trf, j)); + + j+=delta; + } + } + } + +/* unsigned int getVertices(otVertices& vertices) { for (int i=0; i<max_groups; i++) @@ -158,15 +291,13 @@ float width = rot_group[i].dist_max.Z-rot_group[i].dist_min.Z; otVector3 c(0,0.6f,0); -/* - rot_group[i].dist_min.X = -5; - rot_group[i].dist_min.Y = 0; - rot_group[i].dist_min.Z = -5; - rot_group[i].dist_max.X = 5; - rot_group[i].dist_max.Y = 10; - rot_group[i].dist_max.Z = 5; -*/ - + + //rot_group[i].dist_min.X = -5; + //rot_group[i].dist_min.Y = 0; + //rot_group[i].dist_min.Z = -5; + //rot_group[i].dist_max.X = 5; + //rot_group[i].dist_max.Y = 10; + //rot_group[i].dist_max.Z = 5; float delta = (rot_group[i].dist_max.Y-rot_group[i].dist_min.Y)/(rot_groups-1); if (delta == 0) delta = 1; @@ -238,12 +369,12 @@ //printf("v(%d,%d): <%.1f,%.1f,%.1f><%.1f,%.1f,%.1f><%.1f,%.1f,%.1f><%.1f,%.1f,%.1f>\n", //i,jj,v1.X,v1.Y,v1.Z,v2.X,v2.Y,v2.Z,v3.X,v3.Y,v3.Z,v4.X,v4.Y,v4.Z); -/* - vertices.add(otVertex(v1,normal,-c,0,0)); - vertices.add(otVertex(v2,normal,-c,1,0)); - vertices.add(otVertex(v3,normal,-c,0,1)); - vertices.add(otVertex(v4,normal,-c,1,1)); -*/ + + //vertices.add(otVertex(v1,normal,-c,0,0)); + //vertices.add(otVertex(v2,normal,-c,1,0)); + //vertices.add(otVertex(v3,normal,-c,0,1)); + //vertices.add(otVertex(v4,normal,-c,1,1)); + printf("-> %d, %.2f, %d\n",i, j, jj); j+=delta; @@ -283,7 +414,7 @@ { return filled_groups * 2 * rot_groups; } - +*/ void check(otLeaf* leaf) { //otVector3 rot = leaf->transform.getRotationDegrees(); |
From: PK <kir...@us...> - 2006-10-01 12:26:13
|
Update of /cvsroot/opentreelib/otl/examples/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29060/examples/treeview Modified Files: treeview.cpp Log Message: Implementing access to the billboards generated by BBCSimple. Index: treeview.cpp =================================================================== RCS file: /cvsroot/opentreelib/otl/examples/treeview/treeview.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- treeview.cpp 27 Jan 2006 23:18:21 -0000 1.29 +++ treeview.cpp 1 Oct 2006 12:26:11 -0000 1.30 @@ -31,7 +31,7 @@ #include <time.h> #include <fstream> -//#define BBC //BillBoard Cloud +// #define BBC //BillBoard Cloud #ifdef BBC #include <opentree/mesher/bbcsimple.h> @@ -140,7 +140,7 @@ unsigned int offset_s = 0, offset_b = 0, offset_sb = 0; #ifdef BBC - opentree::BBCSimple bbc(ottree, 4); + opentree::BBCSimple bbc(ottree, 3); #endif //Get the amount of vertices used with the current LoD. @@ -154,7 +154,7 @@ #ifndef BBC tree->getLeavesVerticesCount(&vertexCount); #else - vertexCount += bbc.getVertexCount(); + vertexCount += bbc.getBillboardCount() * 4; #endif vertices.reserveVertices(vertexCount); @@ -165,7 +165,10 @@ #ifndef BBC tree->getLeavesVertices(vertices); #else - bbc.getVertices(vertices); + for (unsigned int i = 0; i < bbc.getBillboardCount(); i++) + { + bbc.getBillboard(i)->getVertices(vertices); + } #endif int trunk_triangleCount = 0; @@ -187,13 +190,16 @@ #ifndef BBC tree->getLeavesIndicesCount(&leaves_triangleCount); #else - leaves_triangleCount += bbc.getIndexCount(); + leaves_triangleCount += bbc.getBillboardCount() * 2; #endif leaves_triangle.reserveTriangles(leaves_triangleCount); #ifndef BBC tree->getLeavesIndices(leaves_triangle, offset_sb); #else - bbc.getIndices(leaves_triangle, offset_sb); + for (unsigned int i = 0; i < bbc.getBillboardCount(); i++) + { + bbc.getBillboard(i)->getIndices(leaves_triangle, offset_sb + i * 4); + } #endif Mesh mesh; |
From: PK <kir...@us...> - 2006-10-01 12:26:13
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29060/docs Modified Files: history.txt Log Message: Implementing access to the billboards generated by BBCSimple. Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.197 retrieving revision 1.198 diff -u -d -r1.197 -r1.198 --- history.txt 26 Sep 2006 17:29:37 -0000 1.197 +++ history.txt 1 Oct 2006 12:26:11 -0000 1.198 @@ -3,6 +3,9 @@ ------------------------------------------------------------------------------- +01-Oct-2006 + - PK implemented access to the billboards generated by BBCSimple. + 26-Sep-2006 - PK applied patch [ 1565782 ] "getCurvature() for otPolyLineSpline3" submitted by Jeroen Wouters. |
From: PK <kir...@us...> - 2006-09-26 17:29:40
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30691/docs Modified Files: history.txt Log Message: Applying patch [ 1565782 ] 'getCurvature() for otPolyLineSpline3' submitted by Jeroen Wouters. Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.196 retrieving revision 1.197 diff -u -d -r1.196 -r1.197 --- history.txt 5 Sep 2006 10:51:44 -0000 1.196 +++ history.txt 26 Sep 2006 17:29:37 -0000 1.197 @@ -3,8 +3,13 @@ ------------------------------------------------------------------------------- +26-Sep-2006 + - PK applied patch [ 1565782 ] "getCurvature() for otPolyLineSpline3" + submitted by Jeroen Wouters. + 05-Sep-2006 - Fossi fixed two errors and a warning on vc8 + 27-Aug-2006 - Fossi changed returned default color to be 1,1,1,1 - Fossi changed count in otvertices to be uint |
From: PK <kir...@us...> - 2006-09-26 17:29:40
|
Update of /cvsroot/opentreelib/otl/include/opentree/utils In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30691/include/opentree/utils Modified Files: otpolylinespline3.h Log Message: Applying patch [ 1565782 ] 'getCurvature() for otPolyLineSpline3' submitted by Jeroen Wouters. Index: otpolylinespline3.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/utils/otpolylinespline3.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- otpolylinespline3.h 27 Dec 2005 20:04:23 -0000 1.2 +++ otpolylinespline3.h 26 Sep 2006 17:29:37 -0000 1.3 @@ -90,6 +90,12 @@ otVector3 getTangent(const float x); iSpline3D* getDerivative(); + + iSpline3D* getSecondDerivative(); + + iSpline3D* getNormal(); + + iSpline1D* getCurvature(); /** Nearest point * This function searches the position where the spline is the |
From: PK <kir...@us...> - 2006-09-26 17:29:40
|
Update of /cvsroot/opentreelib/otl/src/utils In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30691/src/utils Modified Files: otpolylinespline3.cpp Log Message: Applying patch [ 1565782 ] 'getCurvature() for otPolyLineSpline3' submitted by Jeroen Wouters. Index: otpolylinespline3.cpp =================================================================== RCS file: /cvsroot/opentreelib/otl/src/utils/otpolylinespline3.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- otpolylinespline3.cpp 27 Dec 2005 20:04:23 -0000 1.2 +++ otpolylinespline3.cpp 26 Sep 2006 17:29:37 -0000 1.3 @@ -21,6 +21,7 @@ */ #include "opentree/utils/otpolylinespline3.h" +#include "opentree/utils/otpolylinespline.h" namespace opentree { @@ -64,13 +65,22 @@ otVector3 otPolyLineSpline3::getTangent(const float x) { - for (unsigned int i=0; i<points.getCount()-1; i++) + if (points[0].x <= x && points[1].x > x) { - if (points[i].x <= x && points[i+1].x >= x) + return (points[1].y-points[0].y).normalize(); + } + if (points[points.getCount()-2].x <= x && points[points.getCount()-1].x >= x) + { + return (points[points.getCount()-2].y-points[points.getCount()-1].y).normalize(); + } + for (unsigned int i=0; i<points.getCount()-2; i++) + { + if (points[i].x <= x && points[i+1].x > x) { - return (points[i+1].y-points[i].y).normalize(); + return ((points[i+1].y-points[i].y).normalize() + (points[i].y-points[i-1].y).normalize()).normalize(); } } + otAssert("otSpline::getPos: Position out of Range!"); //I have to return something, this should never be called. return points[0].y; @@ -78,8 +88,69 @@ iSpline3D* otPolyLineSpline3::getDerivative() { - otAssert("otPolyLineSpline3::getDerivative() not yet implemented!"); - return 0; + unsigned int count = getPointList().getCount(); + otPolyLineSpline3* tangent=new otPolyLineSpline3(count); + + for(unsigned int i=0;i<count-1;i++) + { + tangent->setPoint(points[i].x,getTangent(points[i].x)); + } + return tangent; + } + + iSpline3D* otPolyLineSpline3::getSecondDerivative() + { + unsigned int count = getPointList().getCount(); + + otPolyLineSpline3* secondDerivative=new otPolyLineSpline3(count); + + float localResolution = ((points[2].y-points[1].y).length() < (points[1].y-points[0].y).length()) ? (points[2].y-points[1].y).length() : (points[1].y-points[0].y).length() ; + secondDerivative->setPoint(points[0].x,((points[2].y-points[1].y).normalize() - (points[1].y-points[0].y).normalize())/localResolution); + + for(unsigned int i=1;i<count-2;i++) + { + float localResolution = ((points[i+1].y-points[i].y).length() < (points[i].y-points[i-1].y).length()) ? (points[i+1].y-points[i].y).length() : (points[i].y-points[i-1].y).length() ; + secondDerivative->setPoint(points[i].x,((points[i+1].y-points[i].y).normalize() - (points[i].y-points[i-1].y).normalize())/localResolution); + } + secondDerivative->setPoint(points[count-1].x,points[count-2].y); + return secondDerivative; + } + + iSpline3D* otPolyLineSpline3::getNormal() + { + unsigned int count = getPointList().getCount(); + + otPolyLineSpline3* normalSpline = new otPolyLineSpline3(count); + otPolyLineSpline3* derivativeSpline = (otPolyLineSpline3 *)getDerivative(); + otPolyLineSpline3* secondDerivativeSpline = (otPolyLineSpline3 *)getSecondDerivative(); + + normalSpline->setPoint(points[0].x,*(new otVector3)); + for(unsigned int i=1;i<count-1;i++) + { + otVector3 derivative=derivativeSpline->getPointList()[i].y; + otVector3 secondDerivative=secondDerivativeSpline->getPointList()[i].y; + normalSpline->setPoint(points[i].x,(secondDerivative -derivative*((derivative|secondDerivative))).normalize() ); + } + return normalSpline; + } + + iSpline1D* otPolyLineSpline3::getCurvature() + { + unsigned int count = getPointList().getCount(); + + otPolyLineSpline* curvatureSpline = new otPolyLineSpline(count); + + otPolyLineSpline3* secondDerivativeSpline = (otPolyLineSpline3 *)getSecondDerivative(); + otPolyLineSpline3* normalSpline = (otPolyLineSpline3 *)getNormal(); + + curvatureSpline->setPoint(points[0].x,0); + for(unsigned int i=1;i<count-1;i++) + { + otVector3 normal=normalSpline->getPointList()[i].y; + otVector3 secondDerivative=secondDerivativeSpline->getPointList()[i].y; + curvatureSpline->setPoint(points[i].x,(normal|secondDerivative)); + } + return curvatureSpline; } otVector3 otPolyLineSpline3::findNearest(const otVector3& pos) |
From: Fossi <fos...@us...> - 2006-09-05 10:51:48
|
Update of /cvsroot/opentreelib/otl/src/mesher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26323/src/mesher Modified Files: treemesher.cpp Log Message: Fossi fixed two errors and a warning on vc8 Index: treemesher.cpp =================================================================== RCS file: /cvsroot/opentreelib/otl/src/mesher/treemesher.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- treemesher.cpp 20 Aug 2006 15:07:25 -0000 1.7 +++ treemesher.cpp 5 Sep 2006 10:51:45 -0000 1.8 @@ -185,7 +185,7 @@ shadowCenter += leafPos; } - shadowCenter /= tree->getLeafCount(); + shadowCenter /= (float)tree->getLeafCount(); // Now find the maximum distance for (unsigned int i = 0; i < tree->getLeafCount(); i++) |
From: Fossi <fos...@us...> - 2006-09-05 10:51:48
|
Update of /cvsroot/opentreelib/otl/include/opentree/utils In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26323/include/opentree/utils Modified Files: otvertices.h Log Message: Fossi fixed two errors and a warning on vc8 Index: otvertices.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/utils/otvertices.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- otvertices.h 30 Aug 2006 09:56:08 -0000 1.5 +++ otvertices.h 5 Sep 2006 10:51:45 -0000 1.6 @@ -69,7 +69,7 @@ class otVertices { private: - uint counter; + unsigned int counter; virtual void add(int index, float x, float y, float z, float nx, float ny, float nz, float r, float g, float b, float a, float u, float v) = 0; @@ -90,7 +90,7 @@ counter++; } - inline uint getCount() const + inline unsigned int getCount() const { return counter; } |
From: Fossi <fos...@us...> - 2006-09-05 10:51:48
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26323/docs Modified Files: history.txt Log Message: Fossi fixed two errors and a warning on vc8 Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.195 retrieving revision 1.196 diff -u -d -r1.195 -r1.196 --- history.txt 30 Aug 2006 09:56:08 -0000 1.195 +++ history.txt 5 Sep 2006 10:51:44 -0000 1.196 @@ -3,6 +3,8 @@ ------------------------------------------------------------------------------- +05-Sep-2006 + - Fossi fixed two errors and a warning on vc8 27-Aug-2006 - Fossi changed returned default color to be 1,1,1,1 - Fossi changed count in otvertices to be uint |
From: Fossi <fos...@us...> - 2006-08-30 09:56:11
|
Update of /cvsroot/opentreelib/otl/include/opentree/mesher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23829/include/opentree/mesher Modified Files: treemesher.h Log Message: Fossi made various small changes Index: treemesher.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/mesher/treemesher.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- treemesher.h 20 Aug 2006 15:36:11 -0000 1.15 +++ treemesher.h 30 Aug 2006 09:56:08 -0000 1.16 @@ -63,24 +63,24 @@ virtual ~MesherTree(); - /** Adds the number of new vertices of a stemlevel to the veriable vertex + /** Adds the number of new vertices of a stemlevel to the variable vertex * \param level Stemlevel: 0 = trunk, 1 = branches, 2 = subbranches, etc... * \param vertex Pointer to an Integer to which the new amount of vertices will be added. */ void getVerticesCount(int level, int* vertex); - /** Adds the number of new triangles of a stemlevel to the veriable triangle. + /** Adds the number of new triangles of a stemlevel to the variable triangle. * Yes, this is the IndexBuffer! One triangle equals 3 indices, * \param level Stemlevel: 0 = trunk, 1 = branches, 2 = subbranches, etc... * \param triangle Pointer to an Integer to which the new amount of triangles will be added. */ void getIndicesCount(int level, int* triangle); - /** Adds the vertices of a stemlevel to the veriable vertices + /** Adds the vertices of a stemlevel to the variable vertices * \param level Stemlevel: 0 = trunk, 1 = branches, 2 = subbranches, etc... * \param vertices Object which will receive the created vertices. */ void getVertices(int level, otVertices& vertices); - /** Adds the triangles of a stemlevel to the veriable triangles. + /** Adds the triangles of a stemlevel to the variable triangles. * \param level Stemlevel: 0 = trunk, 1 = branches, 2 = subbranches, etc... * \param triangles Object which will receive the created triangles. * \param offset StartIndex of the vertexarray. This allows multiple indexbuffers for one vertexbuffer. @@ -106,21 +106,21 @@ /// Set the LeafMesher to use quads for each leaf void useQuadLeaves() { leafedges = 4; } - /** Adds the number of new vertices for all leaves to the veriable vertex + /** Adds the number of new vertices for all leaves to the variable vertex * \param vertex Pointer to an Integer to which the new amount of vertices will be added. */ void getLeavesVerticesCount(int* vertex); - /** Adds the number of new triangles for all leaves to the veriable vertex. + /** Adds the number of new triangles for all leaves to the variable vertex. * Yes, this is the IndexBuffer! One triangle equals 3 indices, * \param triangle Pointer to an Integer to which the new amount of triangles will be added. */ void getLeavesIndicesCount(int* triangle); - /** Adds the vertices for all leaves to the veriable vertices + /** Adds the vertices for all leaves to the variable vertices * \param vertices Object which will receive the created vertices. */ void getLeavesVertices(otVertices& vertices); - /** Adds the triangles for all leaves to the veriable triangles. + /** Adds the triangles for all leaves to the variable triangles. * \param triangles Object which will receive the created triangles. * \param offset StartIndex of the vertexarray. This allows multiple indexbuffers for one vertexbuffer. */ |
From: Fossi <fos...@us...> - 2006-08-30 09:56:11
|
Update of /cvsroot/opentreelib/otl/src/mesher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23829/src/mesher Modified Files: cylmesher.cpp Log Message: Fossi made various small changes Index: cylmesher.cpp =================================================================== RCS file: /cvsroot/opentreelib/otl/src/mesher/cylmesher.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cylmesher.cpp 27 Dec 2005 15:46:26 -0000 1.2 +++ cylmesher.cpp 30 Aug 2006 09:56:08 -0000 1.3 @@ -66,7 +66,7 @@ otVector3 p; otVector3 n; - otVector3 c; + otVector3 c = otVector3(1, 1, 1); // create circle vertices for (int i=0; i<segments; i++) { |
From: Fossi <fos...@us...> - 2006-08-30 09:56:11
|
Update of /cvsroot/opentreelib/otl/include/opentree/utils In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23829/include/opentree/utils Modified Files: otvertices.h Log Message: Fossi made various small changes Index: otvertices.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/utils/otvertices.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- otvertices.h 24 Sep 2005 16:22:02 -0000 1.4 +++ otvertices.h 30 Aug 2006 09:56:08 -0000 1.5 @@ -61,7 +61,7 @@ { x=p.X; y=p.Y; z=p.Z; nx=n.X; ny=n.Y; nz=n.Z; - r=0; g=0; b=0; + r=1; g=1; b=1; u=0; v=0; } }; @@ -69,7 +69,7 @@ class otVertices { private: - int counter; + uint counter; virtual void add(int index, float x, float y, float z, float nx, float ny, float nz, float r, float g, float b, float a, float u, float v) = 0; @@ -80,17 +80,17 @@ inline void add(otVertex v) { - add(counter, v.x, v.y, v.z, v.nx, v.ny, v.nz, v.r, v.g, v.b, 0, v.u, v.v); + add(counter, v.x, v.y, v.z, v.nx, v.ny, v.nz, v.r, v.g, v.b, 1, v.u, v.v); counter++; } inline void add(const otVector3& p, const otVector3& n, const otVector3& c, float u, float v) { - add(counter, p.X, p.Y, p.Z, n.X, n.Y, n.Z, c.X, c.Y, c.Z, 0, u, v); + add(counter, p.X, p.Y, p.Z, n.X, n.Y, n.Z, c.X, c.Y, c.Z, 1, u, v); counter++; } - inline int getCount() const + inline uint getCount() const { return counter; } |
From: Fossi <fos...@us...> - 2006-08-30 09:56:11
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23829/docs Modified Files: history.txt Log Message: Fossi made various small changes Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.194 retrieving revision 1.195 diff -u -d -r1.194 -r1.195 --- history.txt 26 Aug 2006 17:37:45 -0000 1.194 +++ history.txt 30 Aug 2006 09:56:08 -0000 1.195 @@ -3,6 +3,10 @@ ------------------------------------------------------------------------------- +27-Aug-2006 + - Fossi changed returned default color to be 1,1,1,1 + - Fossi changed count in otvertices to be uint + 26-Aug-2006 - Fossi fixed header installation on linux - Fossi fixed bbc to compile on gcc |
From: PK <kir...@us...> - 2006-08-26 17:37:48
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17213/docs Modified Files: history.txt Log Message: Fixing bug in bbcsimple Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.193 retrieving revision 1.194 diff -u -d -r1.193 -r1.194 --- history.txt 26 Aug 2006 17:19:08 -0000 1.193 +++ history.txt 26 Aug 2006 17:37:45 -0000 1.194 @@ -6,6 +6,8 @@ 26-Aug-2006 - Fossi fixed header installation on linux - Fossi fixed bbc to compile on gcc + - PK fixed a bug in bbcsimple. VertexCount is correct now. + 20-Aug-2006 - PK added the old StemMesher again because there were some issues in the new. |
From: PK <kir...@us...> - 2006-08-26 17:37:47
|
Update of /cvsroot/opentreelib/otl/include/opentree/mesher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17213/include/opentree/mesher Modified Files: bbcsimple.h Log Message: Fixing bug in bbcsimple Index: bbcsimple.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/mesher/bbcsimple.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bbcsimple.h 26 Aug 2006 17:19:08 -0000 1.2 +++ bbcsimple.h 26 Aug 2006 17:37:45 -0000 1.3 @@ -166,15 +166,17 @@ rot_group[i].dist_max.Y = 10; rot_group[i].dist_max.Z = 5; */ - float j = 4; - int jj=0; + - float delta = (rot_group[i].dist_max.Y-rot_group[i].dist_min.Y)/rot_groups; + float delta = (rot_group[i].dist_max.Y-rot_group[i].dist_min.Y)/(rot_groups-1); if (delta == 0) delta = 1; - for (float j = rot_group[i].dist_min.Y; j<=rot_group[i].dist_max.Y; j+=delta) + float j = rot_group[i].dist_min.Y; + + printf("\nAngle: Min: %.4f,\t Max: %.4f\n", rot_group[i].dist_min.Y, rot_group[i].dist_max.Y); + + for (int jj=0; jj<rot_groups; jj++) { - jj++; Linker* link = rot_group[i].rot_group; @@ -242,6 +244,9 @@ vertices.add(otVertex(v3,normal,-c,0,1)); vertices.add(otVertex(v4,normal,-c,1,1)); */ + printf("-> %d, %.2f, %d\n",i, j, jj); + + j+=delta; } } |
From: Fossi <fos...@us...> - 2006-08-26 17:19:11
|
Update of /cvsroot/opentreelib/otl/docs In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8676/docs Modified Files: history.txt Log Message: Fossi fixed small linuxy things Index: history.txt =================================================================== RCS file: /cvsroot/opentreelib/otl/docs/history.txt,v retrieving revision 1.192 retrieving revision 1.193 diff -u -d -r1.192 -r1.193 --- history.txt 20 Aug 2006 18:56:44 -0000 1.192 +++ history.txt 26 Aug 2006 17:19:08 -0000 1.193 @@ -3,8 +3,12 @@ ------------------------------------------------------------------------------- +26-Aug-2006 + - Fossi fixed header installation on linux + - Fossi fixed bbc to compile on gcc 20-Aug-2006 - - PK added the old StemMesher again because there were some issues in the new. + - PK added the old StemMesher again because there were some issues + in the new. - PK added doxygen documentation to the TreeMesher. - Fossi tried to fix the buildsystem (again) - Fossi removed now unnecesary weber and mesher Jamfiles |
From: Fossi <fos...@us...> - 2006-08-26 17:19:11
|
Update of /cvsroot/opentreelib/otl/include/opentree/mesher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8676/include/opentree/mesher Modified Files: bbcsimple.h Log Message: Fossi fixed small linuxy things Index: bbcsimple.h =================================================================== RCS file: /cvsroot/opentreelib/otl/include/opentree/mesher/bbcsimple.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bbcsimple.h 27 Jan 2006 23:18:21 -0000 1.1 +++ bbcsimple.h 26 Aug 2006 17:19:08 -0000 1.2 @@ -330,10 +330,11 @@ if (t_z < this->rot_group[rot_group_no].dist_min.Z) this->rot_group[rot_group_no].dist_min.Z = t_z; - add(rot_group_no, translation, otVector3(t_x, translation, t_z)); + otVector3 lp = otVector3(t_x, translation, t_z); + add(rot_group_no, translation, lp); } - void add(int group, float translation, otVector3& local_pos) + void add(int group, float translation, otVector3 &local_pos) { Linker* child = &linkers[linkers_pointer++]; if (rot_group[group].rot_group == 0) |