MMD Rotating objects 360-degrees…
Miku’s Guide to the Galaxy – Animating the Earth and the Moon (Part 2)
In Part One, we downloaded our planets and prepped the objects to be rotated… loaded our object into PMXE and centered-up the center-bone and added a Motherbone.
Here, in Part Two, we will animate MMD rotating objects 360-degrees.
The nature of MMD’s 3D space
Any point in space inside of MMD can be referenced by a coordinate system, In the picture below, the origin point which is 0x, 0y, 0z is the point immediately under the South Pole. MMD knows where everything is relative to this point. So for example, Miku and the Moon both have coordinate values relative to the origin point which tells MMD where to draw them. But how exactly does MMD know how to draw Miku?
The LOCAL coordinate system
Miku has a Center bone. Every other bone in her structure is relative to this bone. All that MMD cares about is where her Center bone is relative to the world origin point. You can confirm this in MMD, simply by selecting her Center bone and MMD will display it’s value. It does this for no other bone in her body except her mother bone which has a special function.
When MMD draws Miku, it looks at her PMX or PMD file and that gives it all the information it needs to draw Miku. In simplistic terms, MMD locates Miku in MMD’s 3D space based on the position of her Center bone and then builds her up using the rest of her bones which all have coordinate values which are relative to her center bone. Because of this system, when we move any of Miku’s bones, we use the “LOCAL” coordinate system.
Miku’s center bone is connected to a system of sequential bones chains. Each bone in the chain has an axis of rotation which is based off of it’s relationship to the other bones in the chain. This system, in a nutshell, makes it much easier (and faster) for MMD to draw Miku as all it needs to worry about is how changes in one bone affects subsequent bones in the chain.
This is an important concept to understand: each individual model loaded into MMD must have a center bone and is controlled by its own unique local coordinate system.
The GLOBAL coordinate system
The GLOBAL coordinate system is absolute. If we want Miku to walk, we can make a walk animation, and she will execute it but will move no where in 3D space unless her center bone is moved.
If a model has a “mother bone” also known as a “master bone” or “root bone”, that bone can be used to customize the world coordinate system for the model to which that bone belongs. This is why normally, you do not use this bone for any other purpose.
Why it is important to understand the functions of these two systems
A lot of beginners to MMD do not understand the full significance and differences between the LOCAL and the GLOBAL coordinate systems. What they are used for, when to use them and how they are interlinked. This is why a lot of new users have difficulty rotating models in MMD.
But in a nutshell:
- The Local coordinate system is used when manipulating the bones that is within the structure of any given individual model.
- example of use: moving or rotating any bone in the Miku model; treat the whole model as one self-inclusive system.
- The Global coordinate system is used to manipulate any given individual model’s disposition within MMD’s 3D world environment.
- example of use: moving or rotating an entire model within MMD’s 3D space.
- In camera mode you can toggle between Local > Global > Accessory modes.
- In model manipulation mode you can toggle from Local > Global mode only.
Describing direction of rotation in MMD
Anything in MMD can be rotated in the following directions:
- LEFT > RIGHT
- RIGHT > LEFT
- X-axis (red)
- UP > DOWN
- DOWN > UP
- Z-axis (blue)
- FRONT > BACK
- BACK > FRONT
But how does MMD know which way you specifically want the direction of rotation? The answer is that you show MMD and it will “remember” the desired direction of rotation but this is not an AI function and requires specific steps as otherwise MMD will do its own thing.
A Problem and a Solution
If you attempt to animate a 360 degrees rotation in MMD, nothing happens. This is because MMD interprets 0.0 degrees > 360 degrees as going from 0.0 degrees > 0.0 degrees. So the way to rotate an object 360 degrees is to do it segments. Watch the video below as it shows you how it is done:
Although the video only shows a clockwise rotation along the Y-axis, the same method applies on any axis and in any direction of rotation. The only trick is to get your mind around it all and once you “get it“, it is actually stupidly simple to do. But in a nutshell here are “the rules“:
- Use GLOBAL mode (recommended).
- Only use the widget controls on the lower right of the main display to rotate the model.
- Only rotate in the desired direction of rotation.
- Fine tune the angle using the input box(es).
- Click register to make sure that MMD accepts the values. This will create an entry in the Groups display on the left side of the screen.
- Rotate in 90 degree segments.
MMD will accept 180 degree and 270 degree segments as well. So you could have done the same thing above using a 270 degree segment plus a 90 degree segment. But given MMD’s quirky nature, the method shown is preferable.
We used LOCAL mode in the video. This is fine because we were only rotating on a single axis.
But as a beginner make it a habit to use GLOBAL mode for rotations and save yourself a lot of grief.
- Negative values rotate in one direction and positive values rotate in the opposite direction; pay attention to these.
- MMD will tell you whether to use a positive or negative value in the angle input box based on the direction of rotation.
- You cannot enter “-0.0”. Zero cannot be a negative number! MMD will change a negative zero to “0.0”.
- You cannot enter “360” either; MMD also changes this to “0.0”.
- MMD does not memorize the direction of rotation once the motion is registered.
- This means that you cannot use “cut/paste” methods to edit the Groups list. All additional rotations need to be manually entered.
- If you make a mistake, delete the entry in the Groups list display and redo.
Rotating on more than one axis
You can also rotate along multiple axis at the same time as the next video will show:
There is a trick to this and as long as you follow this method, you should not run into problems:
- Use GLOBAL mode (highly recommended and in some instances mandatory).
- Rotate along one axis first.
- Register this rotation.
- Now rotate along the other axis.
- Register this rotation as well.
If you really need to rotate along a third axis, just repeat steps 3 and 4.
USE GLOBAL MODE as it makes doing things far less confusing both for yourself and MMD.
ROTATING THE EARTH AND MOON MODEL
The real Moon rotates around the Earth about every 27-28 days and the Earth rotates around its own axis every 24 hours. Nobody in their right mind will want to watch that, especially Miku.
In any case, we will make things very simple for our project animation:
- The Moon will rotate around the Earth in 1000 frames (it does only a single complete rotation).
- The Earth will rotate around its own axis 360 degrees every 200 frames (for a total of 5 full rotations).
The method used to rotate both models is exactly the same one used to rotate the laptop in our first video: 4 x 90 degree segments for one complete rotation. Once all the rotations are programmed, we will use the mother bone at frame 0 to tilt the entire model 23.5 degrees to simulate the Earth’s tilt. It is just this simple to do and the entire process can be seen in the video below.
The moon also has a tilt too, but since the model isn’t accurate but simply representative, we will ignore this. If you want to do this the model does allow the moon to be tilted. But, honestly no one will notice the difference.
We encourage you to try and recreate this animation using the instructions above as being able to do this for yourself will be very instructive. But if you just want to see the motion in action, the motion file is included in the Earth and Moon model download file.
- Appearance Miku: Mamama
- Planet models: Spakaford1
- Background image: NASA
- MMD 9.31 / PMX Editor 0.2.5.4 / AviUTIL / IrfanView64
- Music: YouTube Audio Library (Jeremy Blake)
- MME: ExcellentShadows2 / dDarkShader
– SEE BELOW for MORE MMD TUTORIALS…