We are about to switch to a new forum software. Until then we have removed the registration on this forum.
what function can be used in a programming code to move the centre of rotation from centre of sketch to centre of the 3D object. For eg A stick not rotating on its end but its centre
Answers
translate()
https://processing.org/tutorials/transform2d/
translate() is the general purpose way to solve these problems -- in addition, for built-in shapes, you can set the mode to centered for that shape type -- rectMode(), ellipseMode() etc.
You can isolate rotations with pushMatrix and popMatrix
translate moves the freedom of rotation to wherever u want on the screen but what if we want to rotate about the centre of the irregular body shape like a rock or something
Just draw that irregular object from the center, the same as a regular one. No matter how irregular, it has a center -- width/2, height/2, depth/2.
To center everything / anything with respect to the 3D camera, use the PeasyCam library.