Saturday, March 26, 2011

Booleans!

I know.  That word sounds like an expletive.

It's actually the name of a British mathematician/philosopher who came up with a system of logic to manipulate sets of numbers.  Since the "objects" we deal with in the world of 3D modeling are nothing but numbers, truth to tell, we're studying the creation of "Boolean" objects.  We're also learning to create terrain and randomize objects, like trees, in that terrain.  That was the theory, anyhow.

First, I wanted to do was a replica of Devil's Tower in Wyoming complete with trees.  This would cover 2 out of three requirements for this assignment.  I would then use Boolean shapes to create a giant spaceship a-la "Close Encounters".  Alas.  While I figured out how to make the terrain just fine, everything else proved more difficult.

This means something.



I immediately ran into a problem.  Any time I created terrain and clicked away to look at, or work with something else, that nifty window full of parameters for "Terrain" dissapeared.  In the screenshot you'll note the button for "Terrain" is grayed out.  I had to do everything with the terrain right then and there because I couldn't figure out how to get the tools back.  The books and Help files were, predictably, useless.  While the tools were available, I tried for over an hour to figure out how to add different gradations of color to different elevations.  I finally stumbled upon a setting where 3DS Max puts in default colors for you.  I was able to change these colors to something close to what I wanted.

Next, I used a cylinder and a cone to create a pine tree.  I introduced some noise into the cone to make it less uniform and added an evergreen bump map.  Probably a waste of time, since that level of detail will likely be too small to see. I grouped the trunk and cone together to make one object. Anyway, here's what it looked like.

A happy tree.

I wanted to use the scatter operation in the "Compound Objects" box.  No such luck.  You see, every instruction I read in my class notes, online, in the QuickStart guide, and in the Help files said to select your object, select "Scatter" and you're off and running.


I've circled the "Scattter" button in red just to make sure you understand my problem here, dear reader.  I was being told to use a tool that I couldn't even open.  Eventually, I did something I'm loathe to ever do for any reason.  I gave up.  At least I demonstrated that I can create terrain.  I would probably be able to put things on it, too, but I can't figure out how to use the bloody tool.

Next I decided to use Boolean operations to create a much smaller spaceship.  I drew this one at work awhile back:

It was a cute, round, chibi little fighter plane and I, correctly, guessed that it would be a good candidate for Boolean object creation.


Here you see the fuselage, in pink.  I used a "capsule" shape out of "Extended Primitives" for that.  The blue engine nacelle was a sphere that I made into an editable poly and stretched into the egg shape I needed.  I used that purple cylinder you see behind the nacelle as a sort of "cookie cutter" to open the hole in the back for the rocket nozzle.

  
It's kind of embarrassing that this took me several hours of work.  In the game industry, a little ship like that could probably be put together in less than one hour.  The wings and tail were surprisingly difficult.  I could have left the edges rectangular, but I wanted a more rounded wing shape.  The wings, tail, and stabilators required several modify commands stacked one on another.  Again, I'm sure there's a simpler way that I'll learn sometime in the future.  The sun was up by this point and I was rushing to get my "bubble fighter" textured, lit, rendered, and uploaded to my blog before class.  I didn't make it, but at least the ship was done.

For my ship I really wanted an air-superiority gray paint scheme like you see on U.S. Air Force planes.  With no time for PhotoShop work, I tried to knock something out in Painter.  Microsoft Painter, to an artist, is like having a cocktail napkin and one broken crayon to draw with.  Serviceable, but that's about it.  I then tried wrapping the new texture around the fighter.  I fought and fought but couldn't get the dark gray nose, black non-glare panel in front of the canopy, and the mottled gray back of the plane to work out right.  On the flipside, I was getting some interesting patterns that I didn't expect.  This might be useful for camo paint schemes in later projects.   I did a version of my air-superiority file with red in it to see how it would look.  One of my attempts at texturing gave me a really nifty pattern.  Sort of a Red Baron of the future.


I used the same UVW settings with the original gray colors for a less exciting, but more military look.

We're off to outer space

A picture of Earth from orbit, mapped onto a simple plane and lit with a spotlight and an omni light (to simulate reflected light from the planet) are what sells it, I think.  (Fun fact: NASA space photos are all public domain.)  Eventually, I'd like to be able to have the exact paint pattern I want with squadron markings, and lines to show panels, control surfaces, and other greebles.  As an aside, I suddenly realized that, for the image below, when I moved the ship for a better rendering angle, I forgot to move my "planet" fill light.  The underside of the ship is a little darker than it should be.  Ah, well.  Live and learn.

