Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: HOow do I make randon spinning?  (Read 1802 times)

davdud101

  • Sr. Member
  • ****
  • Posts: 949
  • Couldn't ever use Blender or Maya. Anim8or's good.
    • View Profile
HOow do I make randon spinning?
« on: April 09, 2012, 07:30:26 pm »

Wazzap, my friends. Hope you all had a great Easter, first off.
So I have this 3d bullet shell I made in Anim8or, and I'm wondering, is there some kinda... script, or math I can use to just pretty much let this thing roll, pitch, and yaw freely and at random?
(Just nod too random, you know with some order)
Hopefully you get my drift.... If not, here's a demonstration of what I'm trying to achieve (this one used for lack of a better find);



That, except more of an extreme spin, kinda just flipping around for perhaps 30 seconds. Any ideas?
Logged
?

lppena

  • Sr. Member
  • ****
  • Posts: 298
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: HOow do I make randon spinning?
« Reply #1 on: April 09, 2012, 10:45:46 pm »

I wonder if Anim8or supports animation looping? Then you could just keyframe some simple rotations on the three axis. I've started to do this on some of my models when I need them to move or rotate on a single axis. I haven't mess with the keyframer in Anim8or yet, but in Truespace you just open the scene editor, expand the time line panel, record a keyframe and move or rotate the object manually several times recording intermittent keyframes until you have a full rotational cycle. Does any one know if Anim8or works in a similar fastion? Thanks, Leroy.
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 901
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: HOow do I make randon spinning?
« Reply #2 on: April 10, 2012, 12:52:08 am »

Im pretty sure you can, however in that video, the rotation is not random.

It's just each axis of rotation (yaw, pitch and roll, or x,y,z) is being increased steadily at once.
IE
x is added some
y is added some
z is added some
Next frame
x is added some
y is added some
z is added some
So on
Logged

davdud101

  • Sr. Member
  • ****
  • Posts: 949
  • Couldn't ever use Blender or Maya. Anim8or's good.
    • View Profile
Re: HOow do I make randon spinning?
« Reply #3 on: April 10, 2012, 01:27:41 am »

Well, you guys, that video wasn't a very great example, I'll try to find a better one.
@Leroy That does work, great suggestion, but I was looking for something less uniform, more entirely randomly chosen.
@CD That may work, I'll have to give I a try...
Logged
?

ENSONIQ5

  • Sr. Member
  • ****
  • Posts: 925
    • View Profile
    • Mission Backup Earth
Re: HOow do I make randon spinning?
« Reply #4 on: April 10, 2012, 04:53:17 am »

A spinning bullet wouldn't be random, unless you are accounting for wind turbulence.  The best way would to script rotation in all three axes, as previously mentioned, and if the rotation rate in each axis was different the effect would be reasonably random, or at least not reveal too much of a pattern.
Logged

ENSONIQ5

  • Sr. Member
  • ****
  • Posts: 925
    • View Profile
    • Mission Backup Earth
Re: HOow do I make randon spinning?
« Reply #5 on: April 10, 2012, 08:41:00 am »

Here's a (very) quick test, rotating in two axes: longitudinal, as if the bullet was fired from a weapon with rifling in the barrel, and; tumbling end over end.



Note that the longitudinal rotation is not easy to see in this video, a better camera position and taking the time to carefully set the rotation speed would improve this.  Rotating in the third axis as well as the first two results in an unnatural oscillating wobble, I believe the 2-axis spin is a more realistic representation of a flying bullet.  This uses the basic rotation script applied to the bullet's orientation controller:

float $speed;
$speed=6.3;
$orientation = (sin($speed*time),0,0,cos($speed*time));

The bullet element assigns a target object as its parent, and this parent object is further rotated using the same script, modified as below:

float $speed;
$speed=5;
$orientation = (0,0,sin($speed*time),cos($speed*time));

Note that the $speed variable adjusts the speed of rotation, and the position of the 'sin' calculation (either the first, second or third parameter of the $orientation function) selects the axis of rotation.
« Last Edit: April 10, 2012, 08:44:51 am by ENSONIQ5 »
Logged