You can write code here to use Aspose.3D and run the code in browser to see how it works.
Step 3 of 3: The following code shows how to use the FromRotation method of a quaternion to perform transformation operations on a torus.
using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Utilities;
using Aspose.ThreeD.Shading;

//Create a new 3D scene
Scene scene = new Scene();

// Initialize object by Torus class
IMeshConvertible convertible = new Torus();

//Convert a Torus to Mesh
Mesh mesh = convertible.ToMesh();

// Initialize Node class object
Node cubeNode = new Node("cube");

// Point node to the Mesh geometry
cubeNode.Entity = mesh;

// Set translation
cubeNode.Transform.Translation = new Vector3(-3, 0, 0);

//Add cubeNode to the scene
scene.RootNode.ChildNodes.Add(cubeNode);

// Initialize another node class object
Node cubeNode2 = new Node("cube2");

// Point node to the Mesh geometry
cubeNode2.Entity = mesh;

// Set rotation
cubeNode2.Transform.Rotation = Quaternion.FromRotation(new Vector3(0.3, 1, 1.7), new Vector3(0, 1, 0.3));

// Set translation
cubeNode2.Transform.Translation = new Vector3(3, 0, 0);

// Add cubeNode2 to the scene
scene.RootNode.ChildNodes.Add(cubeNode2);

scene