You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/modifiers.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,3 +231,37 @@ This will shift the entire cube mesh 2 units along the X-axis, 1 unit along the
231
231
232
232
By understanding the basic principles and parameters of the Translate Modifier, you can effectively use it to position and manipulate 3D meshes in your projects.
233
233
234
+
## RotateXModifier
235
+
236
+
**Purpose:**
237
+
238
+
The `RotateXModifier` is a mesh modification tool designed to rotate a 3D mesh around the X-axis by a specified angle. This is useful for various transformations and manipulations, such as aligning objects, creating rotations, or simulating object movement.
239
+
240
+
**How it Works:**
241
+
242
+
1.**Rotation Angle:** The `angle` parameter defines the angle of rotation in radians.
243
+
2.**Rotation Matrix:** A 3x3 rotation matrix is created using the specified angle.
244
+
3.**Vertex Rotation:** Each vertex of the mesh is multiplied by the rotation matrix to apply the rotation.
245
+
246
+
**Using the RotateXModifier:**
247
+
248
+
1.**Create a Mesh:** Start with a basic 3D mesh, such as a plane, cube, or sphere.
249
+
2.**Create a Rotator:** Instantiate a `RotateXModifier` object, specifying the desired rotation angle in radians.
250
+
3.**Apply the Modifier:** Apply the `modify` method of the `RotateXModifier` to the mesh.
251
+
252
+
**Example:**
253
+
254
+
```java
255
+
Mesh3D mesh =newCubeCreator().create(); // Create a cube mesh
mesh.apply(rotator); // Apply the modifier to the mesh
258
+
```
259
+
260
+
This will rotate the cube 45 degrees around the X-axis.
261
+
262
+
**Additional Considerations:**
263
+
264
+
***Combining with Other Modifiers:** The RotateXModifier can be combined with other modifiers like Translate, Scale, or Bend to create more complex deformations.
265
+
***Order of Application:** The order in which modifiers are applied can affect the final result. Experiment with different sequences to achieve desired effects.
266
+
267
+
By understanding the basic principles and parameters of the RotateXModifier, you can effectively use it to rotate 3D meshes around the X-axis in your projects.
0 commit comments