Sunday, March 04, 2007

3D On The Cheap: You Say You Want A Revolution?

When I was a young musician, I owned a 1966 VW Microbus just like my hero, Arlo Guthrie. As with most trends, a practical reason drove the adoption of cheap technologies: a '66 VW bus had gears on the wheels that enabled a 40hp engine to push a heavy load a long ways reliably. It wasn't fast off the line but it was very cheap. For the young musician starting out, a van that hauled equipment, a bass player and two girls we picked up at the last gig to the next gig, that was a miracle of modern technology and the market.

Today I have less hair, the same bass player, and I married a girl that rode in that Microbus; so, regardless of the zeitgeist, a good affordable technology goes a long way toward getting you to the first gig and the last. My philosophy of cheap powerful tools has not changed; only the gig. I make 3D worlds.

Courtesy of Tony Parisi and Keith Victor and Media Machines, there is a cheap 3D editor that can do what that VW microbus could do: get you to the gig on time and under budget. In fact, unlike that bus which cost me $250 in 1973 dollars, this 3D is editor is FREE!

Yes, go to Media Machines and download your own copy compliments of the VRML/X3D community that has its roots in the early days of the web that had its roots in the early days of Free Beer world that had its roots in the Summer of Love. Make of that what you will, you can't haggle with a free lunch, and yes, they do exist. So let's take this buggy out to a gig.

Today, we are making pots. No, not the Gaz-Giz kind, but the kind you put in your new virtual apartment. You have one of those, yes? Everyone who is anyone does. Geez…

To do this, we use a feature sometimes called by graphics geeks, the Surface of Revolution. It sounds cool and it is. I don't understand a lot of graphicsGeekSpeak and you probably don't either, so say, Amen and move on. Think of the Surface of Revolution as a potter's wheel or a lathe. When the object is turned, it takes the shape where ever you are pressing on the clay or the cutting blade touches the wood or metal. In Virtual Reality, all of this is virtual. Makes sense, yes? You place points to create a line that describes the outline of one side of the pot, press the Show Me button, and the computer makes the shape. It doesn't get easier than that. Or cheaper.

If you have downloaded and installed the Flux Studio 2.0 editor, open it. On the left are the windows that display what you build. Think of these as your scribing surface, drawing panel, back-of-an-IHOP-napkin. These are where objects are displayed. Parallel and on the upper right is a Treeview control that enables you to select objects by their name and position them in the scene relative to other objects. Below that is the dialog that displays the properties of these objects. Of you select an object in the Treeview, the dialog below will show you its adjustable properties. These are displayed as tabs.

At the top are drop down menus. There are icons beneath and around the borders for different construction techniques. Click on the Create menu.

In the figure above, you see the drop down Create menu. Click the Create Revolution menu item. Take a moment to enjoy that thought.

A pair of small windows pop up on the screen. The one on the left is a drawing pane. Here is where you place, move, add and delete the points of the line that is a silhouette of the shape of your revolution. If you have a copy of the Jefferson Airplane "Volunteers", now is a good time to put it on. On the left of the screen in the Treeview, notice the small vase-like icon with the label "Revolution: Revolution1". The label is duplicated in the dialog "General Node Parameters" below.

The window to the left of the drawing pane is the control window for creating revolutions. As labeled below, you see that each button changes what the cursor does when you click in the drawing pane.

