Rigging Hydraulic Pistons in Lightwave

I just read this (post #21) and figured I'd pontificate on what I've been able to do fairly quickly. Lightwave makes this easy with the built-in tools available. Now I have to be honest here: I don't remember if I read this technique in someone else's tutorial, or if I thought of it on my own.

Once upon a time I downloaded a model of the Imperial Probe Droid from Star Wars Episode 5. The model I downloaded, however, was for another package, and had been built pretty sloppily. I ended up completely rebuilding it (nothing original though: I used the downloaded model as my template, so mine looks pretty much exactly like the original). One of the deficiencies of the download was there was nothing to animate. I wanted the spider legs to fold and unfold. Here's a short flik of my rebuilt, fully rigged model.

To do this most easily requires a bit of planning in Modeler. You need to build each animatable part in its own layer, and with the rotation point at 0,0,0 and with the body facing along the positive Z axis. For example, here are all the parts for one leg:

image image image image image

The next step is to place in Layout each part in its proper relative position:

image

Also, set up a proper parenting hierarchy:

image

Now, the really easy part: Bring up the Motion Options panel for the Piston, and have it point at the Cylinder, and vice-versa:

image image

Suddenly, the two are now properly engaged, and as you rotate the lower arm, the whole piston assembly Just Works:

image image

The next step is to assign reasonable rotation limits for each part of the arm. You don't need to worry about the piston assembly at all since it's now fully automated. Finally, add an IK target for the arm, and turn on IK on the end piece, and each piece up the chain (be sure to not enable "Keep Goal Within Reach"):

image image

Now you can just animate the goal object and the whole leg does its thing.

Complex UV Mapping The Easy Way

I have to admit, I didn't make this one up, but I observed it in some great models I got from Al3d. I'm glad he left in the leftovers on those models or I'd probably never thought of this.

Say you've got a model with various sundry shapes and surfaces, none of which are precisely Planar, Cylindrical, or Spherical. Yet, you want to set up some UVs on one of these surfaces. The built-in tools in Lightwave make it fairly difficult (granted, I'm not really experienced at this, so I could be missing something here). You can select some polygons, click "Assign UVs" and then you get your choice on one of the built-in projection types. But what if what you want to apply on to isn't quite facing the right way? I've tried transforming the UVs after assignment, and all I ended up with was horrible distortion.

The thing to remember is the UV coordinates are assigned to points. Once assigned, they're constant, no matter what transformations you place on the points. The trick here is we're going to apply a transformation before we assign the UVs. The trickier part is the transformation we apply will be disposable (no need to get tricky with Undo, or with some funky plugin).

Just create a new morph-map for your object. Then select the morph map. Now rotate, move, scale, whatever the model so that a simple projection is possible. Select the polygons, assign the UVs, then dispose of the morph map. That's it!

Here's an example: I've got a Viper model, from Battlestar Galactica. Here's an image of a wing:

 

image

 

I want to add the "NO STEP" image to where I've got green lines. The problem here is any planar projection is going to leave me with seriously distorted images. So, I make a morph-map. With the morph map selected, I'll rotate the wing so that it's not banked over:

image

Then rotate it so that the wing is aligned to my intended text alignment, and select the relevant polygons:

image

Create a new UV map with a simple Y projection (using defaults):

image

At this point, you can dispose of the morph map (or continue rotating for more applications). The UV map isn't scaled quite right just yet, so we'll tweak it a bit:

image image

I just scaled up the UVs, and moved them a little:

image

 

I find this technique substantially easier than trying to transform the UVs after the fact, and it's much easier than using UV Edit Pro.

Making "Battlestar" Ribs and Hull Plating

You've seen the show. You may even know the visual effects are all made with Lightwave 3D. Now, you'd like to make your own battlestar. Here's a quick method for making the ribs and hull plating just like you see it on the show. These techniques should translate fairly easily into other 3D packages, so read on.

First, you want to make the basic shape of your ship. I won't go into detail on how that's done. I'm going to start with a basic shape for the head of the ship:

image

Once you have that all squared away, we're going to make a copy. Copy this into the next layer. In the 2nd layer, use the Smooth Shift tool to inflate the object by some amount (I've built mine to scale, so I'm going to inflate it by 2 meters). The amount you shift out is going to be the height of the ribs overs the main surface. The plates will then also sit on the ribs.

Then, put focus on the 3rd layer, and set the 2nd layer to be your background layer:

image

Now we're going to create an array of boxes to slice into this layer. Think about how wide you want each rib to be, and how far apart you want them. For my taste, I'm creating ribs which are 1m thick, and with a gap of 4m between. Make a single box on the left edge of the hull, 1m thick and any amount taller and wider than the ship itself:

