Feb. 19th, 2018

Creating a Basic Cam Model - Maya

Using Maya, I was able to create a very basic cam mechanism using a basic cylinder as the main body, and moving a few of the edges symmetrically to create a more interesting shape for the follower to follow as it rotated.

Colliders for Cam in Unity

Placing Colliders
  1. Use Capsule Collider for main body of Cam (turned sideways, the body of the capsule collider works well as a cylinder collider)
  2. This capsule collider has its radius set to that of the Cam main body, and its height can be adjusted to fit the thickness
  3. Create gameObject - cube
  4. Remove components: Mesh Renderer and Mesh Filter (leaves cube's collider: this collider has more flexibility for more complex designs)
  5. Set this as a child of the original game object of choice (the gear model in our case)
  6. This was rotated at a 45 degree angle and moved to fit the sharp tear-shaped location of the Cam
Setting Up Cam-Follower System
  1. Cam Constraints: Frezze Position - x,y,z; Freeze Rotation - x,y
  2. The Cam was given a script to rotate it about its Y-axis
  3. Cam rotation is used to physically drive the follower
  4. Follower Constraints: Frezze Position - x,z; Freeze Rotation - x,y,z
  5. Follower was also affected by gravity, to help physically drive it to follow the cam

The follower for this cam-follower system is just a generic Unity cube game Object for now, with a basic box collider. This setup appeared to work well for this basic cam-follower mechanism. There was a bit of a difference in the way this cam was imported into Unity as opposed to the gear, which will need looked into. Its polySurface, which contains the mesh of the object, is a separate and child object of the actual "Cam_Basic_Unity" export.

Driving Gear Mechanisms in Unity with Physics Engine

The following video shows the cam-follower system in action.

Example Video of this Cam Animation in Motion

Comments

Popular posts from this blog

Online Multiplayer Networking Solution Tutorial Using Unity and Mirror - Tutorial by: Jason Weimann

Exporting FBX from Houdini with Color

Houdini Assignment - Fuse and Group