I'm working on a project for work where I'm moving and rotating a model. The way the code is written right now when I rotate a model it rotates around the origin, which becomes a pain when trying to rotate and positon a model correctly. Basically I'm hard coding a model viewer, or something similar to that. If I was able to rotate the model around it's local axis instead of around the origin, that would make it a lot easier to position correctly.
So basically, I have code (in flash) that allows me to rotate a model around the origin. Does anyone know a way to change to code, methods, equations, ideas, anything to get it to rotate around it's local axis?
Replies
It's the button on the top menu bar that looks like an illustration of an angle with a red magnet in front of it, click that to enable it. Right-click it if you want the options, I think the default is 5 degrees, I usually change it to 1 or 0.5.
Don't know about the other thing, I loathe Flash.
http://paulneale.com/
I almost got the rotating on the local axis working on friday. How the code works right now is that I take the original object (an array of xyz coordinates for each vertex) and I calculate the rotated values on that, find the difference between the newly rotated object and the original object, and then apply that difference to the object I want to rotate. Right now it works, but for some reason every time I rotate it the object gets larger.
Well, I'm adding the difference to the object I want to rotate and it gets larger, and if I subtract the difference then it gets smaller. So there's gotta be some part of the equation that I'm missing right now that would keep it the same size.
I've never worked with flash before this, and I'm just working on code, which isn't very flashy.