image

Now clone it enough times (with that 4m gap in between) so it spans along the whole length of the ship:

image

And then easy part: Do a Boolean operation (Intersect) and change the surface to "Ribs":

image

Cut everything from this layer and paste it on layer 1:

image

There! Easy ribs. Now for the hull plates. Again, put focus on layer 3, with layer 2 in the background. Create a bunch of boxes in various shapes, sizes, and positions (I'm not working on accuracy to the studio model here - just giving an example of the process). Be careful about what parts of the surface on layer 2 they intersect:

image

Now go to layer 2, select layer 3 into the background and do Solid Drill with a stencil operation. For the new surface, choose "Plates."

image

Select the stuff that isn't "Plates" and delete it:

image

Because Lightwave's Smooth Shift operation doesn't leave the original geometry behind (a single plane, when shifted becomes a box with an open end where the plane was originally), we need to do a couple of tricks here. First, flip all polygons, then copy them to the clipboard. Flip them again and apply the Smooth Shift operator for, say, 1m. Then paste and merge points. You get (zoomed in):

image

Now cut all this and paste onto layer 1:

image

There, easy plates! For more aesthetically pleasing results, you may want to round off the sharp corners of everything. I hope this has been helpful and educational.

Loopable Chaos - Volumes!

In my previous tutorial, I discussed a method of using combinations of 3D textures to create a sequence of 2D images which could be looped, yet still appear to be ongoing chaotic change. However, that technique won't work if what you want to create is a 3D volume, resulting in a 3D movie you want to be able to loop. For example, a fire in a fireplace, with logs and all. If you try to employ my previous technique, you end up with a dancing volume that appears to have at least 2 distinct portions to it: some sliding up and some sliding down.

In order to emulate a fire in a fireplace, the texture needs to move up and only up. Any downward motion just wouldn't look right. However this leads to a serious problem - you can move a 3D fractal texture up all you like and you're not likely going to hit a space where the pattern starts over. You'll never make a loop.

Let's start with some basics: create a new scene, place the default distant light at 0,0,0 and point it straight up. Then, open the property panel for it, select "Volumetric Lighting" (remember, you need to also enable volumetric lights in the global Render options panel), and then click "Volumetric Light Options." To save a little time, load this preset. I then changed things a bit: set the Radius and Height to 1m, and Attenutation to 40%. There, that clears out some of the grunt work. On to the real meat.

Move your camera in reasonably close and render frame 0. Looks reasonably like a flame in a fireplace. Once again, if you should render out several frames, the texture won't move at all because we haven't animated it yet. Open the Volumetric Options panel for the light again and click "Edit Texture". You'll see three layers to this texture. The Gradient layer controls color output so we're not going to play with it at all. For the two Turbulence layers, apply an envelope to the Z channel and have frame 0 at 0m, and frame 120 at 10m. For me, this results in the right speed for flickering flames in a confined fireplace. If you render out frames 1 to 120 (don't start at frame 0), you'll get yourself a nice fire movie. Only, it won't loop nicely. Once again, there's no relationship in the texture between the first and last frames.

Here's where we'll get tricky: what we need to accomplish is a method of getting the texture to repeat itself. Since only the Ripples texture intrinsically loops, and we're not using that texture, we need to fake it out. Add a null object to the scene, name it Fader, and place it at 0,0,0. Then at frame 120, place it at x=1km. Now go back to the volumetric texture panel and add a new gradient texture to the top of the list. Give it an Alpha mapping mode, an Input Parameter of "Distance to Object", the ref object of "Fader" and give it two keys: 0m all white, 100% alpha, and at 1km, all black, 100% alpha. If you render out the sequence again, you'll see the flame slowly fading away.

Now, clone the light once. On the clone, edit the volumetric texture and invert the keys on the alpha gradient. If you render out the sequence again, you'll notice it looks exactly like the first render you did. In this case, the first light is slowly fading out, while the second light is slowly fading in. The two combined result in the original 100%. But it still doesn't loop.

What we need to do is make it so the end of the animation of the second light matches the beginning of the animation of the first light. Once again, open the volumetric texture panel for the second light, and change the Z location keys of the two Turbulence layers such that they move from -10m at frame zero up to 0m at frame 120. If you render frame 0 and frame 120, you'll see they're identical. Now render out the sequence (remember, frames 1 to 120 - don't include frame 0). If you loop it, you'll get something like this.

Note that this technique is also useful for creating loopable 2D image sequences: Since we're making a volumetric texture that repeats in a series of frames, you can take any 2D slice of that texture and get a repeating sequence of images.

(I've discovered a Lightwave bug: it won't save the scene properly, and reloading it won't render stuff out correctly. It loses the reference object for the two Distance to Object gradients. Load the saved scene file in a text editor and search for "Distance to Object". The following line will be 'ItemName ""'. Insert the word Fader in the pair of double quotes - do it for both instances! The scene will now load correctly, and oddly, save correctly too.)

An easier way to make Trekkish ship hull "Aztec" patterns

I'm always on the hunt for cheaper and easier ways to do things. If you're a Trek nut, you've probably given the special effects of the various movies a good hard look and noticed some exquisite texturing of the ship's hull. A fine example of a fan's work can be seen here. The thing to note is the repeating pattern of light and dark areas on the primary hull. Man, what a lot of work.

I found this site which had a pretty good tutorial on how to achieve the effect with fairly low effort. Low effort? Yah, right. It still was more than I wanted to invest. For starters, I haven't got enough experience with Illustrator to get the lines all lined up, and curved, and properly radial. Blek. I decided to come up with a trick that exploited the power of Lightwave (well, any 3D rendering app should be able to achieve the same results) and avoid even more work.

  • Lightwave can make cones.
  • Lightwave can project bitmaps onto surfaces using "cylindrical" mapping.
  • Lightwave can render orthographic projections.

Are you thinking what I'm thinking? I can make a pattern in just a few minutes. As in, perhaps five whole minutes.

Start up your favorite paint program (that can paint individual pixels) and make a very small bitmap. Black and white, 7 pixels across and 6 pixels down. I used Windows Paint. Paint a pattern of black and white pixels that has no intrinsic pattern to it and has a roughly 50-50 distribution of black and white. Something like this (It's zoomed in for clarity - those are really just single pixels):

Now, make a new bitmap that's twice as tall and four times as wide. Copy your base image into the upper-left corner. Then paste your base image again into the lower left corner. In the lower left, invert the black and the white (Windows Paint has no automatic feature to do this):

Now, Copy those pixels and drop them adjacent, and flip them left/right (Windows Paint does provide a method to do this automatically):

Now copy the pattern from the lower left to the upper right, and vice-versa:

We're now ready to exploit Lightwave. Save this image. Start up modeller and create a cone, on the Y axis, 500mm radius for all dimensions. Initially, give it a low number of sides, but we'll change that later. For the default texture, make an image map, cylindrical mapping on the Y axis, and use the little bitmap we've prepped. Turn off pixel blending and mipmapping. Click Auto Size. For the scale, set Y to 1/N, where N is how many concentric "stripes" you want (X and Z scale should already be set automatically). Set the Width Wrap Amount to how many radial repetitions you want. Save the object and start up Layout.

Load the cone into a new default scene. Change the default light to point straight down, and move the camera so it also points straight down, and then aim it over the cone. You may need to increase the light's intensity to get black and white results, as opposed to black and grey. Set your camera resolution to something square. If you're using Lightwave 9, set the camera type to Orthographic, and set the image height to 1m. If you're using an older version, set your camera very high up, and then zoom in so the cone occupies the whole image view. Render!

You may notice that yours doesn't quite look "round." This is because the cone isn't quite round. Go back to modeller and recreate it, only this time give it 1000 sides. That will make the base of the cone round enough that you won't end up with a pointy edge and an angular feel throughout the pattern.

I don't know about you, but I say that's a whole lot easier than playing for an hour in Illustrator. Of course, you might want a bit more control over exactly where things fall, and you may want a different pattern closer in to the center. This will take a bit more work, but you can easily figure that out on your own (slice the cone and define more surfaces).

A cheap way to make a geodesic dome

I've been paining myself on how folks have made geodesic domes. It seems like an awful lot of work to do, and it must be pretty difficult to get everything all lined up. Then it occurred to me that Lightwave Modeler has all the necessary tools to do this quickly and very easily.

Here's a quick cheat-sheet recipe:

  1. Open modeler and select the new Ball tool. Open the Numeric panel and change the type to Tessellation. Leave all the defaults alone. Close the tool.
  2. Select the bottom half of the sphere and delete it.
  3. Select all the polygons and change the surface name to Beams.
  4. Select the Bevel tool and open the Numeric panel.
  5. Apply a bevel of 1.25mm shift and 1.25mm inset.
  6. Apply another bevel of -1.25mm shift and 1.25mm inset.
  7. Apply another bevel of -1.25mm shift and -1.25mm inset.
  8. Apply another bevel of 1.25mm shift and -1.25mm inset.
  9. Change the surface name to Glass.
  10. Deselect all polygons.
  11. You're now ready to apply appropriate surface attributes to the beams and glass.

Presto! One geodesic dome!

Loopable Chaos

I've been working on a Stargate (see a few pictures) and one of the primary problems is the open wormhole. It's supposed to look like a water surface. The problem is it takes too long to render all that detail. I wanted to make an image sequence and then use that as a simple texture on a single polygon. The sequence had to be long enough that viewers can't notice the loop yet short enough that it doesn't take up too much disk space or too much time to render out.

This tutorial will cover how to make an image sequence that can be looped, yet still present the illusion of ongoing chaotic change. It will be a tutorial, not a recipe. Some amount of your own creativity is required.

Lightwave comes with many different flavors of fractal noise, and animating that noise in some way is pretty easy. Let's start with an example. Start Modeller and create a rectangle that's perpendicular to the Z axis:

OK, save it. Load that into Layout. Open the surface editor and set Double Sided (not strictly necessary, but it saves us the effort of properly aligning the polygon to the camera). Change the surface color to black. Assign a procedural color texure, and pick one of the myriad fractal noise functions. Set the scale to something appropriate so you can see some level of detail. Set the procedural texture color to white and do a test render. You should see something like this:

If you were to render several frames, they'd all come out the same since we haven't animated it yet. Since the rectangle was built perpendicular to the Z axis, changes in the texture's Z position will provide the best illusion of random variation. Moving the texture's position along the X or Y axes will only give the illusion that the texture is sliding around and not really changing.

Go back to the texture editor and click the Position tab. Then click on the E button to the right of Z. The graph editor will open with the Z axis selected.

Decide how many frames the animation will last. Note that if you plan on using the Ripples texture in your mix of procedurals, it will dictate how many frames you should use. The wavelength divided by the wave speed gives you the number of frames before the texture repeats itself. Be sure to choose useful values here so that the division results in an integer! Or, if you're going to use multiple Ripples textures, use the least common integral multiple for all instances to determine the frame count.

I'm not going to use Ripples in my mix so I'm going to arbitrarily use 60 frames. At frame 60, create another key and assign it a value:

Render out frames 1 through 60 (not 0 to 60) and you'll get something like this (you will need Windows Media Player v9 to view). However, there's a problem. The last frame rendered isn't the same as frame 0 would have been (had we rendered it) and so it won't "lead in" very well to frame 1. In fact, the whole tail end of the sequence has no relationship with the front end of the sequence. Consequently, the loop has abrupt jumps in it.

The solution is to use the Oscillator motion modifier. Delete the key at frame 60 and then click on the modifiers tab. Add Oscillator and open its property page. Set it up like so:

Note that the cycle time is 2 seconds (I'm using 30 fps), so the whole cycle will last the 60 frames. Also note that the start of the cycle is frame 0, but we'll be rendering starting with frame 1. This way, mathematically, frame 60 is the same as frame 0, and it'll loop nicely. Here is the result, and here is the loop.

It's better, in as much as the sequence loops nicely. However, this isn't good enough. It looks like it's see-sawing. The sinusoid is ridiculously obvious. We need to add to this to get rid of those pauses where the texture turns around. Go back to the texture editor and clone this layer twice. Set the two top layers' blending mode to additive and set all three layers' opacity to something between 30 and 50 percent (otherwise it'll get all washed out). To maximize the effect, we need to move all three textures to different base x,y positions (exact location is pretty much irrelevant - just as long as they're not overlapping):

Now change the oscillator settings so that the first one has a phase of zero (it should have that already), the 2nd has a phase of 120 degrees, and the third has a phase of 240 degrees. Looking at just the Z axes will show this:

The important thing to note here is that while any one of the textures is at a crest or a trough, the other two are changing rapidly. You can use any number of texture layers, as long as it's an odd number. I'll leave it as an exercise to determine why using an even number isn't helpful. The phase values for each layer should be L*360/C, where C is the count of layers and L is the layer number. When we render this out, the noise should be devoid of any noticable pattern. Here is the result, and here is the loop.

So there you have it. Now you know how to make a small sequence of apparent randomness that will actually loop for you. Watch for movies of my stargate that exploit this technique. You can apply it to clipmaps, bump maps, deformation maps - anywhere you can use a procedural texture.

UPDATE - It occurred to me that this can be done with just two layers where one has a phase of zero, and the other has a phase of 90. Any other even number of layers doesn't buy you anything (again, think this through for yourself).

ANOTHER UPDATE - There's an even easier way to do this. See my new tutorial for accomplishing this with whole volumes here.