We're leaving Mother Earth

I stuck a couple of spotlights into the bell of each rocket engine and gave the lights a blue atmospheric effect to simulate exhaust.  With more time I might experiment with lens effects to better display the engines' power.

To save the Human race, OUR STAR BLAZERRRRRRRS!

And that's it.  My bubble fighter isn't going to win many coolness contests up against X-wings and Vipers, but for my first 3D vehicle, I think I did OK.  Now I just need a decent call-sign and my adorable little war machine and I will be ready to start our near-space patrols.

See you, space cowboy.

Saturday, March 12, 2011

Lofting assignment

I knew it was too good to be true.

After my success lathing an object, I waited until too late to try lofting.  It was a HORRIBLE experience.  One problem after another.  I started out ambitiously, by trying to loft a submarine.  It's basically just a tube with some bits sticking out of it, right?  According to 3D Studio Max, a submarine is a freaking nightmare of splines, lines, vertices, and unpredictable results.  Like so...

  

 

As you see here, my first attempt to loft a submarine with the diving planes on the sail was a disaster.  I couldn't figure out why those lines were extending from the dive planes to the hull.  The hull itself is pinched everywhere I added a shape.  After a couple of hours fiddling with this design I gave up.  I figured maybe the vertices on the splines weren't lining up properly.  I created another design with the dive planes on the front of the hull and tried to duplicate my splines in a way that the vertices would match up.  No such luck.  Before I even got to that point, though, my simple spline was acting up on me.  I had a round spline, applied it to the path, and got a diamond shape.


Another hour of frustration until I stumbled upon Shape Steps.  I tried increasing the steps and the hull rounded out.  I'd added more vertices to the first sub, so I'd not yet tried a four vertex circle.  I couldn't find the answer to my problem in the QuickStart Guide, the Help files, or online.  Once again a simple, but obscure, button halts my entire project.   How is a user supposed to learn this program with so many land mines built into it??  It took me a few more hours to wrestle out the submarine.  I created a simple color rectangle of dark gray and red for the boat's colors.  I then used an underwater photo on two planes (one in front and one behind the boat) and bluish lights to put my clumsy submarine to sea.

Still can't figure out how to round out the nose cone.




I was so angry and frustrated during this process I banged on my keyboard tray hard enough to break it.  Phooey!  By this time it was the wee hours of the morning.  I copied a YouTube tutorial on how to loft a screwdriver.  I had run out of patience by this point.  I was angry, frustrated, demoralized, and my stomach hurt from stress.  Still I got my screwdriver.  I turned the submarine color map sideways to add color to the thing.


Still ambitious, I tried to loft a katana.  This was another exercise in rage and frustration.  The first problem was the fact that I couldn't get my shapes to follow the curved spline.


I spent time trying this and that.  Nothing worked.

Curved path, straight lofted object.



I even followed another video tutorial step by step but the guy in the video got the proper results and mine still wouldn't work.  I followed him click-for-click.  Eventually, I discovered another setting, just underneath the "Shape Steps" setting from the submarine loft.  By increasing the "path steps" I got my curve.  Still, it was another fight.  I've learned to fear my weekly homework because of this sort of stuff.  I made my katana using a couple of cross section shapes for the blade.  The tip was very difficult.  I'm sure there are some tricks to make it easier, but the documentation doesn't seem to have them.   I made a slightly larger  blade cross section on a very short spline for the habaki, the brass collar at the base of the blade where it meets the handguard  (called the tsuba)

I worked the tsuba spline into shape and just extruded it.  I tried to get the cutouts in it but following carefully the instructions on booleans did absolutely no good.  The sun was coming up so I just gave up and made it a solid piece.  The handle (or tsuka) was another short lofted object.  Building this with 4 objects allowed me to put a different texture on each.  I fiddled with some lighting to get a good metallic effect on the blade.

Next I made a plane, picked a good picture of Mt. Fuji and set it up as the background for the sword.


See that gorgeous mountain?

You don't?

That's 'cause it won't render!  Remember that submarine earlier?  I got two planes to render, one at greatly lowered opacity.  This one won't render at all.  An hour of fighting with this and I can't figure out why.  It worked fine just a few hours ago.  Class is in 3 hours and I haven't slept at all.  Here are some screenshots of the plane with the bitmap of Mt. Fujiyama on it.  It looks just fine in perspective view.  I have the materials editor set to "Show Standard Map In Viewport".  It just suddenly refused to render the background plane.


