Tony's tutorial Page

I'm making a slight disinction between the "artwork" on the artwork page, and the technical parts on the this page.

 Next -> 1 2

Wooden Trains (Tutorial)       2:14 PM - Dec 26, 2008

Download kit here: woodTrains.zip (3MB)

This is the technical side of the wooden trains work that appears on the artwork page.

I wanted to make the trains ride along the tracks and make the track layout fairly flexible. This meant making the track scripting system update somewhat automatically, making functional switch tracks, and making off-ramps and on-ramps that would let the train go "off road" and drive around on the train table.

I also (despite working with Maya since 2001) hadn't really ever had the need of building a control window, so this was also an exercise in building a control panel.

Icons need to be stored in /maya/prefs/2008/icons


This is a simple track layout. It looks pretty, but the train doesn't use the render geometry to move. It's only the clever rigger lining up the system that preserves the illusion of consistency.


This is the actual train system. The blue curves and locators are the track. The black locators and joints are the train. The locators of the train are lined up with the axles of the wheels of each car. The car geometry is constrained to these locators, which are then moves along the curves from piece to piece.


Each track piece consists of the geometry shape, two locators, and a NURBS curve.

The locators have a string attribute added called "other track". Once the track is all linked up, this attribute will hold the name of the locator on the matching piece of track that lines up with this locator. This lets the train script know what the next piece of track is that the train will roll onto when it rolls off of this current piece of track.

The NURBS curve is the path that the train follows. All of the curves are parameterized from 0 to 1 regardless of their distance. The train rolls along the curve for one track piece until it hits the end then it quickly swaps to the near end of the curve of the next track piece and continues rolling.


Each train car is constrained to a locator for each axle of the train car. These axles have several extra attributes.
CurrTrackParamVal stores how far along the current track (from 0 to 1) this locator is.
DistFromFront stores how far in world space distance this axle is from the front of the train. This is used with the script for setting the train on the track initially, and doesn't change as the train moves along.
FacingZeroToOneDir stores whether or not this axle is is pointed along the current track in the direction of the curve's parameterization from 0 to 1. That is, if the train is moving forward, should this axle's CurrTrackParamVal be going towards 1 or towards 0? This is necessary because the train can easily travel both ways across a single track piece.
CurrTrackCurve stores the name of the NURBS curve for the current track piece that this locator/axle is currently on.
IsLastAxle is used for switch tracks. Once the last axle of the train travels across the beginning of a switch track, the switch can toggle to another direction without disrupting the train's movement.


CurrTrack is deprecated from an earlier script, and I need to get rid of it.

Download kit here: woodTrains.zip (3MB)

Rubik's Cube Texturing Tutorial       12:00 AM - Mar 15, 2008

After I posted my Rubik's Cube riggin tutorial, the question came up about how to texture it so that each face of the main cube shared a single texture node in Maya. That's straightforward enough, so I've written up notes on how to get that to work, as well.

This adds flexibility to the rig, as well. With the same geometry, you can quickly change what image you have showing on each face. You could create an cube animations -- but use different pictures for each season of the year...

Geodesics       10:00 PM - Mar 10, 2008

Here are the quick notes about the geodesics python script that I mentioned on the artwork page.

Download the geodesic.py file and save it in your /maya/scripts directory. There is an "example use" script near the top of the script that shows the syntax of how to use it, and creates the scene that this image was taken from.

Each of the 5 platonic solids is supported, though there is a subtle trick that the script does with the tetrahedron, so you'll notice that one ends up parented underneath another transform group when the script finishes. Since Maya's typical way for calculating the centerpoint of a mesh doesn't line the center up with the true centroid of the tetrahedron, I needed to fudge it a bit by poly-combining the tetrahedon mesh with a sphere mesh, then separating them when the script finishes.

This isn't as fancy as some other geodesic scripts, which support different frequencies of geodesics (great circles) around the unit sphere, but it gets the job done for creating regular meshes that a suitable for nCloth simulation meshes (which was my primary purpose when I wrote this).

You can even run the sort of geodesizing routine on any mesh, but the results are usually pretty bad unless the object is somewhat regular and has its centroid at the origin.

Basically each step I need the faces split on each step, then all of the vertices projected to a sphere. I'm using linear poly smoothing for splitting the faces, and I'm using the sculpt mesh tool to do the projection for me to the unit sphere. To keep things spherical, I'm scaling the non-final iteration steps down to .75, so that all of the points will be within the unit sphere when the next sculpt tool projects them outwards again.

The end results are over on the artwork page, and available in wallpaper form.

Geometry on Wireframe - ballAndStick       10:42 AM - Mar 10, 2008

ballStick.py - There is a script that's been floating around Maya forums and message boards for a long time that populates a poly mesh with geometry - putting a sphere on each vertex and a cylinder on each edge. A flexible implementation of this could add some interesting possibilities for rendering meshes. Also, one could model scaffolding or wireframe-style objects by modeling the polygon object that would be populated.

I looked around for that script to work with my geodesic spheres the other day, (see the artwork page) but I couldn't find one. So I wrote one. My script creates a bunch of spheres and cylinders. It groups them into two new groups (one for spheres, one for cylinders). You can pass in the values you want for the radius and for how many divisions you want on each of the objects. To make it more flexible, I also hook up control attributes on the new group nodes, so you can easily change these values on the fly even after you've created your spheres and cylinders.

You can use it by downloading this file into your /maya/scripts directory, then running in the Maya python Script Editor:

import ballStick; ballStick.ballStick(); 

(It's a good idea to select the polygon object you want to populate before you run this...)

Rubik's Cube Advanced Tutorial       10:01 PM - Feb 05, 2008

I finally got around to extending the Rubik's Cube tutorial to include how to animate the rig (and, most importantly, a copy of the rig and scripts for downloading.)

Rubik's Cube Tutorial       7:38 PM - Feb 05, 2006

A basic introduction to polygon modelling in order to build a Rubik's Cube. I'll eventually extend this to include how to make it "move" properly, which is not a simple task, since the blocks keep changing their local axes.


 Next -> 1 2        


 
tony@kaap.us | WebSite by KaapFamily.net  |  Valid CSS  |  Valid HTML