Surface of Revolution Control Panel

  • Insert point: adds a point
  • Add to end: the main control that adds points to either end of the line.
  • Move point: click on a point and pull it to the position desired.
  • Delete point: enuff said
  • Close points: this creates a closed shape.
  • Show grid: turns the grid on and off.
  • Snap to grid: forces entered points to be on a grid line.
  • Update: actually the "Update Solid and Close Window" command. Geeky. This is the command to create the revolution and close the two windows. It looks like an OK hand gesture. A V for Victory might have been more Revolutionary but Ok is Ok.

    Want a revolution? Got the revolution!

    Play with these. Enter some points, make some lines, pull them, delete them, have fun. Notice that the shape can be made smoother or jagged by adding and deleting points. If you push them out, you get ridges. If you push them in, you get a groovier pot. Enjoy the moment.

    Hint: the line should close on the diagonals on the left if you want the shape to be symmetrical and close at the top or bottom. If you want the top or bottom to be open, don't push the points to the line. After you make one or two, you'll get the idea. This is very easy stuff but the results are spectacular.

    There is your line. It looks like the alien that came to Serve Man in the Twilight Zone.

    Select the Update/Ok/ShowMeShapesOfThingsToCome icon. Whew! You've made a short squat top. Ok, that is a backwards pot. What can you expect from a dyslexic?

    Notice the lines around the shape. These are the vertices that make up the shape. Vertices create faces. Each area in the lines is an individual face. Look at the dialog on the left. You can change the number of faces that make up the shape by adding or subtracting from the # of Sides property on the Shape tab (the icon that looks like a pot). A higher number creates more faces and a smoother shape. A smooth surface looks good, but the more faces you add, the slower the animation. In any world with a single object, you can make a perfect rendering but as the world gets more objects, the world slows down noticeably. Be prudent when building these one at a time with an eye toward putting them into a more complex world later.

    At the bottom is a button labeled, "Edit Cross Section". If you click on this, you will re-open the drawing and control windows. Try it. This lets you look at the shape, then go back and edit it some more. Computers are way better than potter's wheel and lathes in this respect. You don't have to throw mistakes away.

    The window with the shape is divided into four different views: top, front, right and ISO. Where is left? Don't ask. The Man might be listening. If you have a mouse with a thumbwheel, when a view is selected, you can use the wheel to bring the shape closer or further away. This is very handy for doing detail work on an object..

    Click inside the Front View. Note that the lines go away and you can see your shape. Note also that the properties tab goes away. Not to worry. If you click on the vase with the label Revolution 1 in the TreeView, the properties dialog reappears.

    If you don't like the size, you can change it by changing the scale. One way to do that is to select the scale command from a menu that you don't see. Right click in the Surface edit window and a floating dialog appears. It duplicates commands on the other menus and adds more. If you want to scale the top, select the Mirror/Scale/Rot (rotation) menu item.

    Scaling is pretty obvious, but there is one beyond cool into marvelous feature there. Let's take a little side trip in our magic bus: notice the modest self-effacing Background Image menu item. Select it. This opens a dialog like the one you will use to paint the top as explained below.

    When you select an image here, it is loaded into the Surface of Revolution drawing window so that you can use it to trace points on a complex image. Now that is just simply hot. I used an image my friends may remember from my past VRML work. It is the symbol of a certain very hot British songstress. Never will meet her; never will forget her. Kate rules.

    Play with the other options as you have time. Remember you have a help file if you need to decrypt the geek speak.

    At this point, you may want to look at the shape in 3D space instead of in the three views. At the top of the Flux window third row, second from the left is an icon that looks like a Windows window with a cube in it. Note I said, top, not the left side where there is also a Cube. That is for making cubes, not looking at them. Droplets optional.

    Click on the Top cube. This will open the Flux Studio preview window.

    There is your top in all its 3D glory. Pretty cool stuff. Notice the controls along the bottom. These enable you to move the shape around in the preview window as well as take screen snaps. This preview window is a window in the editor. Your editing commands are still on the dropdown at the top. Click on the button on the far left at the bottom with the X inside it. This will close the preview window and return you to the editor.

    If you wanted a red top, you have one. On the other hand, virtual reality is psychedelic stuff and painted tops are way more psychedelic. In olden daze, we would whip out some dayglo paints so we could spin it over and over and over looking at colors whirling around and say, "Wow! Man!"

    These days we can do much better than that. We can plaster pictures right on that surface with the click of a button. Click on the TreeView icon Revolution1 as before to open the properties window. Select the tab for the single texture as shown in the figure below.

    Look at the properties dialog. There is a text entry box with a folder button to the right. This is for finding and loading a texture from a directory on your computer. Hint: it pays to collect textures from everywhere legal that you can get them and keep them. Cut up photos. Any spot on a photo that is reasonably flat facing you is a good candidate. Even if it is slightly skewed, you can use PhotoShop or even lowly Paint Brush skew commands to bring it back close to square. Making textures is a good hobby and it fills the time waiting for Battlestar Galactica to return.

    Notice that the dialog also lets you use movie textures such as animated gifs or even, those movies you are hiding from your kids. If you want a spinning top with Auntie Grizelda picking you up as a baby or an animation of geeks playing leap frog, have at. This is your world. No one can tell you what to do here. Way better than dayglo.

    Click on the folder icon. This will open a File Dialog for finding and opening images. Note that it also optionally will display thumbnails of the images in any directory you open. This is handy, but since thumbnails aren't always large enough to see what they really are, any image you select is automatically opened in a larger preview window. This is very very cool.

    For my version of the top, I've selected a free stock photo of a wild rose. I'm an aging flower child. Sue me.

    Hit the open button and the texture is automatically applied to the shape in the drawing pane. That's it. Not a single geeky graphics chore in the lot.

    But you may want to adjust it. Images are sometimes too large, too small, or upside down, or sideways. Not to worry. If you look back at texture properties window, you will see Drag options. Having Drag options is one of the most spiritual choices aging flower children and some nightclubs could ever dream of.

    Select the Drag To Scale if it is not selected, then put your cursor on the shape in the drawing pane. Move it up and down or left and right. Notice the image on the shape gets bigger and smaller, or multiplies. This allows you to set the texture sizes and positions to your tastes. You can also enter values into the text boxes.

    When you have more time, play around with the Multi-texture features. This lets you use multiple textures on the same shape not as additional pictures, but as a composite that changes the appearance by making it more luminous…. Eyurp… shinier, or gives it bumps like fabric by combining the textures in special geeky ways. You can waste many weekends playing with this feature.

    The next to last step is to look at your master work in a real 3D viewer. Flux Studio comes bundled with Flux, an X3D/VRML viewer. When you select the button at the top left of the Flux Studio window, the one that has X3D in stoned looking letters (who makes this stuff up?), the shape automatically opens up in the Flux viewers. Play with the controls to fly around it, rotate/examine it. Welcome to Virtual Reality!

    You want to save the top. Select the File command at the top far left. You can save your file as:

  • A Flux file. The editor internal format that enables it to be reloaded without importing it.
  • An X3D file. This is the new version of VRML97. It has two syntax options: the classic curly syntax or XML. X3D has more features than VRML97 and improved modeling fidelity. Spend some time on the web lists learning about these.
    VRML97: the original Virtual Reality Modeling Language (version 2) still in wide use today.
  • Compressed or uncompressed: the file can be saved as a gzip file for better life as a good netizen (say smaller and faster). Or if you like to hack inside the language itself, save it out as uncompressed and you can open it in PFE (Professional File Editor) for VRML or any of the amazing XML editors. Making objects in Flux Studio then studying the uncompressed file is a good way to learn the language.

    This is a vase I made with Flux Studio for a temple in the River of Life VRML/X3D Virtual Reality world. My wife wants one these for her real world knick knack shelves. This proves the online world and the real world are not only blurring, they are feeding on the same karma which is ultimately, the same thing. Very zen.

    The image on the vase is from a real Hindu temple wall panel.

    In the old days, I would have stashed combustible comestibles in this. Today, I'd keep it for my cremation remains.

    Ashes to ashes... bus to dust.

  • Comment Policy

    If you don't sign it, I won't post it. To quote an ancient source: "All your private property is target for your enemy. And your enemy is me."