corrected one bug In Oriented Cone

Must be traslated correctly to the origin before applying rotation
This commit is contained in:
nico 2017-12-28 15:19:42 +11:00
parent 6625a319b9
commit 34cccaf7f0
1 changed files with 1 additions and 6 deletions

View File

@ -535,12 +535,8 @@ void OrientedCone(MeshType & m,
typedef Matrix44<typename MeshType::ScalarType> Matrix44x; typedef Matrix44<typename MeshType::ScalarType> Matrix44x;
Cone(m,r1,r2,Distance(origin,end),SubDiv); Cone(m,r1,r2,Distance(origin,end),SubDiv);
// tri::UpdatePosition<MeshType>::Translate(m,CoordType(0,1,0)); tri::UpdatePosition<MeshType>::Translate(m,CoordType(0,Distance(origin,end)/2,0));
// tri::UpdatePosition<MeshType>::Scale(m,CoordType(1,0.5f,1));
// tri::UpdatePosition<MeshType>::Scale(m,CoordType(xScale,1.0f,yScale));
// float height = Distance(origin,end);
// tri::UpdatePosition<MeshType>::Scale(m,CoordType(radius,height,radius));
CoordType norm = end-origin; CoordType norm = end-origin;
ScalarType angleRad = Angle(CoordType(0,1,0),norm); ScalarType angleRad = Angle(CoordType(0,1,0),norm);
const ScalarType Delta= 0.000000001; const ScalarType Delta= 0.000000001;
@ -560,7 +556,6 @@ void OrientedCone(MeshType & m,
} }
tri::UpdatePosition<MeshType>::Matrix(m,rotM); tri::UpdatePosition<MeshType>::Matrix(m,rotM);
tri::UpdatePosition<MeshType>::Translate(m,origin); tri::UpdatePosition<MeshType>::Translate(m,origin);
} }