You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
| 2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
| 2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
| 2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
| 2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
| 2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: Braden M. <br...@us...> - 2007-01-22 04:32:26
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30677/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp viewer.h Log Message: Moved definition of USE_STENCIL_SHAPE out of the header. Index: viewer.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** viewer.h 31 Oct 2006 03:43:07 -0000 1.15 --- viewer.h 22 Jan 2007 04:32:23 -0000 1.16 *************** *** 27,33 **** # include <openvrml/viewer.h> - // Use the stencil buffer to set the SHAPE mask. - # define USE_STENCIL_SHAPE 0 - extern "C" struct GLUtesselator; --- 27,30 ---- Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** viewer.cpp 21 Jan 2007 18:05:44 -0000 1.57 --- viewer.cpp 22 Jan 2007 04:32:23 -0000 1.58 *************** *** 47,50 **** --- 47,53 ---- # include "viewer.h" + // Use the stencil buffer to set the SHAPE mask. + # define USE_STENCIL_SHAPE 0 + // Textures are now done using OGL1.1 bindTexture API rather than // display lists when this flag is set. Don't define this if you |
|
From: Braden M. <br...@us...> - 2007-01-22 04:32:26
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30677 Modified Files: ChangeLog Log Message: Moved definition of USE_STENCIL_SHAPE out of the header. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1424 retrieving revision 1.1425 diff -C2 -d -r1.1424 -r1.1425 *** ChangeLog 21 Jan 2007 18:05:44 -0000 1.1424 --- ChangeLog 22 Jan 2007 04:32:23 -0000 1.1425 *************** *** 1,4 **** --- 1,11 ---- 2007-01-21 Braden McDaniel <br...@en...> + Moved definition of USE_STENCIL_SHAPE out of the header. + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + * src/libopenvrml-gl/openvrml/gl/viewer.h + + 2007-01-21 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp: Improved comments. |
|
From: Braden M. <br...@us...> - 2007-01-22 04:32:15
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30612/src/libopenvrml-gl/openvrml/gl Modified Files: Tag: OpenVRML-0_16-BRANCH viewer.cpp viewer.h Log Message: Moved definition of USE_STENCIL_SHAPE out of the header. Index: viewer.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.h,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** viewer.h 19 May 2006 21:52:43 -0000 1.14 --- viewer.h 22 Jan 2007 04:32:12 -0000 1.14.2.1 *************** *** 27,33 **** # include <openvrml/viewer.h> - // Use the stencil buffer to set the SHAPE mask. - # define USE_STENCIL_SHAPE 0 - extern "C" struct GLUtesselator; --- 27,30 ---- Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.43.2.10 retrieving revision 1.43.2.11 diff -C2 -d -r1.43.2.10 -r1.43.2.11 *** viewer.cpp 21 Jan 2007 18:05:17 -0000 1.43.2.10 --- viewer.cpp 22 Jan 2007 04:32:12 -0000 1.43.2.11 *************** *** 47,50 **** --- 47,53 ---- # include "viewer.h" + // Use the stencil buffer to set the SHAPE mask. + # define USE_STENCIL_SHAPE 0 + // Textures are now done using OGL1.1 bindTexture API rather than // display lists when this flag is set. Don't define this if you |
|
From: Braden M. <br...@us...> - 2007-01-22 04:32:15
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30612 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Moved definition of USE_STENCIL_SHAPE out of the header. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.100 retrieving revision 1.1310.2.101 diff -C2 -d -r1.1310.2.100 -r1.1310.2.101 *** ChangeLog 21 Jan 2007 18:05:17 -0000 1.1310.2.100 --- ChangeLog 22 Jan 2007 04:32:10 -0000 1.1310.2.101 *************** *** 1,4 **** --- 1,11 ---- 2007-01-21 Braden McDaniel <br...@en...> + Moved definition of USE_STENCIL_SHAPE out of the header. + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + * src/libopenvrml-gl/openvrml/gl/viewer.h + + 2007-01-21 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp: Improved comments. |
|
From: Braden M. <br...@us...> - 2007-01-21 18:05:46
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3857/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Improved comments. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** viewer.cpp 16 Jan 2007 08:44:22 -0000 1.56 --- viewer.cpp 21 Jan 2007 18:05:44 -0000 1.57 *************** *** 2152,2156 **** } ! OPENVRML_LOCAL float get_spine_length(const std::vector<openvrml::vec3f> & spine) { --- 2152,2171 ---- } ! /** ! * @brief Get the length of an Extrusion spine. ! * ! * The length of the spine is used in computing texture coordinates for an ! * Extrusion. In order to determine the texture coordinates at a given ! * point on the Extrusion cross-section, the distance from the start of ! * the spine is divided by its total length. As such, this function ! * returns 1.0 if the length of the spine is 0 (to avoid dividing by ! * zero). ! * ! * @param[in] spine Extrusion spine. ! * ! * @return the length of the Extrusion spine described by @p spine; or 1.0 ! * if the length is 0. ! */ ! OPENVRML_GL_LOCAL float get_spine_length(const std::vector<openvrml::vec3f> & spine) { *************** *** 2167,2173 **** } ! OPENVRML_LOCAL float ! get_cross_section_length(const std::vector<openvrml::vec2f> & cross_section) { using std::vector; --- 2182,2204 ---- } ! /** ! * @brief Get the length of an Extrusion cross-section. ! * ! * The length of the cross-section is used in computing texture ! * coordinates for an Extrusion. In order to determine the texture ! * coordinates at a given point on the Extrusion cross-section, the ! * distance from the start of the cross-section is divided by its total ! * length. As such, this function returns 1.0 if the length of the ! * cross-section is 0 (to avoid dividing by zero). ! * ! * @param[in] cross_section Extrusion cross-section. ! * ! * @return the length of the Extrusion cross-section described by ! * @p cross_section; or 1.0 if the length is 0. ! */ ! OPENVRML_GL_LOCAL float ! get_cross_section_length( ! const std::vector<openvrml::vec2f> & cross_section) { using std::vector; *************** *** 2296,2302 **** * @brief Determine if the extrusion spine points are collinear. * ! * Incidentally this function determines the axes for the initial ! * spine-aligned cross-section plane (which are consistent for the extent ! * of the extrusion if the spine points are collinear). * * @param[in] spine the extrusion spine. --- 2327,2333 ---- * @brief Determine if the extrusion spine points are collinear. * ! * If this function returns @c true, @p scp_x, @p scp_y, and @p scp_z are ! * the axes of the spine-aligned cross-section plane that should be used ! * for the extent of the extrusion. * * @param[in] spine the extrusion spine. *************** *** 2327,2335 **** using openvrml::make_vec3f; static const vec3f zero = make_vec3f(); - scp_y = zero; scp_z = zero; - vec3f prev_scp_y = zero, prev_scp_z = zero; for (vector<vec3f>::const_iterator point = spine.begin(); --- 2358,2372 ---- using openvrml::make_vec3f; + // + // First, iterate over the spine points until either the y- or z-axis + // for the spine-aligned cross-section plane (SCP) is valid (i.e., + // nonzero). We bail out of the loop as soon as we get a valid y- or + // z-axis; because that means we've hit the first noncollinear point. + // If the points are all collinear, we won't have a valid z-axis (or + // y-axis) when we're done. + // static const vec3f zero = make_vec3f(); scp_y = zero; scp_z = zero; vec3f prev_scp_y = zero, prev_scp_z = zero; for (vector<vec3f>::const_iterator point = spine.begin(); *************** *** 2337,2346 **** ++point) { if (prev_scp_y == zero) { ! scp_y = compute_scp_y_axis(point, spine.begin(), spine.end() - 1, prev_scp_y); if (scp_y != zero) { prev_scp_y = scp_y; } } if (prev_scp_z == zero) { ! scp_z = compute_scp_z_axis(point, spine.begin(), spine.end() - 1, prev_scp_z); if (scp_z != zero) { prev_scp_z = scp_z; } --- 2374,2387 ---- ++point) { if (prev_scp_y == zero) { ! scp_y = compute_scp_y_axis(point, ! spine.begin(), ! spine.end() - 1, prev_scp_y); if (scp_y != zero) { prev_scp_y = scp_y; } } if (prev_scp_z == zero) { ! scp_z = compute_scp_z_axis(point, ! spine.begin(), ! spine.end() - 1, prev_scp_z); if (scp_z != zero) { prev_scp_z = scp_z; } *************** *** 2348,2355 **** } ! bool spine_points_collinear = false; ! if (prev_scp_y == zero) { prev_scp_y = make_vec3f(0.0, 1.0, 0.0); } if (prev_scp_z == zero) { prev_scp_z = make_vec3f(0.0, 0.0, 1.0); if (prev_scp_y != make_vec3f(0.0, 1.0, 0.0)) { --- 2389,2410 ---- } ! // ! // If all the points are coincident, prev_scp_y will be invalid ! // (zero). Set it to (0 1 0). ! // if (prev_scp_y == zero) { prev_scp_y = make_vec3f(0.0, 1.0, 0.0); } + + // + // If all the points are collinear, prev_scp_z will be invalid (zero). + // Default it to (0 0 1); then, per 6.18.3 of VRML97: + // + // If the entire spine is collinear, the SCP is computed by finding + // the rotation of a vector along the positive Y-axis (v1) to the + // vector formed by the spine points (v2). The Y=0 plane is then + // rotated by this value. + // + bool spine_points_collinear = false; if (prev_scp_z == zero) { + spine_points_collinear = true; prev_scp_z = make_vec3f(0.0, 0.0, 1.0); if (prev_scp_y != make_vec3f(0.0, 1.0, 0.0)) { *************** *** 2360,2364 **** prev_scp_z *= rot_mat; } - spine_points_collinear = true; } --- 2415,2418 ---- |
|
From: Braden M. <br...@us...> - 2007-01-21 18:05:46
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3857 Modified Files: ChangeLog Log Message: Improved comments. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1423 retrieving revision 1.1424 diff -C2 -d -r1.1423 -r1.1424 *** ChangeLog 16 Jan 2007 21:09:57 -0000 1.1423 --- ChangeLog 21 Jan 2007 18:05:44 -0000 1.1424 *************** *** 1,7 **** 2007-01-16 Braden McDaniel <br...@en...> * src/libopenvrml/openvrml/basetypes.cpp ! (openvrml::rotation::rotation(const vec3f &, const vec3f &)): ! Normalize the rotation axis. 2007-01-16 Braden McDaniel <br...@en...> --- 1,11 ---- + 2007-01-21 Braden McDaniel <br...@en...> + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp: Improved comments. + 2007-01-16 Braden McDaniel <br...@en...> * src/libopenvrml/openvrml/basetypes.cpp ! (openvrml::make_rotation(const vec3f &, const vec3f &)): Normalize ! the rotation axis. 2007-01-16 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2007-01-21 18:05:19
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3820/src/libopenvrml-gl/openvrml/gl Modified Files: Tag: OpenVRML-0_16-BRANCH viewer.cpp Log Message: Improved comments. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.43.2.9 retrieving revision 1.43.2.10 diff -C2 -d -r1.43.2.9 -r1.43.2.10 *** viewer.cpp 16 Jan 2007 08:43:05 -0000 1.43.2.9 --- viewer.cpp 21 Jan 2007 18:05:17 -0000 1.43.2.10 *************** *** 2141,2145 **** } ! OPENVRML_LOCAL float get_spine_length(const std::vector<openvrml::vec3f> & spine) { --- 2141,2160 ---- } ! /** ! * @brief Get the length of an Extrusion spine. ! * ! * The length of the spine is used in computing texture coordinates for an ! * Extrusion. In order to determine the texture coordinates at a given ! * point on the Extrusion cross-section, the distance from the start of ! * the spine is divided by its total length. As such, this function ! * returns 1.0 if the length of the spine is 0 (to avoid dividing by ! * zero). ! * ! * @param[in] spine Extrusion spine. ! * ! * @return the length of the Extrusion spine described by @p spine; or 1.0 ! * if the length is 0. ! */ ! OPENVRML_GL_LOCAL float get_spine_length(const std::vector<openvrml::vec3f> & spine) { *************** *** 2156,2162 **** } ! OPENVRML_LOCAL float ! get_cross_section_length(const std::vector<openvrml::vec2f> & cross_section) { using std::vector; --- 2171,2193 ---- } ! /** ! * @brief Get the length of an Extrusion cross-section. ! * ! * The length of the cross-section is used in computing texture ! * coordinates for an Extrusion. In order to determine the texture ! * coordinates at a given point on the Extrusion cross-section, the ! * distance from the start of the cross-section is divided by its total ! * length. As such, this function returns 1.0 if the length of the ! * cross-section is 0 (to avoid dividing by zero). ! * ! * @param[in] cross_section Extrusion cross-section. ! * ! * @return the length of the Extrusion cross-section described by ! * @p cross_section; or 1.0 if the length is 0. ! */ ! OPENVRML_GL_LOCAL float ! get_cross_section_length( ! const std::vector<openvrml::vec2f> & cross_section) { using std::vector; *************** *** 2284,2290 **** * @brief Determine if the extrusion spine points are collinear. * ! * Incidentally this function determines the axes for the initial ! * spine-aligned cross-section plane (which are consistent for the extent ! * of the extrusion if the spine points are collinear). * * @param[in] spine the extrusion spine. --- 2315,2321 ---- * @brief Determine if the extrusion spine points are collinear. * ! * If this function returns @c true, @p scp_x, @p scp_y, and @p scp_z are ! * the axes of the spine-aligned cross-section plane that should be used ! * for the extent of the extrusion. * * @param[in] spine the extrusion spine. *************** *** 2311,2319 **** using openvrml::vec3f; static const vec3f zero; - scp_y = zero; scp_z = zero; - vec3f prev_scp_y, prev_scp_z; for (vector<vec3f>::const_iterator point = spine.begin(); --- 2342,2356 ---- using openvrml::vec3f; + // + // First, iterate over the spine points until either the y- or z-axis + // for the spine-aligned cross-section plane (SCP) is valid (i.e., + // nonzero). We bail out of the loop as soon as we get a valid y- or + // z-axis; because that means we've hit the first noncollinear point. + // If the points are all collinear, we won't have a valid z-axis (or + // y-axis) when we're done. + // static const vec3f zero; scp_y = zero; scp_z = zero; vec3f prev_scp_y, prev_scp_z; for (vector<vec3f>::const_iterator point = spine.begin(); *************** *** 2321,2330 **** ++point) { if (prev_scp_y == zero) { ! scp_y = compute_scp_y_axis(point, spine.begin(), spine.end() - 1, prev_scp_y); if (scp_y != zero) { prev_scp_y = scp_y; } } if (prev_scp_z == zero) { ! scp_z = compute_scp_z_axis(point, spine.begin(), spine.end() - 1, prev_scp_z); if (scp_z != zero) { prev_scp_z = scp_z; } --- 2358,2371 ---- ++point) { if (prev_scp_y == zero) { ! scp_y = compute_scp_y_axis(point, ! spine.begin(), ! spine.end() - 1, prev_scp_y); if (scp_y != zero) { prev_scp_y = scp_y; } } if (prev_scp_z == zero) { ! scp_z = compute_scp_z_axis(point, ! spine.begin(), ! spine.end() - 1, prev_scp_z); if (scp_z != zero) { prev_scp_z = scp_z; } *************** *** 2332,2339 **** } ! bool spine_points_collinear = false; ! if (prev_scp_y == zero) { prev_scp_y = vec3f(0.0, 1.0, 0.0); } if (prev_scp_z == zero) { prev_scp_z = vec3f(0.0, 0.0, 1.0); if (prev_scp_y != vec3f(0.0, 1.0, 0.0)) { --- 2373,2394 ---- } ! // ! // If all the points are coincident, prev_scp_y will be invalid ! // (zero). Set it to (0 1 0). ! // if (prev_scp_y == zero) { prev_scp_y = vec3f(0.0, 1.0, 0.0); } + + // + // If all the points are collinear, prev_scp_z will be invalid (zero). + // Default it to (0 0 1); then, per 6.18.3 of VRML97: + // + // If the entire spine is collinear, the SCP is computed by finding + // the rotation of a vector along the positive Y-axis (v1) to the + // vector formed by the spine points (v2). The Y=0 plane is then + // rotated by this value. + // + bool spine_points_collinear = false; if (prev_scp_z == zero) { + spine_points_collinear = true; prev_scp_z = vec3f(0.0, 0.0, 1.0); if (prev_scp_y != vec3f(0.0, 1.0, 0.0)) { *************** *** 2343,2347 **** prev_scp_z *= rot_mat; } - spine_points_collinear = true; } --- 2398,2401 ---- |
|
From: Braden M. <br...@us...> - 2007-01-21 18:05:19
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3820 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Improved comments. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.99 retrieving revision 1.1310.2.100 diff -C2 -d -r1.1310.2.99 -r1.1310.2.100 *** ChangeLog 16 Jan 2007 21:09:39 -0000 1.1310.2.99 --- ChangeLog 21 Jan 2007 18:05:17 -0000 1.1310.2.100 *************** *** 1,2 **** --- 1,6 ---- + 2007-01-21 Braden McDaniel <br...@en...> + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp: Improved comments. + 2007-01-16 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2007-01-17 10:33:15
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-player In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14627/src/openvrml-player Log Message: Directory /cvsroot/openvrml/openvrml/src/openvrml-player added to the repository --> Using per-directory sticky tag `OpenVRML-0_16-BRANCH' |
|
From: Braden M. <br...@us...> - 2007-01-16 21:10:06
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15601/src/libopenvrml/openvrml Modified Files: basetypes.cpp Log Message: Normalize the rotation axis. Index: basetypes.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** basetypes.cpp 10 Jan 2007 03:45:50 -0000 1.41 --- basetypes.cpp 16 Jan 2007 21:09:57 -0000 1.42 *************** *** 2769,2773 **** OPENVRML_NOTHROW { ! const vec3f axis = from_vec * to_vec; const float angle = float(acos(from_vec.dot(to_vec) / (from_vec.length() * to_vec.length()))); --- 2769,2773 ---- OPENVRML_NOTHROW { ! const vec3f axis = (from_vec * to_vec).normalize(); const float angle = float(acos(from_vec.dot(to_vec) / (from_vec.length() * to_vec.length()))); |
|
From: Braden M. <br...@us...> - 2007-01-16 21:09:58
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15601 Modified Files: ChangeLog Log Message: Normalize the rotation axis. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1422 retrieving revision 1.1423 diff -C2 -d -r1.1422 -r1.1423 *** ChangeLog 16 Jan 2007 08:44:22 -0000 1.1422 --- ChangeLog 16 Jan 2007 21:09:57 -0000 1.1423 *************** *** 1,4 **** --- 1,10 ---- 2007-01-16 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/basetypes.cpp + (openvrml::rotation::rotation(const vec3f &, const vec3f &)): + Normalize the rotation axis. + + 2007-01-16 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp (compute_scp_y_axis(const |
|
From: Braden M. <br...@us...> - 2007-01-16 21:09:51
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15549/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH basetypes.cpp Log Message: Normalize the rotation axis. Index: basetypes.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/basetypes.cpp,v retrieving revision 1.37.2.3 retrieving revision 1.37.2.4 diff -C2 -d -r1.37.2.3 -r1.37.2.4 *** basetypes.cpp 10 Jan 2007 03:45:37 -0000 1.37.2.3 --- basetypes.cpp 16 Jan 2007 21:09:39 -0000 1.37.2.4 *************** *** 2653,2657 **** OPENVRML_NOTHROW { ! this->axis(from_vec * to_vec); this->rot[3] = float(acos(from_vec.dot(to_vec) / (from_vec.length() * to_vec.length()))); --- 2653,2657 ---- OPENVRML_NOTHROW { ! this->axis((from_vec * to_vec).normalize()); this->rot[3] = float(acos(from_vec.dot(to_vec) / (from_vec.length() * to_vec.length()))); |
|
From: Braden M. <br...@us...> - 2007-01-16 21:09:42
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15549 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Normalize the rotation axis. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.98 retrieving revision 1.1310.2.99 diff -C2 -d -r1.1310.2.98 -r1.1310.2.99 *** ChangeLog 16 Jan 2007 08:43:04 -0000 1.1310.2.98 --- ChangeLog 16 Jan 2007 21:09:39 -0000 1.1310.2.99 *************** *** 1,4 **** --- 1,10 ---- 2007-01-16 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/basetypes.cpp + (openvrml::rotation::rotation(const vec3f &, const vec3f &)): + Normalize the rotation axis. + + 2007-01-16 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp (compute_scp_y_axis(const |
|
From: Braden M. <br...@us...> - 2007-01-16 08:44:24
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3461/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Fixed extrusion spine-aligned cross-section plane for the last point of a closed spine. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** viewer.cpp 15 Jan 2007 17:37:07 -0000 1.55 --- viewer.cpp 16 Jan 2007 08:44:22 -0000 1.56 *************** *** 2213,2217 **** if (spine_closed) { ! return (*(point + 1) - *(last - 1)).normalize(); } --- 2213,2217 ---- if (spine_closed) { ! return (*(first + 1) - *(last - 1)).normalize(); } |
|
From: Braden M. <br...@us...> - 2007-01-16 08:44:24
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3461 Modified Files: ChangeLog Log Message: Fixed extrusion spine-aligned cross-section plane for the last point of a closed spine. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1421 retrieving revision 1.1422 diff -C2 -d -r1.1421 -r1.1422 *** ChangeLog 15 Jan 2007 17:37:07 -0000 1.1421 --- ChangeLog 16 Jan 2007 08:44:22 -0000 1.1422 *************** *** 1,2 **** --- 1,11 ---- + 2007-01-16 Braden McDaniel <br...@en...> + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (compute_scp_y_axis(const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + openvrml::vec3f &)): Fixed for the last point of a closed spine. + 2007-01-15 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2007-01-16 08:43:37
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2917/src/libopenvrml-gl/openvrml/gl Modified Files: Tag: OpenVRML-0_16-BRANCH viewer.cpp Log Message: Fixed extrusion spine-aligned cross-section plane for the last point of a closed spine. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.43.2.8 retrieving revision 1.43.2.9 diff -C2 -d -r1.43.2.8 -r1.43.2.9 *** viewer.cpp 15 Jan 2007 17:36:19 -0000 1.43.2.8 --- viewer.cpp 16 Jan 2007 08:43:05 -0000 1.43.2.9 *************** *** 2202,2206 **** if (spine_closed) { ! return (*(point + 1) - *(last - 1)).normalize(); } --- 2202,2206 ---- if (spine_closed) { ! return (*(first + 1) - *(last - 1)).normalize(); } |
|
From: Braden M. <br...@us...> - 2007-01-16 08:43:07
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2917 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Fixed extrusion spine-aligned cross-section plane for the last point of a closed spine. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.97 retrieving revision 1.1310.2.98 diff -C2 -d -r1.1310.2.97 -r1.1310.2.98 *** ChangeLog 15 Jan 2007 17:36:19 -0000 1.1310.2.97 --- ChangeLog 16 Jan 2007 08:43:04 -0000 1.1310.2.98 *************** *** 1,2 **** --- 1,11 ---- + 2007-01-16 Braden McDaniel <br...@en...> + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (compute_scp_y_axis(const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + openvrml::vec3f &)): Fixed for the last point of a closed spine. + 2007-01-15 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2007-01-15 17:37:16
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14376/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Rewrote/refactored Extrusion coordinate generation for correctness and readability. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** viewer.cpp 10 Jan 2007 04:08:41 -0000 1.54 --- viewer.cpp 15 Jan 2007 17:37:07 -0000 1.55 *************** *** 2152,2344 **** } /** ! * @brief Build an extrusion. * ! * @param[in] orientation ! * @param[in] scale ! * @param[in] crossSection ! * @param[in] spine ! * @param[out] c ! * @param[out] tc */ ! OPENVRML_GL_LOCAL void ! computeExtrusion_(const std::vector<openvrml::rotation> & orientation, ! const std::vector<openvrml::vec2f> & scale, ! const std::vector<openvrml::vec2f> & crossSection, ! const std::vector<openvrml::vec3f> & spine, ! std::vector<openvrml::vec3f> & c, ! std::vector<openvrml::vec2f> & tc) { - using openvrml::rotation; - using openvrml::vec2f; using openvrml::vec3f; using openvrml::make_vec3f; - using openvrml::mat4f; ! size_t i, j, ci; ! // Xscp, Yscp, Zscp- columns of xform matrix to align cross section ! // with spine segments. ! vec3f Xscp = make_vec3f(1.0, 0.0, 0.0); ! vec3f Yscp = make_vec3f(0.0, 1.0, 0.0); ! vec3f Zscp = make_vec3f(0.0, 0.0, 1.0); ! vec3f lastZ; ! // Is the spine a closed curve (last pt == first pt)? ! bool spineClosed = spine.back() == spine.front(); ! // Is the spine a straight line? ! bool spineStraight = true; ! for (i = 1; i < spine.size() - 1; ++i) { ! const vec3f v = (spine[i - 1] - spine[i]) ! * (spine[i + 1] - spine[i]); ! if (!fequal(v.length(), 0.0f)) { ! spineStraight = false; ! lastZ = v.normalize(); ! break; } } ! // If the spine is a straight line, compute a constant SCP xform ! if (spineStraight) { ! const vec3f v1 = make_vec3f(0.0, 1.0, 0.0); ! const vec3f v2 = spine.back() - spine.front(); ! vec3f v3 = v2 * v1; ! float len = v3.length(); ! if (!fequal(len, 0.0f)) { ! // ! // Not aligned with Y axis. ! // ! v3 *= float(1.0 / len); ! const rotation orient = ! make_rotation(v3, float(acos(v1.dot(v2)))); // Axis/angle ! const mat4f scp = make_rotation_mat4f(orient); // xform matrix ! Xscp = make_vec3f(scp[0][0], scp[0][1], scp[0][2]); ! Yscp = make_vec3f(scp[1][0], scp[1][1], scp[1][2]); ! Zscp = make_vec3f(scp[2][0], scp[2][1], scp[2][2]); } } ! // Orientation matrix ! mat4f om; ! if (orientation.size() == 1 ! && !fequal(orientation.front().angle(), 0.0f)) { ! om = make_rotation_mat4f(orientation.front()); } ! using std::vector; ! vector<vec2f>::const_iterator s = scale.begin(); ! vector<rotation>::const_iterator r = orientation.begin(); ! // Compute coordinates, texture coordinates: ! for (i = 0, ci = 0; i < spine.size(); ++i, ci += crossSection.size()) { ! // Scale cross section ! for (j = 0; j < crossSection.size(); ++j) { ! c[ci + j].x(s->x() * crossSection[j].x()); ! c[ci + j].y(0.0); ! c[ci + j].z(s->y() * crossSection[j].y()); ! } ! // Compute Spine-aligned Cross-section Plane (SCP) ! if (!spineStraight) { ! size_t yi1, yi2, si1, s1i2, s2i2; ! if (spineClosed && (i == 0 || i == spine.size() - 1)) { ! yi1 = spine.size() - 2; ! yi2 = 1; ! si1 = 0; ! s1i2 = spine.size() - 2; ! s2i2 = 1; ! } else if (i == 0) { ! yi1 = 0; ! yi2 = 1; ! si1 = 1; ! s1i2 = 0; ! s2i2 = 2; ! } else if (i == spine.size() - 1) { ! yi1 = spine.size() - 2; ! yi2 = spine.size() - 1; ! si1 = spine.size() - 2; ! s1i2 = spine.size() - 3; ! s2i2 = spine.size() - 1; ! } else { ! yi1 = i - 1; ! yi2 = i + 1; ! si1 = i; ! s1i2 = i - 1; ! s2i2 = i + 1; ! } ! Yscp = (spine[yi2] - spine[yi1]).normalize(); ! lastZ = Zscp; // Save last Zscp. ! Zscp = (spine[s1i2] - spine[si1]) * (spine[s2i2] - spine[si1]); ! float VlenZ = Zscp.length(); ! if (fequal(VlenZ, 0.0f)) { ! Zscp = lastZ; ! } else { ! Zscp *= float(1.0 / VlenZ); ! } ! if (i > 0 && Zscp.dot(lastZ) < 0.0) { Zscp *= -1.0; } ! Xscp = Yscp * Zscp; } ! // Rotate cross section into SCP ! for (j = 0; j < crossSection.size(); ++j) { ! float cx, cy, cz; ! cx = c[ci + j].x() * Xscp.x() ! + c[ci + j].y() * Yscp.x() ! + c[ci + j].z() * Zscp.x(); ! cy = c[ci + j].x() * Xscp.y() ! + c[ci + j].y() * Yscp.y() ! + c[ci + j].z() * Zscp.y(); ! cz = c[ci + j].x() * Xscp.z() ! + c[ci + j].y() * Yscp.z() ! + c[ci + j].z() * Zscp.z(); ! c[ci + j].x(cx); ! c[ci + j].y(cy); ! c[ci + j].z(cz); } ! // ! // Apply orientation. ! // ! if (!fequal(r->angle(), 0.0f)) { ! if (orientation.size() > 1) { om = make_rotation_mat4f(*r); } ! for (j = 0; j < crossSection.size(); ++j) { ! float cx, cy, cz; ! cx = c[ci + j].x() * om[0][0] ! + c[ci + j].y() * om[1][0] ! + c[ci + j].z() * om[2][0]; ! cy = c[ci + j].x() * om[0][1] ! + c[ci + j].y() * om[1][1] ! + c[ci + j].z() * om[2][1]; ! cz = c[ci + j].x() * om[0][2] ! + c[ci + j].y() * om[1][2] ! + c[ci + j].z() * om[2][2]; ! c[ci + j].x(cx); ! c[ci + j].y(cy); ! c[ci + j].z(cz); } } ! ! // ! // Translate cross section. ! // ! for (j = 0; j < crossSection.size(); ++j) { ! c[ci + j] += spine[i]; ! ! // Texture coords ! tc[ci + j].x(float(j) / (crossSection.size() - 1)); ! tc[ci + j].y(float(i) / (spine.size() - 1)); } - - if (scale.size() > 1) { ++s; } - if (orientation.size() > 1) { ++r; } } } --- 2152,2488 ---- } + OPENVRML_LOCAL + float get_spine_length(const std::vector<openvrml::vec3f> & spine) + { + using std::vector; + using openvrml::vec3f; + + float result = 0.0; + for (vector<vec3f>::const_iterator point = spine.begin(); + point < spine.end() - 1; + ++point) { + result += (*(point + 1) - *point).length(); + } + return result == 0.0 ? 1.0 : result; + } + + OPENVRML_LOCAL + float + get_cross_section_length(const std::vector<openvrml::vec2f> & cross_section) + { + using std::vector; + using openvrml::vec2f; + + float result = 0.0; + for (vector<vec2f>::const_iterator point = cross_section.begin(); + point != cross_section.end() - 1; + ++point) { + result += (*(point + 1) - *point).length(); + } + return result == 0.0 ? 1.0 : result; + } + /** ! * @brief Compute the <var>y</var>-axis of the spine-aligned cross-section ! * plane. * ! * @param[in] point an arbitrary point in the extrusion spine. ! * @param[in] first the first point in the extrusion spine. ! * @param[in] last the last point in the extrusion spine. ! * ! * @return the <var>y</var>axis of the spine-aligned cross-section plane ! * at @p point. */ ! OPENVRML_GL_LOCAL ! const openvrml::vec3f ! compute_scp_y_axis( ! const std::vector<openvrml::vec3f>::const_iterator & point, ! const std::vector<openvrml::vec3f>::const_iterator & first, ! const std::vector<openvrml::vec3f>::const_iterator & last, ! const openvrml::vec3f & prev) ! { ! if (point != first && point != last) { ! if (*point == *(point - 1)) { return prev; } ! return (*(point + 1) - *(point - 1)).normalize(); ! } ! ! // ! // From here on, we're dealing with the first or last point. ! // ! const bool spine_closed = (*first == *last); ! ! if (spine_closed) { ! return (*(point + 1) - *(last - 1)).normalize(); ! } ! ! // ! // The spine is not closed. ! // ! if (point == first) { ! return (*(first + 1) - *first).normalize(); ! } ! ! assert(point == last); ! assert(last - first > 0); ! return (*last - *(last - 1)).normalize(); ! } ! ! /** ! * @brief Compute the <var>z</var>-axis of the spine-aligned cross-section ! * plane. ! * ! * @param[in] point an arbitrary point in the extrusion spine. ! * @param[in] first the first point in the extrusion spine. ! * @param[in] last the last point in the extrusion spine. ! * @param[in] prev the <var>z</var>-axis of the spine-aligned ! * cross-section plane for the previous spine point. ! * ! * @return the <var>z</var>axis of the spine-aligned cross-section plane ! * at @p point. ! */ ! OPENVRML_GL_LOCAL ! const openvrml::vec3f ! compute_scp_z_axis( ! const std::vector<openvrml::vec3f>::const_iterator & point, ! const std::vector<openvrml::vec3f>::const_iterator & first, ! const std::vector<openvrml::vec3f>::const_iterator & last, ! const openvrml::vec3f & prev) { using openvrml::vec3f; using openvrml::make_vec3f; ! vec3f z0, z1; ! if (point != first && point != last) { ! if (*point == *(point - 1)) { return prev; } ! z0 = *(point + 1) - *point; ! z1 = *(point - 1) - *point; ! } else { ! // ! // From here on, we're dealing with the first or last point. ! // ! const bool spine_closed = (*first == *last); ! if (spine_closed) { ! z0 = *(first + 1) - *first; ! z1 = *(last - 1) - *first; ! } else { ! if (last - first == 1) { return prev; } ! if (point == first) { ! // ! // The spine is not closed. ! // ! z0 = *(first + 2) - *(first + 1); ! z1 = *first - *(first + 1); ! } else { ! assert(point == last); ! assert(last - first > 0); ! z0 = *(last - 2) - *(last - 1); ! z1 = *last - *(last - 1); ! } } } ! if (fequal(z0.dot(z1), 1.0f)) { return prev; } ! const vec3f z = (z0 * z1).normalize(); ! if (z == make_vec3f(0.0, 0.0, 0.0)) { return prev; } ! ! return (z.dot(prev) < 0) ? -z : z; ! } ! ! /** ! * @brief Determine if the extrusion spine points are collinear. ! * ! * Incidentally this function determines the axes for the initial ! * spine-aligned cross-section plane (which are consistent for the extent ! * of the extrusion if the spine points are collinear). ! * ! * @param[in] spine the extrusion spine. ! * @param[out] scp_x the initial spine-aligned cross-section plane ! * <var>x</var>-axis. ! * @param[out] scp_y the initial spine-aligned cross-section plane ! * <var>y</var>-axis. ! * @param[out] scp_z the initial spine-aligned cross-section plane ! * <var>z</var>-axis. ! * ! * @return @c true if the points in @p spine are collinear; @c false ! * otherwise. ! */ ! OPENVRML_GL_LOCAL ! bool ! check_spine_points_collinear(const std::vector<openvrml::vec3f> & spine, ! openvrml::vec3f & scp_x, ! openvrml::vec3f & scp_y, ! openvrml::vec3f & scp_z) ! { ! using std::vector; ! using openvrml::mat4f; ! using openvrml::make_rotation_mat4f; ! using openvrml::make_scale_mat4f; ! using openvrml::rotation; ! using openvrml::make_rotation; ! using openvrml::vec3f; ! using openvrml::make_vec3f; ! ! static const vec3f zero = make_vec3f(); ! ! scp_y = zero; ! scp_z = zero; ! ! vec3f prev_scp_y = zero, prev_scp_z = zero; ! for (vector<vec3f>::const_iterator point = spine.begin(); ! point < spine.end() && (prev_scp_y == zero || prev_scp_z == zero); ! ++point) { ! if (prev_scp_y == zero) { ! scp_y = compute_scp_y_axis(point, spine.begin(), spine.end() - 1, ! prev_scp_y); ! if (scp_y != zero) { prev_scp_y = scp_y; } ! } ! if (prev_scp_z == zero) { ! scp_z = compute_scp_z_axis(point, spine.begin(), spine.end() - 1, ! prev_scp_z); ! if (scp_z != zero) { prev_scp_z = scp_z; } } } ! bool spine_points_collinear = false; ! ! if (prev_scp_y == zero) { prev_scp_y = make_vec3f(0.0, 1.0, 0.0); } ! if (prev_scp_z == zero) { ! prev_scp_z = make_vec3f(0.0, 0.0, 1.0); ! if (prev_scp_y != make_vec3f(0.0, 1.0, 0.0)) { ! const mat4f rot_mat = ! make_rotation_mat4f( ! make_rotation(make_vec3f(0.0, 1.0, 0.0), ! prev_scp_y)); ! prev_scp_z *= rot_mat; ! } ! spine_points_collinear = true; } ! if (spine_points_collinear) { ! scp_y = prev_scp_y; ! scp_z = prev_scp_z; ! scp_x = (scp_y * scp_z).normalize(); ! } ! return spine_points_collinear; ! } ! /** ! * @brief Compute the coordinates and texture coordinates for an extrusion. ! * ! * @param[in] cross_section ! * @param[in] spine ! * @param[in] scale ! * @param[in] orientation ! * @param[out] coord ! * @param[out] texcoord ! */ ! OPENVRML_GL_LOCAL void ! compute_extrusion_coords_( ! const std::vector<openvrml::vec2f> & cross_section, ! const std::vector<openvrml::vec3f> & spine, ! const std::vector<openvrml::vec2f> & scale, ! const std::vector<openvrml::rotation> & orientation, ! std::vector<openvrml::vec3f> & coord, ! std::vector<openvrml::vec2f> & texcoord) ! { ! using std::vector; ! using openvrml::rotation; ! using openvrml::vec2f; ! using openvrml::make_vec2f; ! using openvrml::vec3f; ! using openvrml::make_vec3f; ! using openvrml::mat4f; ! using openvrml::make_mat4f; ! coord.resize(spine.size() * cross_section.size()); ! texcoord.resize(spine.size() * cross_section.size()); ! // ! // Check if the spine points are collinear. If they are collinear, ! // the spine-aligned cross-section plane computed for the first point ! // will be used for the entire extrusion. ! // ! vec3f scp_x = make_vec3f(), scp_y = make_vec3f(), scp_z = make_vec3f(); ! const bool spine_points_collinear = ! check_spine_points_collinear(spine, scp_x, scp_y, scp_z); ! const float spine_length = get_spine_length(spine); ! const float cross_section_length = ! get_cross_section_length(cross_section); ! float current_spine_length = 0.0; ! for (vector<vec3f>::const_iterator spine_point = spine.begin(); ! spine_point != spine.end(); ! ++spine_point) { ! if (!spine_points_collinear) { ! scp_y = compute_scp_y_axis(spine_point, ! spine.begin(), ! spine.end() - 1, ! scp_y); ! scp_z = compute_scp_z_axis(spine_point, ! spine.begin(), ! spine.end() - 1, ! scp_z); ! scp_x = (scp_y * scp_z).normalize(); ! } ! mat4f mat = ! make_mat4f( ! scp_x.x(), scp_x.y(), scp_x.z(), 0.0, ! scp_y.x(), scp_y.y(), scp_y.z(), 0.0, ! scp_z.x(), scp_z.y(), scp_z.z(), 0.0, ! spine_point->x(), spine_point->y(), spine_point->z(), 1.0); ! const vector<vec3f>::size_type spine_index = ! std::distance(spine.begin(), spine_point); ! if (!orientation.empty()) { ! const vector<rotation>::size_type index = ! spine_index < orientation.size() ! ? spine_index ! : orientation.size() - 1; ! mat = make_rotation_mat4f(orientation[index]) * mat; } ! if (!scale.empty()) { ! const vector<vec2f>::size_type index = ! spine_index < scale.size() ! ? spine_index ! : scale.size() - 1; ! mat = (make_scale_mat4f(make_vec3f(scale[index].x(), ! 1.0, ! scale[index].y())) ! * mat); } ! float current_cross_section_length = 0.0; ! for (vector<vec2f>::size_type i = 0; ! i < cross_section.size(); ! ++i) { ! vec3f cross_section_point = make_vec3f(cross_section[i].x(), ! 0.0, ! cross_section[i].y()); ! cross_section_point *= mat; ! const size_t coord_index = ! spine_index * cross_section.size() + i; ! coord[coord_index] = cross_section_point; ! texcoord[coord_index] = ! make_vec2f( ! current_cross_section_length / cross_section_length, ! current_spine_length / spine_length); ! if (i < cross_section.size() - 1) { ! current_cross_section_length += ! (cross_section[i + 1] - cross_section[i]).length(); } } ! if (spine_point < spine.end() - 1) { ! current_spine_length += ! (*(spine_point + 1) - *spine_point).length(); } } } *************** *** 2368,2372 **** vector<vec2f> tc(crossSection.size() * spine.size()); ! computeExtrusion_(orientation, scale, crossSection, spine, c, tc); GLuint glid = 0; --- 2512,2516 ---- vector<vec2f> tc(crossSection.size() * spine.size()); ! compute_extrusion_coords_(crossSection, spine, scale, orientation, c, tc); GLuint glid = 0; |
|
From: Braden M. <br...@us...> - 2007-01-15 17:37:16
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14376 Modified Files: ChangeLog Log Message: Rewrote/refactored Extrusion coordinate generation for correctness and readability. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1420 retrieving revision 1.1421 diff -C2 -d -r1.1420 -r1.1421 *** ChangeLog 15 Jan 2007 17:34:05 -0000 1.1420 --- ChangeLog 15 Jan 2007 17:37:07 -0000 1.1421 *************** *** 1,4 **** --- 1,36 ---- 2007-01-15 Braden McDaniel <br...@en...> + Rewrote/refactored Extrusion coordinate generation for correctness + and readability. + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (get_spine_length(const std::vector<openvrml::vec3f> &)): Added + function; get the length of an extrusion spine. + (get_cross_section_length(const std::vector<openvrml::vec2f> &)): + Added function; get the length of an extrusion cross-section. + (compute_scp_y_axis(const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + openvrml::vec3f &)): Added function; compute the y-axis of an + extrusion spine-aligned cross-section plane at a given point. + (compute_scp_z_axis(const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + openvrml::vec3f &)): Added function; compute the z-axis of an + extrusion spine-aligned cross-section plane at a given point. + (check_spine_points_collinear(const std::vector<openvrml::vec3f &, + openvrml::vec3f &, openvrml::vec3f &, openvrml::vec3f &)): Added + function; determine if extrusion spine points are collinear. + (compute_extrusion_coords_(const std::vector<openvrml::vec2f> &, + const std::vector<openvrml::vec3f> &, const + std::vector<openvrml::vec2f> &, const + std::vector<openvrml::rotation> &, std::vector<openvrml::vec3f> &, + std::vector<openvrml::vec2f> &)): Refactored for correctness and + readability. + + 2007-01-15 Braden McDaniel <br...@en...> + Initialize mat4f instances with make_mat4f. |
|
From: Braden M. <br...@us...> - 2007-01-15 17:36:42
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14030/src/libopenvrml-gl/openvrml/gl Modified Files: Tag: OpenVRML-0_16-BRANCH viewer.cpp Log Message: Rewrote/refactored Extrusion coordinate generation for correctness and readability. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.43.2.7 retrieving revision 1.43.2.8 diff -C2 -d -r1.43.2.7 -r1.43.2.8 *** viewer.cpp 10 Jan 2007 04:08:27 -0000 1.43.2.7 --- viewer.cpp 15 Jan 2007 17:36:19 -0000 1.43.2.8 *************** *** 2141,2331 **** } /** ! * @brief Build an extrusion. * ! * @param[in] orientation ! * @param[in] scale ! * @param[in] crossSection ! * @param[in] spine ! * @param[out] c ! * @param[out] tc */ ! OPENVRML_GL_LOCAL void ! computeExtrusion_(const std::vector<openvrml::rotation> & orientation, ! const std::vector<openvrml::vec2f> & scale, ! const std::vector<openvrml::vec2f> & crossSection, ! const std::vector<openvrml::vec3f> & spine, ! std::vector<openvrml::vec3f> & c, ! std::vector<openvrml::vec2f> & tc) { - using openvrml::rotation; - using openvrml::vec2f; using openvrml::vec3f; - using openvrml::mat4f; ! size_t i, j, ci; ! // Xscp, Yscp, Zscp- columns of xform matrix to align cross section ! // with spine segments. ! vec3f Xscp(1.0, 0.0, 0.0); ! vec3f Yscp(0.0, 1.0, 0.0); ! vec3f Zscp(0.0, 0.0, 1.0); ! vec3f lastZ; ! // Is the spine a closed curve (last pt == first pt)? ! bool spineClosed = spine.back() == spine.front(); ! // Is the spine a straight line? ! bool spineStraight = true; ! for (i = 1; i < spine.size() - 1; ++i) { ! const vec3f v = (spine[i - 1] - spine[i]) ! * (spine[i + 1] - spine[i]); ! if (!fequal(v.length(), 0.0f)) { ! spineStraight = false; ! lastZ = v.normalize(); ! break; } } ! // If the spine is a straight line, compute a constant SCP xform ! if (spineStraight) { ! const vec3f v1(0.0, 1.0, 0.0); ! const vec3f v2 = spine.back() - spine.front(); ! vec3f v3 = v2 * v1; ! float len = v3.length(); ! if (!fequal(len, 0.0f)) { ! // ! // Not aligned with Y axis. ! // ! v3 *= float(1.0 / len); ! const rotation orient(v3, float(acos(v1.dot(v2)))); // Axis/angle ! const mat4f scp = mat4f::rotation(orient); // xform matrix ! Xscp = vec3f(scp[0][0], scp[0][1], scp[0][2]); ! Yscp = vec3f(scp[1][0], scp[1][1], scp[1][2]); ! Zscp = vec3f(scp[2][0], scp[2][1], scp[2][2]); } } ! // Orientation matrix ! mat4f om; ! if (orientation.size() == 1 ! && !fequal(orientation.front().angle(), 0.0f)) { ! om = mat4f::rotation(orientation.front()); } ! using std::vector; ! vector<vec2f>::const_iterator s = scale.begin(); ! vector<rotation>::const_iterator r = orientation.begin(); ! // Compute coordinates, texture coordinates: ! for (i = 0, ci = 0; i < spine.size(); ++i, ci += crossSection.size()) { ! // Scale cross section ! for (j = 0; j < crossSection.size(); ++j) { ! c[ci + j].x(s->x() * crossSection[j].x()); ! c[ci + j].y(0.0); ! c[ci + j].z(s->y() * crossSection[j].y()); ! } ! // Compute Spine-aligned Cross-section Plane (SCP) ! if (!spineStraight) { ! size_t yi1, yi2, si1, s1i2, s2i2; ! if (spineClosed && (i == 0 || i == spine.size() - 1)) { ! yi1 = spine.size() - 2; ! yi2 = 1; ! si1 = 0; ! s1i2 = spine.size() - 2; ! s2i2 = 1; ! } else if (i == 0) { ! yi1 = 0; ! yi2 = 1; ! si1 = 1; ! s1i2 = 0; ! s2i2 = 2; ! } else if (i == spine.size() - 1) { ! yi1 = spine.size() - 2; ! yi2 = spine.size() - 1; ! si1 = spine.size() - 2; ! s1i2 = spine.size() - 3; ! s2i2 = spine.size() - 1; ! } else { ! yi1 = i - 1; ! yi2 = i + 1; ! si1 = i; ! s1i2 = i - 1; ! s2i2 = i + 1; ! } ! Yscp = (spine[yi2] - spine[yi1]).normalize(); ! lastZ = Zscp; // Save last Zscp. ! Zscp = (spine[s1i2] - spine[si1]) * (spine[s2i2] - spine[si1]); ! float VlenZ = Zscp.length(); ! if (fequal(VlenZ, 0.0f)) { ! Zscp = lastZ; ! } else { ! Zscp *= float(1.0 / VlenZ); ! } ! if (i > 0 && Zscp.dot(lastZ) < 0.0) { Zscp *= -1.0; } ! Xscp = Yscp * Zscp; } ! // Rotate cross section into SCP ! for (j = 0; j < crossSection.size(); ++j) { ! float cx, cy, cz; ! cx = c[ci + j].x() * Xscp.x() ! + c[ci + j].y() * Yscp.x() ! + c[ci + j].z() * Zscp.x(); ! cy = c[ci + j].x() * Xscp.y() ! + c[ci + j].y() * Yscp.y() ! + c[ci + j].z() * Zscp.y(); ! cz = c[ci + j].x() * Xscp.z() ! + c[ci + j].y() * Yscp.z() ! + c[ci + j].z() * Zscp.z(); ! c[ci + j].x(cx); ! c[ci + j].y(cy); ! c[ci + j].z(cz); } ! // ! // Apply orientation. ! // ! if (!fequal(r->angle(), 0.0f)) { ! if (orientation.size() > 1) { om = mat4f::rotation(*r); } ! for (j = 0; j < crossSection.size(); ++j) { ! float cx, cy, cz; ! cx = c[ci + j].x() * om[0][0] ! + c[ci + j].y() * om[1][0] ! + c[ci + j].z() * om[2][0]; ! cy = c[ci + j].x() * om[0][1] ! + c[ci + j].y() * om[1][1] ! + c[ci + j].z() * om[2][1]; ! cz = c[ci + j].x() * om[0][2] ! + c[ci + j].y() * om[1][2] ! + c[ci + j].z() * om[2][2]; ! c[ci + j].x(cx); ! c[ci + j].y(cy); ! c[ci + j].z(cz); } } ! ! // ! // Translate cross section. ! // ! for (j = 0; j < crossSection.size(); ++j) { ! c[ci + j] += spine[i]; ! ! // Texture coords ! tc[ci + j].x(float(j) / (crossSection.size() - 1)); ! tc[ci + j].y(float(i) / (spine.size() - 1)); } - - if (scale.size() > 1) { ++s; } - if (orientation.size() > 1) { ++r; } } } --- 2141,2466 ---- } + OPENVRML_LOCAL + float get_spine_length(const std::vector<openvrml::vec3f> & spine) + { + using std::vector; + using openvrml::vec3f; + + float result = 0.0; + for (vector<vec3f>::const_iterator point = spine.begin(); + point < spine.end() - 1; + ++point) { + result += (*(point + 1) - *point).length(); + } + return result == 0.0 ? 1.0 : result; + } + + OPENVRML_LOCAL + float + get_cross_section_length(const std::vector<openvrml::vec2f> & cross_section) + { + using std::vector; + using openvrml::vec2f; + + float result = 0.0; + for (vector<vec2f>::const_iterator point = cross_section.begin(); + point != cross_section.end() - 1; + ++point) { + result += (*(point + 1) - *point).length(); + } + return result == 0.0 ? 1.0 : result; + } + /** ! * @brief Compute the <var>y</var>-axis of the spine-aligned cross-section ! * plane. * ! * @param[in] point an arbitrary point in the extrusion spine. ! * @param[in] first the first point in the extrusion spine. ! * @param[in] last the last point in the extrusion spine. ! * ! * @return the <var>y</var>axis of the spine-aligned cross-section plane ! * at @p point. */ ! OPENVRML_GL_LOCAL ! const openvrml::vec3f ! compute_scp_y_axis( ! const std::vector<openvrml::vec3f>::const_iterator & point, ! const std::vector<openvrml::vec3f>::const_iterator & first, ! const std::vector<openvrml::vec3f>::const_iterator & last, ! const openvrml::vec3f & prev) ! { ! if (point != first && point != last) { ! if (*point == *(point - 1)) { return prev; } ! return (*(point + 1) - *(point - 1)).normalize(); ! } ! ! // ! // From here on, we're dealing with the first or last point. ! // ! const bool spine_closed = (*first == *last); ! ! if (spine_closed) { ! return (*(point + 1) - *(last - 1)).normalize(); ! } ! ! // ! // The spine is not closed. ! // ! if (point == first) { ! return (*(first + 1) - *first).normalize(); ! } ! ! assert(point == last); ! assert(last - first > 0); ! return (*last - *(last - 1)).normalize(); ! } ! ! /** ! * @brief Compute the <var>z</var>-axis of the spine-aligned cross-section ! * plane. ! * ! * @param[in] point an arbitrary point in the extrusion spine. ! * @param[in] first the first point in the extrusion spine. ! * @param[in] last the last point in the extrusion spine. ! * @param[in] prev the <var>z</var>-axis of the spine-aligned ! * cross-section plane for the previous spine point. ! * ! * @return the <var>z</var>axis of the spine-aligned cross-section plane ! * at @p point. ! */ ! OPENVRML_GL_LOCAL ! const openvrml::vec3f ! compute_scp_z_axis( ! const std::vector<openvrml::vec3f>::const_iterator & point, ! const std::vector<openvrml::vec3f>::const_iterator & first, ! const std::vector<openvrml::vec3f>::const_iterator & last, ! const openvrml::vec3f & prev) { using openvrml::vec3f; ! vec3f z0, z1; ! if (point != first && point != last) { ! if (*point == *(point - 1)) { return prev; } ! z0 = *(point + 1) - *point; ! z1 = *(point - 1) - *point; ! } else { ! // ! // From here on, we're dealing with the first or last point. ! // ! const bool spine_closed = (*first == *last); ! if (spine_closed) { ! z0 = *(first + 1) - *first; ! z1 = *(last - 1) - *first; ! } else { ! if (last - first == 1) { return prev; } ! if (point == first) { ! // ! // The spine is not closed. ! // ! z0 = *(first + 2) - *(first + 1); ! z1 = *first - *(first + 1); ! } else { ! assert(point == last); ! assert(last - first > 0); ! z0 = *(last - 2) - *(last - 1); ! z1 = *last - *(last - 1); ! } } } ! if (fequal(z0.dot(z1), 1.0f)) { return prev; } ! const vec3f z = (z0 * z1).normalize(); ! if (z == vec3f(0.0, 0.0, 0.0)) { return prev; } ! ! return (z.dot(prev) < 0) ? -z : z; ! } ! ! /** ! * @brief Determine if the extrusion spine points are collinear. ! * ! * Incidentally this function determines the axes for the initial ! * spine-aligned cross-section plane (which are consistent for the extent ! * of the extrusion if the spine points are collinear). ! * ! * @param[in] spine the extrusion spine. ! * @param[out] scp_x the initial spine-aligned cross-section plane ! * <var>x</var>-axis. ! * @param[out] scp_y the initial spine-aligned cross-section plane ! * <var>y</var>-axis. ! * @param[out] scp_z the initial spine-aligned cross-section plane ! * <var>z</var>-axis. ! * ! * @return @c true if the points in @p spine are collinear; @c false ! * otherwise. ! */ ! OPENVRML_GL_LOCAL ! bool ! check_spine_points_collinear(const std::vector<openvrml::vec3f> & spine, ! openvrml::vec3f & scp_x, ! openvrml::vec3f & scp_y, ! openvrml::vec3f & scp_z) ! { ! using std::vector; ! using openvrml::mat4f; ! using openvrml::rotation; ! using openvrml::vec3f; ! ! static const vec3f zero; ! ! scp_y = zero; ! scp_z = zero; ! ! vec3f prev_scp_y, prev_scp_z; ! for (vector<vec3f>::const_iterator point = spine.begin(); ! point < spine.end() && (prev_scp_y == zero || prev_scp_z == zero); ! ++point) { ! if (prev_scp_y == zero) { ! scp_y = compute_scp_y_axis(point, spine.begin(), spine.end() - 1, ! prev_scp_y); ! if (scp_y != zero) { prev_scp_y = scp_y; } ! } ! if (prev_scp_z == zero) { ! scp_z = compute_scp_z_axis(point, spine.begin(), spine.end() - 1, ! prev_scp_z); ! if (scp_z != zero) { prev_scp_z = scp_z; } } } ! bool spine_points_collinear = false; ! ! if (prev_scp_y == zero) { prev_scp_y = vec3f(0.0, 1.0, 0.0); } ! if (prev_scp_z == zero) { ! prev_scp_z = vec3f(0.0, 0.0, 1.0); ! if (prev_scp_y != vec3f(0.0, 1.0, 0.0)) { ! const mat4f rot_mat = ! mat4f::rotation(rotation(vec3f(0.0, 1.0, 0.0), ! prev_scp_y)); ! prev_scp_z *= rot_mat; ! } ! spine_points_collinear = true; } ! if (spine_points_collinear) { ! scp_y = prev_scp_y; ! scp_z = prev_scp_z; ! scp_x = (scp_y * scp_z).normalize(); ! } ! return spine_points_collinear; ! } ! /** ! * @brief Compute the coordinates and texture coordinates for an extrusion. ! * ! * @param[in] cross_section ! * @param[in] spine ! * @param[in] scale ! * @param[in] orientation ! * @param[out] coord ! * @param[out] texcoord ! */ ! OPENVRML_GL_LOCAL void ! compute_extrusion_coords_( ! const std::vector<openvrml::vec2f> & cross_section, ! const std::vector<openvrml::vec3f> & spine, ! const std::vector<openvrml::vec2f> & scale, ! const std::vector<openvrml::rotation> & orientation, ! std::vector<openvrml::vec3f> & coord, ! std::vector<openvrml::vec2f> & texcoord) ! { ! using std::vector; ! using openvrml::rotation; ! using openvrml::vec2f; ! using openvrml::vec3f; ! using openvrml::mat4f; ! coord.resize(spine.size() * cross_section.size()); ! texcoord.resize(spine.size() * cross_section.size()); ! // ! // Check if the spine points are collinear. If they are collinear, ! // the spine-aligned cross-section plane computed for the first point ! // will be used for the entire extrusion. ! // ! vec3f scp_x, scp_y, scp_z; ! const bool spine_points_collinear = ! check_spine_points_collinear(spine, scp_x, scp_y, scp_z); ! const float spine_length = get_spine_length(spine); ! const float cross_section_length = ! get_cross_section_length(cross_section); ! float current_spine_length = 0.0; ! for (vector<vec3f>::const_iterator spine_point = spine.begin(); ! spine_point != spine.end(); ! ++spine_point) { ! if (!spine_points_collinear) { ! scp_y = compute_scp_y_axis(spine_point, ! spine.begin(), ! spine.end() - 1, ! scp_y); ! scp_z = compute_scp_z_axis(spine_point, ! spine.begin(), ! spine.end() - 1, ! scp_z); ! scp_x = (scp_y * scp_z).normalize(); ! } ! mat4f mat( ! scp_x.x(), scp_x.y(), scp_x.z(), 0.0, ! scp_y.x(), scp_y.y(), scp_y.z(), 0.0, ! scp_z.x(), scp_z.y(), scp_z.z(), 0.0, ! spine_point->x(), spine_point->y(), spine_point->z(), 1.0); ! const vector<vec3f>::size_type spine_index = ! std::distance(spine.begin(), spine_point); ! if (!orientation.empty()) { ! const vector<rotation>::size_type index = ! spine_index < orientation.size() ! ? spine_index ! : orientation.size() - 1; ! mat = mat4f::rotation(orientation[index]) * mat; } ! if (!scale.empty()) { ! const vector<vec2f>::size_type index = ! spine_index < scale.size() ! ? spine_index ! : scale.size() - 1; ! mat = (mat4f::scale(vec3f(scale[index].x(), ! 1.0, ! scale[index].y())) ! * mat); } ! float current_cross_section_length = 0.0; ! for (vector<vec2f>::size_type i = 0; ! i < cross_section.size(); ! ++i) { ! vec3f cross_section_point(cross_section[i].x(), ! 0.0, ! cross_section[i].y()); ! cross_section_point *= mat; ! const size_t coord_index = ! spine_index * cross_section.size() + i; ! coord[coord_index] = cross_section_point; ! texcoord[coord_index] = ! vec2f(current_cross_section_length / cross_section_length, ! current_spine_length / spine_length); ! if (i < cross_section.size() - 1) { ! current_cross_section_length += ! (cross_section[i + 1] - cross_section[i]).length(); } } ! if (spine_point < spine.end() - 1) { ! current_spine_length += ! (*(spine_point + 1) - *spine_point).length(); } } } *************** *** 2355,2359 **** vector<vec2f> tc(crossSection.size() * spine.size()); ! computeExtrusion_(orientation, scale, crossSection, spine, c, tc); GLuint glid = 0; --- 2490,2494 ---- vector<vec2f> tc(crossSection.size() * spine.size()); ! compute_extrusion_coords_(crossSection, spine, scale, orientation, c, tc); GLuint glid = 0; |
|
From: Braden M. <br...@us...> - 2007-01-15 17:36:34
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14030 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Rewrote/refactored Extrusion coordinate generation for correctness and readability. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.96 retrieving revision 1.1310.2.97 diff -C2 -d -r1.1310.2.96 -r1.1310.2.97 *** ChangeLog 10 Jan 2007 04:08:26 -0000 1.1310.2.96 --- ChangeLog 15 Jan 2007 17:36:19 -0000 1.1310.2.97 *************** *** 1,2 **** --- 1,34 ---- + 2007-01-15 Braden McDaniel <br...@en...> + + Rewrote/refactored Extrusion coordinate generation for correctness + and readability. + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (get_spine_length(const std::vector<openvrml::vec3f> &)): Added + function; get the length of an extrusion spine. + (get_cross_section_length(const std::vector<openvrml::vec2f> &)): + Added function; get the length of an extrusion cross-section. + (compute_scp_y_axis(const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + openvrml::vec3f &)): Added function; compute the y-axis of an + extrusion spine-aligned cross-section plane at a given point. + (compute_scp_z_axis(const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + std::vector<openvrml::vec3f>::const_iterator &, const + openvrml::vec3f &)): Added function; compute the z-axis of an + extrusion spine-aligned cross-section plane at a given point. + (check_spine_points_collinear(const std::vector<openvrml::vec3f &, + openvrml::vec3f &, openvrml::vec3f &, openvrml::vec3f &)): Added + function; determine if extrusion spine points are collinear. + (compute_extrusion_coords_(const std::vector<openvrml::vec2f> &, + const std::vector<openvrml::vec3f> &, const + std::vector<openvrml::vec2f> &, const + std::vector<openvrml::rotation> &, std::vector<openvrml::vec3f> &, + std::vector<openvrml::vec2f> &)): Refactored for correctness and + readability. + 2007-01-09 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2007-01-15 17:34:42
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12943 Modified Files: ChangeLog Log Message: Initialize mat4f instances with make_mat4f. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1419 retrieving revision 1.1420 diff -C2 -d -r1.1419 -r1.1420 *** ChangeLog 10 Jan 2007 04:08:41 -0000 1.1419 --- ChangeLog 15 Jan 2007 17:34:05 -0000 1.1420 *************** *** 1,2 **** --- 1,29 ---- + 2007-01-15 Braden McDaniel <br...@en...> + + Initialize mat4f instances with make_mat4f. + + * src/libopenvrml/openvrml/browser.cpp + (default_viewpoint::default_viewpoint(const + openvrml::null_node_type &)): Initialize userViewTransform using + openvrml::make_mat4f. + * src/libopenvrml/openvrml/vrml97node.cpp + (cylinder_sensor_node::cylinder_sensor_node(const + openvrml::node_type &, const + boost::shared_ptr<openvrml::scope>&)): Initialize activationMatrix + and modelview with make_mat4f. + (plane_sensor_node::plane_sensor_node(const openvrml::node_type &, + const boost::shared_ptr<openvrml::scope> &)): Initialize + activationMatrix and modelview with make_mat4f. + (sphere_sensor_node::sphere_sensor_node(const + openvrml::node_type&, const boost::shared_ptr<openvrml::scope>&)): + Initialize modelview with make_mat4f. + (transform_node::transform_node(const openvrml::node_type &, const + boost::shared_ptr<openvrml::scope> &)): Initialize transform_ with + make_mat4f. + (viewpoint_node::viewpoint_node(const openvrml::node_type &, const + boost::shared_ptr<openvrml::scope> &)): Initialize + parent_transform, final_transformation, and user_view_transform_ + with make_mat4f. + 2007-01-09 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2007-01-15 17:34:16
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12943/src/libopenvrml/openvrml Modified Files: browser.cpp vrml97node.cpp Log Message: Initialize mat4f instances with make_mat4f. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** browser.cpp 3 Jan 2007 23:44:43 -0000 1.200 --- browser.cpp 15 Jan 2007 17:34:05 -0000 1.201 *************** *** 2737,2741 **** openvrml::bounded_volume_node(type, null_scope_ptr), openvrml::child_node(type, null_scope_ptr), ! openvrml::viewpoint_node(type, null_scope_ptr) {} --- 2737,2742 ---- openvrml::bounded_volume_node(type, null_scope_ptr), openvrml::child_node(type, null_scope_ptr), ! openvrml::viewpoint_node(type, null_scope_ptr), ! userViewTransform(openvrml::make_mat4f()) {} Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** vrml97node.cpp 2 Jan 2007 03:57:28 -0000 1.118 --- vrml97node.cpp 15 Jan 2007 17:34:06 -0000 1.119 *************** *** 10109,10113 **** is_over_emitter_(*this, this->is_over_), rotation_val(0.0f), ! disk(false) { this->node::modified(true); --- 10109,10115 ---- is_over_emitter_(*this, this->is_over_), rotation_val(0.0f), ! disk(false), ! activationMatrix(make_mat4f()), ! modelview(make_mat4f()) { this->node::modified(true); *************** *** 17577,17581 **** track_point_changed_emitter_(*this, this->track_point_changed_), translation_changed_emitter_(*this, this->translation_changed_), ! is_over_emitter_(*this, this->is_over_) { this->node::modified(true); --- 17579,17585 ---- track_point_changed_emitter_(*this, this->track_point_changed_), translation_changed_emitter_(*this, this->translation_changed_), ! is_over_emitter_(*this, this->is_over_), ! activationMatrix(make_mat4f()), ! modelview(make_mat4f()) { this->node::modified(true); *************** *** 20506,20510 **** rotation_changed_emitter_(*this, this->rotation_changed_), track_point_changed_emitter_(*this, this->track_point_changed_), ! is_over_emitter_(*this, this->is_over_) { this->node::modified(true); --- 20510,20515 ---- rotation_changed_emitter_(*this, this->rotation_changed_), track_point_changed_emitter_(*this, this->track_point_changed_), ! is_over_emitter_(*this, this->is_over_), ! modelview(make_mat4f()) { this->node::modified(true); *************** *** 25919,25922 **** --- 25924,25928 ---- scale_orientation_(*this), translation_(*this), + transform_(make_mat4f()), transform_dirty(true), xformObject(0) *************** *** 26739,26742 **** --- 26745,26751 ---- is_bound_emitter_(*this, this->is_bound_), bind_time_emitter_(*this, this->bind_time_), + parent_transform(make_mat4f()), + final_transformation(make_mat4f()), + user_view_transform_(make_mat4f()), final_transformation_dirty(true) {} |
|
From: Braden M. <br...@us...> - 2007-01-10 04:08:44
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27667 Modified Files: ChangeLog Log Message: Removed dead code. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1418 retrieving revision 1.1419 diff -C2 -d -r1.1418 -r1.1419 *** ChangeLog 10 Jan 2007 03:59:39 -0000 1.1418 --- ChangeLog 10 Jan 2007 04:08:41 -0000 1.1419 *************** *** 1,4 **** --- 1,15 ---- 2007-01-09 Braden McDaniel <br...@en...> + Removed dead code. + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (computeExtrusion(const std::vector<openvrml::rotation> &, const + std::vector<openvrml::vec2f> &, const std::vector<openvrml::vec2f> + &, const std::vector<openvrml::vec3f> &, + std::vector<openvrml::vec3f> &, std::vector<openvrml::vec2f> &, + std::vector<openvrml::int32> &)): Removed unused function. + + 2007-01-09 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp: Updated floating-point "near equal" comparison for parity with |
|
From: Braden M. <br...@us...> - 2007-01-10 04:08:44
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27667/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Removed dead code. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** viewer.cpp 10 Jan 2007 03:59:39 -0000 1.53 --- viewer.cpp 10 Jan 2007 04:08:41 -0000 1.54 *************** *** 2343,2386 **** } } - - /** - * @brief Build an extrusion. - * - * @param[in] orientation - * @param[in] scale - * @param[in] crossSection - * @param[in] spine - * @param[out] c - * @param[out] tc - * @param[out] faces - */ - OPENVRML_GL_LOCAL void - computeExtrusion_(const std::vector<openvrml::rotation> & orientation, - const std::vector<openvrml::vec2f> & scale, - const std::vector<openvrml::vec2f> & crossSection, - const std::vector<openvrml::vec3f> & spine, - std::vector<openvrml::vec3f> & c, - std::vector<openvrml::vec2f> & tc, - std::vector<openvrml::int32> & faces) - { - computeExtrusion_(orientation, scale, crossSection, spine, c, tc); - - // - // Compute face indices. - // - size_t polyIndex = 0; - for (size_t i = 0, ci = 0; i < spine.size() - 1; - ++i, ci += crossSection.size()) { - for (size_t j = 0; j < crossSection.size() - 1; ++j) { - using openvrml::int32; - faces[polyIndex + 0] = int32(ci + j); - faces[polyIndex + 1] = int32(ci + j + 1); - faces[polyIndex + 2] = int32(ci + j + 1 + crossSection.size()); - faces[polyIndex + 3] = int32(ci + j + crossSection.size()); - faces[polyIndex + 4] = -1; - polyIndex += 5; - } - } - } } --- 2343,2346 ---- |