diff --git a/example/Gizmo/Gizmo3DRotate.cpp b/example/Gizmo/Gizmo3DRotate.cpp index 51babf8f..6ed4d5f9 100644 --- a/example/Gizmo/Gizmo3DRotate.cpp +++ b/example/Gizmo/Gizmo3DRotate.cpp @@ -44,13 +44,12 @@ bool InitGizmoRotateStaticMesh() tm.SetScale(10.0f); - tm.SetRotation(AXIS::Z,90); root_node->CreateSubNode(tm,torus[0]); - tm.ClearRotation(); + tm.SetRotation(AXIS::Z,90); root_node->CreateSubNode(tm,torus[1]); - tm.SetRotation(AXIS::X,90); + tm.SetRotation(AXIS::Y,90); root_node->CreateSubNode(tm,torus[2]); } diff --git a/src/SceneGraph/InlineGeometry.cpp b/src/SceneGraph/InlineGeometry.cpp index 155044f5..88456442 100644 --- a/src/SceneGraph/InlineGeometry.cpp +++ b/src/SceneGraph/InlineGeometry.cpp @@ -793,8 +793,8 @@ namespace hgl sin2PIt = sin(2.0f * HGL_PI * t); // generate vertex and stores it in the right position - *vp = (centerRadius + torusRadius * cos2PIt) * cos2PIs; ++vp; *vp = torusRadius * sin2PIt; ++vp; + *vp =-(centerRadius + torusRadius * cos2PIt) * cos2PIs; ++vp; *vp = (centerRadius + torusRadius * cos2PIt) * sin2PIs; ++vp; if(np) @@ -802,8 +802,8 @@ namespace hgl // generate normal and stores it in the right position // NOTE: cos (2PIx) = cos (x) and sin (2PIx) = sin (x) so, we can use this formula // normal = {cos(2PIs)cos(2PIt) , sin(2PIs)cos(2PIt) ,sin(2PIt)} - *np = cos2PIs * cos2PIt; ++np; *np = sin2PIt; ++np; + *np = -cos2PIs * cos2PIt; ++np; *np = sin2PIs * cos2PIt; ++np; }