Automatic Rolling Ball Rig

   3154   0   1
User Avatar
Member
12 posts
Joined: Oct. 2013
Offline
Hi guys,

I am currently learning Houdini. I decided to take a break from dynamics for a bit so I am trying to create a rolling ball rig. This may or may not be pretty far outside of my skill level, but I really want to figure out how to get this working.

I've been doing a lot of research on the internet trying to solve the issue of rolling between the X and Z axis. I have my ball rolling fine using hscript between a control's movement/translation that determines a locator's rotation, but once you try to translate diagonally at all between X and Z the rotation starts messing up. I am quickly realizing that hscript will not cut it.

Some have said you have to implement the object's position at the current keyframe, but I would like to avoid having to implement time into this if possible so that I can visually animate and see what is happening as I move it in the viewport.

I have been through a bunch of forums and found one odforce forum post that had a file that used a VOPSOP to calculate the quaternion between a specified axis(es) and angle. Then it muliplied that with the object's point vector. (screencaptures attached)

Forum Link:
http://forums.odforce.net/topic/5415-quaternions-where-to-enter-them/?hl=rolling+cube [forums.odforce.net]

This works relatively well even with multiple axis values, but it does not account for translation. I think I have a theory on how I can get this to work but not enough know how to know where to start, really. I am wondering if you guys may have an idea or suggestion?

How might I get the translation values to determine what percentage of an axis is being used, or faced towards, between 0 and 1? (1 being 100%)

Attachments:
rotation_quaternion_in_use.png (488.5 KB)
rotation_quaternion_graph.png (51.4 KB)

Houdini Indie
Windows 10 Intel i7-5820K @ 3.3GHz
MSi Nvidia GeForce GTX 980 Ti 6 Gb
16 Gb RAM
  • Quick Links