If anyone can see what small setting I've gotten wrong, please let me know.

UPDATE:

I seem to be genetically incapable of just letting things go.  Some more fiddling with the problem revealed that the Mt. Fuji image was visible from the other side.  Wha...?  All it took was rotating the plane 180 degrees and it showed up in the render window.  Gee, it would've been nice to have seen that in a Help file, dontcha think?  Anyway... sword.

Tuesday, March 8, 2011

Lathing Splines

Hello, friends and classmates!

Welcome to the latest installment of 3D Modeling I assignments.  This week's episode of the steep, steep learning curve involves editable splines and lathing.  Lathing is exactly what it sounds like.  You make a line drawing, or "spline" of the profile of your object.  When you go to the Modify menu and choose "Lathe", 3DS Max spins that profile into a 360 lathed object.  Being the nerd I am, I decided to lathe out a lightsaber floating above a pedestal base.

First, I made the saber itself.  I'm sure there's a more efficient way to do it, but I used simple corner vertices.  I then converted selected vertices and converted them to "Bezier Corner" vertices so I could create the curves I wanted.  Once I had my saber I used a technique taught by Professor Ben (or is it Professor Beans, not sure) to add an array of non-lathed objects around the circumference of the lathed object.

I created the object I wanted, in this case, grips for the lightsaber.
  • Select "Hierarchy" from the Command Panel
  • Go to the top view of your lathed object
  • Set Pivot Point as close to the center of your lathed object as you can manage
  • Choose the Rotate tool from the main menu
  • Hold shift and rotate to the point where you want the second copy of your object and release
  • In the window that pops up, choose how many more copies of your object you'd like and hit "OK"
This should allow you to add jewels, architectural elements, whatever.  For my part, I created this;


I used a rough metal texture downloaded from http://www.morguefile.com by using "steel" as my search term.  The grips are a wood fence texture from 3DS Max's own Materials Library and created using the aforementioned process.  I made the activation button a separate piece.  I converted it to an editable poly, selected the center square, and used the "Extrude" modifier to push the center rectangle down.  I then made the button black but made the recessed central part red.  I then self-illuminated it in the Materials Editor.  At some point I'll probably use different splines, put together in a group to build my object  This should make it easier to assign different colors and textures to the object.  This saber is all one color, but that's fine.  I'm just a n00b.

I created a lathed object for the anti-gravity, lighted base thingee.  This time I turned down the segments to 8 so I could get an octagonal base unit.  I used the "Spline" tool to create 4 small gray elements on it.  I then created an octagonal plane to set into the center of the object.  This, I self lighted in anticipation of the lighting effect I planned to use later.

The bright white of the central octagon is due to the fact that it's self lighted.

Then I created a simple stone pedestal for everything to rest upon.  For the marble pattern of the pedestal, I actually used a sample of galvanized metal from www.morguefile.com.  It was already kinda greenish, and that worked just fine for me for a bitmap to use as a Material.  A little fiddling with the UVW settings gave me this;


I'm not sure what's up with that weird star pattern on top.  I think I may have shrink-wrapped the texture on.  It's not a big deal, since that flaw will be covered up with the base.  I created a simple plane for the floor and used the same galvanized metal texture, with a bit of Bump Mapping to create decent floor tiles.
I used a spotlight and two omnidirectional lights to illuminate the scene.  I also addded a second spotlight placed into the top portion of the column object.  The cone of light was adjusted so that it looks like the light is coming out of the black, octagonal base piece.  I added an atmospheric effect to make sure you can see the cone of light.  I *did* turn off shadows on the light from the base.  I think they would only have been distracting.







Part 2 of this assignment promises to be a doozy.  Lofting.  I'll letcha know how it goes.  Meantime, the sun's about to come up, I've been drinking rum and doing 3D artwork, and I'm tired.  A cozy bed with a cozy lady awaits me at the other end of the house.
Ciao!

Saturday, March 5, 2011

3D Modeling: Lighting

*Whew!*

This one was a challenge.  The good part is, it was easier than any of the others.  I don't know whether that's because I'm finally getting it, or because there was so much less to do.  I took the "ammo room" I textured in the previous assignment and applied lighting to it, instead of the generic "everything is magically lit" way it showed up initially.

