Skip to content

Commit 2c1514e

Browse files
committed
Fix transformation order.
1 parent 47f7e3f commit 2c1514e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Sources/Basic3DNodes/Basic3DNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ NE::ValueConstPtr ArcPointsNode::Calculate (NE::EvaluationEnv& env) const
310310
segmentAngle = angle / (float) segmentation;
311311
}
312312
glm::vec3 currentPoint (radius, 0.0f, 0.0f);
313-
glm::mat4 rotation = glm::rotate (glm::mat4 (1.0f), glm::radians (segmentAngle), glm::vec3 (0.0f, 0.0f, 1.f));
313+
glm::mat4 rotation = glm::rotate (glm::mat4 (1.0f), glm::radians (segmentAngle), glm::vec3 (0.0f, 0.0f, 1.0f));
314314
for (int i = 0; i < segmentation; i++) {
315315
result->Push (NE::ValuePtr (new PointValue (currentPoint)));
316316
currentPoint = glm::dvec3 (rotation * glm::dvec4 (currentPoint, 1.0));

Sources/Basic3DNodes/TransformationNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ NE::ValueConstPtr CombinationNode::Calculate (NE::EvaluationEnv& env) const
304304
valueCombination->CombineValues ({transformation1Value, transformation2Value}, [&] (const NE::ValueCombination& combination) {
305305
glm::dmat4 transformation1 = TransformationValue::Get (combination.GetValue (0));
306306
glm::dmat4 transformation2 = TransformationValue::Get (combination.GetValue (1));
307-
glm::dmat4 transformation = transformation1 * transformation2;
307+
glm::dmat4 transformation = transformation2 * transformation1;
308308
result->Push (NE::ValuePtr (new TransformationValue (transformation)));
309309
return true;
310310
});

Sources/Modeler/Shape.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void Shape::SetTransformation (const glm::dmat4& newTransformation)
2727
Modeler::ShapePtr Shape::Transform (const glm::dmat4& newTransformation) const
2828
{
2929
Modeler::ShapePtr transformed = Clone ();
30-
transformed->SetTransformation (transformed->GetTransformation () * newTransformation);
30+
transformed->SetTransformation (newTransformation * transformed->GetTransformation ());
3131
return transformed;
3232
}
3333

0 commit comments

Comments
 (0)