From 943c5d8ea84772e5718ca6973b6d2e699f103c70 Mon Sep 17 00:00:00 2001 From: Cirilo Bernardo Date: Mon, 8 Feb 2016 08:56:03 +1100 Subject: [PATCH] Changed default creaseAngle from ~30deg (VRML spec) to ~42deg for prettier smoothing --- plugins/3d/vrml/v1/vrml1_shapehints.cpp | 1 + plugins/3d/vrml/v2/vrml2_faceset.cpp | 4 ++-- plugins/3d/vrml/wrlfacet.h | 2 +- plugins/3d/vrml/x3d/x3d_ifaceset.cpp | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/3d/vrml/v1/vrml1_shapehints.cpp b/plugins/3d/vrml/v1/vrml1_shapehints.cpp index a354a6ff88..7fda267041 100644 --- a/plugins/3d/vrml/v1/vrml1_shapehints.cpp +++ b/plugins/3d/vrml/v1/vrml1_shapehints.cpp @@ -35,6 +35,7 @@ WRL1SHAPEHINTS::WRL1SHAPEHINTS( NAMEREGISTER* aDictionary ) : WRL1NODE( aDiction m_order = ORD_UNKNOWN; m_Type = WRL1_SHAPEHINTS; m_crease = 0.5; + m_crease = 0.733; // approx 42 degrees; this is larger than VRML spec. return; } diff --git a/plugins/3d/vrml/v2/vrml2_faceset.cpp b/plugins/3d/vrml/v2/vrml2_faceset.cpp index 007d66d97a..7db60afe36 100644 --- a/plugins/3d/vrml/v2/vrml2_faceset.cpp +++ b/plugins/3d/vrml/v2/vrml2_faceset.cpp @@ -79,8 +79,8 @@ void WRL2FACESET::setDefaults( void ) normalPerVertex = true; solid = true; - creaseAngle = 0.5; - creaseLimit = 0.878; // approx cos( 0.5 ) + creaseAngle = 0.733; // approx 42 degrees; this is larger than VRML spec. + creaseLimit = 0.74317; // cos( 0.733 ) } diff --git a/plugins/3d/vrml/wrlfacet.h b/plugins/3d/vrml/wrlfacet.h index 68a96589bc..06bd410d1f 100644 --- a/plugins/3d/vrml/wrlfacet.h +++ b/plugins/3d/vrml/wrlfacet.h @@ -146,7 +146,7 @@ public: FACET* NewFacet(); SGNODE* CalcShape( SGNODE* aParent, SGNODE* aColor, WRL1_ORDER aVertexOrder, - float aCreaseLimit = 0.878, bool isVRML2 = false ); + float aCreaseLimit = 0.74317, bool isVRML2 = false ); }; #endif // WRLFACET_H diff --git a/plugins/3d/vrml/x3d/x3d_ifaceset.cpp b/plugins/3d/vrml/x3d/x3d_ifaceset.cpp index d8544d7258..8e10371ea2 100644 --- a/plugins/3d/vrml/x3d/x3d_ifaceset.cpp +++ b/plugins/3d/vrml/x3d/x3d_ifaceset.cpp @@ -79,8 +79,8 @@ void X3DIFACESET::init() coord = NULL; ccw = true; - creaseAngle = 0.5; - creaseLimit = 0.878; // approx cos( 0.5 ) + creaseAngle = 0.733; // approx 42 degrees; this is larger than VRML spec. + creaseLimit = 0.74317; // cos( 0.733 ) return; }