First we had to light the room as a whole.  I decided I wanted the feel of a quiet room late in the day.  I took the overhead lamp hanging from the ceiling and made that my "spotlight".  I added a, slightly yellow-orange, omnidirectional light outside the window.

Screenshot before rendering



It took a huuuge amount of fiddling, clicking, and head-scratching to do this.  Added to this is the fact that I couldn't seem to get started.  It wasn't until late afternoon/early evening that I really managed to get settled down to work.  I only got the overhead light done before I had to leave, though.  It was my fiancee's birthday and we were meeting about 16 friends and family for dinner out.  Great study break.  After a nice dinner and dessert out I came back home and put my poor inebriated sweetie to bed.  She shooed me out of the room to finish my homework so it was back to the keyboard for me.

The outside picture doesn't look like sunset and I didn't have time to adjust it.  Pretend the sky is orange, okay?


After I did the first two lights I decided to put the third light outside the slightly opened door.  I spent what seemed like forever tweaking the settings and moving the dadgummed thing around.  I couldn't seem to get the background picture I had placed outside the door to work properly.  At some point I recalled that I'd inadvertently erased it from the Materials Editor at the end of the last class.  I went out to http://www.morguefile.com to grab another desert scene.  I quickly assigned it to the plane outside the door in a fraction of the time it took me last week.  Hmmm... maybe I am learning something.  I went to the closeup cam at the table and turned it towards the doorway.


I set the bitmap for the desert scene to self-illuminate.  This turned out to be a terrible mistake.  I suddenly couldn't see the desert outside the door when I rendered!

What the heck?!!
Just a white glow.  It didn't look that way in the viewport.  I then spent AN HOUR fiddling around with settings in the renderer trying to get my bitmap of the desert to show up the way I wanted.  Nothing I tried worked.



  I started to despair that there must be something wrong with me and maybe I'd never learn 3D Studio Max.  It's always one thing after another.  After clicking options, rendering, seeing that it didn't work, resetting and picking another option to change, I turned off the self-illumination of the desert map outside the door.  The desert picture suddenly rendered, but very dim.  I'd set some kind of background lighting setting to a salmon pinkish orangey color and that tinted everything more like a sunset.  It was kinda dimly lit but, by this point, I was done.  I punched up the specularity on the bitmap in the Materials Editor and did my final render.


You can make out a fuzzy ball of light peeking around the doorway between the door and the desert scene.  That's my omnidirectional light reflecting off the plane that the desert scene is mapped onto.  I might go back and fix that but not tonight.

Part two of this assignment was way easier.  Pick an object and give it three-point lighting.  Use a main light, or "key" light.  Add a "fill" light to bounce light around the scene.  Finally, include a "rim" light to flesh things out.  I'm still not 100% satisfied with the results.  I know that as I get better at this (if I get better) I'll be able to light things more realistically.

First I used a directional spotlight next to the camera for my key light.



I used an omnidirectional light off to the right for my fill light.  Shadows were turned off and it was given an brownish gray glow to blend with the wood of the table and the stone of the walls.



I decided to place my rim light outside the window since it was an obvious light source.  It seemed silly to pretend that it wouldn't add light to the scene.  I did use a light so pale yellow it was, pretty much, white.


The asssignment instructions said to turn off shadows for this rim light.  A rim light is normally supposed to add depth to your object without looking like there's an obvious light somewhere in the scene.  I looked at this image and decided that the bars, without shadows, just looked fake.  I tweaked some more setttings until I got some shadows to fall across the table.



I didn't get them to fall across the edge of the window like I wanted.  Perhaps adding a more directional light, shining from higher up, would accomplish that.  Anyhow, this image ends up looking a little like someone has the dynamite in the beam from a flashlight or a light mounted on the front of a helmet he or she is wearing.  The notable thing was that part two of the assignment took, maybe, a quarter of the time part one took.

After class last week one of the department tutors urged me to read the 3D Studio Max quickstart guide cover to cover before continuing on with the class.  He said that he did that and, suddenly, the high-speed lectures in class made sense.  I was trying to use the book as a reference guide and it wasn't much help.  I'm now using it as a textbook.  It's several versions behind, but reading straight through seems to be helping.  I'm only part of the way through (textbooks are pretty dry) but I will eventually finish.  If I can reach that "aha!" moment, I'll be able to create anything with this program.  Right now  3D Studio Max's interface is so user-unfriendly to me that it feels like Torquemada headed the design team.

You know.  Torquemada?

*sigh* Look it up.