This blog contains the scripts for my Blender 3D YouTube videos. They're published as follows:
Buy The Blender 3D Cookbook as a book!
Buy the Blender 3D Cookbook for your iPad!
Buy the Blender 3D Cookbook for your Kindle!
Showing posts with label game. Show all posts
Showing posts with label game. Show all posts
Thursday, October 15, 2009
2.49 UV Unwrapping
Hi. The purpose of this tutorial is to show how to unwrap a globe into two hemispheres. This tutorial is based on the UV Map Basics Tutorial, in the Blender 3D: Noob To Pro wikibook. The URL is in the Youtube notes, as well as at blender3dvideos.blogspot.com, the Web site for my tutorials.
Why do we need this tutorial? The reason: UV Mapping was introduced way back in Blender 2.34 and has been extensively rewritten since then. The user interface, and many terms, have changed over time. As examples, UV Face Select mode disappeared in Blender 2.46, and the term LSCM (Least Squares Conformal Mapping) was used up until then. Now LSCM is simply called Unwrap. Many unwrapping tutorials were based on earlier versions. If you try to follow along in the current version, 2.49b, you can get confused. Hopefully, this video will help to show the steps to successful UV Unwrapping in the version most of us use.
So let's get started. Here's the default scene in Blender 2.49b. Delete the default cube (right click, then press X and confirm the delete). Add an icosphere (Space-Add-Mesh-Icosphere), accepting the default of 2 subdivisions. Scale it 3 times (S 3) to make a large globe. Let's smooth the globe out. From the Editing buttons (F9), press Set Smooth. Then add a subsurf modifier at level 2.
Split the 3d viewport horizontally, by clicking on the border, right click, select Split, positioning the vertical line to where the split should be, and pressing Enter. Make the left window a UV /Image Editor window.
Click on the border of the User Preferences window and drag down to show the user preferences. Click View Name so we can see the view name (Top Ortho). Then click on the border and drag up to free up the area for the 3D view.
Tab into edit mode, and press the A key to deselect all vertices. We're going to make a seam for the UV editor to split the sphere in two parts. To do that, press Num3 to go into side view (right ortho). We're going to box select the vertices at the equator so that when the sphere is unwrapped, the UV unwrap program will know how to split the sphere. So box select (Bkey) the vertices at the equator and press Enter. Press Ctrl-E, which brings up the Edge Specials menu, and select Mark Seam.
Press the A key to deselect the seam and the A key again to select all vertices. Press the U key, which brings up the UV Calculation menu. Select Unwrap. This is actually LSCM Unwrap masquerading under a simpler name. There are many other ways to UV unwrap an object, as you can see. The sphere is unwrapped in the UV/Image Editor window.
The easiest way to actually place the image onto the sphere is to export the unwrapping map to an image editor, such as Photoshop or the Gimp. I use the Gimp, but Photoshop will work just as well. To do this, from the UVs menu item, select Scripts, and choose Save UV Face Layout. Accept the default of 512 x 512 pixel map, which is perfect both for non Game and Game use in Blender, and save the file (it's a Targa image file) in your project directory.
Now open up the Gimp. Here are the steps I found that seemed to work well. First, open up the saved file we just created. Then open up the image to apply to the sphere. You can download the globe hemisphere image, BlueMarble 2001-2002.jpg from the UV tutorial wiki page. Go to the targa file first and find the diameter of the spheres that we need to fit the image to. The diameter is 270 pixels.
Switch to the BlueMarble jpg, the one containing the two globes. Choose the Ellipse Select tool and turn on the Fixed Aspect Ratio check box to make sure that we will do a circle select. Select the left globe. Copy (Control-C) the globe to the clipboard. Switch to the reference file. From the Edit Menu, select Paste As, and choose New Layer. Press Enter to confirm. Click on the Move tool (the one with the cross hairs) and move the globe to the center of the top series of triangles.
From the Layer menu, select Scale. Enter 272. I like to go a pixel a two more than the actual diameter to make sure we don't get any background artifacts included. Press Scale and position the expanded globe over the layout if necessary.
Now go back to the bluemarble jpg and choose the Circle Select tool. First Select None, to deselect the left globe. This time, circle select the right globe. Copy (Control-C) the globe to the clipboard. Switch to the reference file. From the Edit Menu, select Paste As, and choose New Layer. Choose the Move tool and move the globe to the center of the bottom set of triangles. From the Layer Menu, choose Scale, and scale the globe to 272 pixels as well.
Press Control-L to bring up the Layers menu. There are 3 layers, the original reference image and the two globe layers. Deselect the original reference image by clicking on the eye. Close the Layers menu. We now can save our file - we'll make it a jpeg - which will be just the two hemispheres. We'll call it FinalGlobe.jpg. Accept the Flatten Image dialog because that's what we want. Click on Export and accept the defaults.
Now go back to Blender. From the Image menu, open the FinalGlobe jpg. You might need to make some last minute tweaks to eliminate some dark background artifacts. Press the Shading buttons (F5). Add a new material. Click the TexFace button to tell the renderer to use the Unwrapped UVs. Press F12 to render. From here, you might need to add a lamp. If you go into Texture mode you can see the image on the sphere.
That's it. I hope this gives you the basics of UV unwrapping a globe image and gives you some ideas for its use. If you want to create games and need images, this is essential because Blender's game engine requires UV textured images. Happy blending.
Tuesday, September 22, 2009
2.5 Pivot Points
Hi. The goal of this video is to get you comfortable moving around in Blender 2.5. If you're going to continue with Blender, 2.5 will be your new home. The developers just made 2.5 the official "trunk" for Blender development. That means that future development will be exclusively in 2.5. Work on older versions will, most likely, be limited to bug fixes and, as 2.5 becomes the standard.
Scaling and rotating objects are a fundamental Blender skill. The pivot point defines how objects will be rotated and scaled. If you're relatively new to Blender, you can easily get objects moving in ways you might not expect. As we progress, I will point out differences between Blender 2.5 and the older versions. The pivoting actions really haven't changed in 2.5. However, some cosmetic things like the default color of the active object and the icons for rotation and scaling, have changed. You should feel very comfortable pivoting your way in 2.5 almost immediately.
We start with the default Blender scene. First, we delete the default cube. Before, you could either use the delete key or press X. In 2.5, only X works. The delete key does nothing. So press X and confirm the delete.
We'll add the monkey object, by pressing the SPACE key. Something happens, but it's not what you expect. You get a different menu than before, a menu that has nothing to do with adding objects. Press ESC. We'll save discussion of that menu for another time. Instead, press Shift-A, which is the keyboard shortcut for adding objects. Shift-A brings up the familiar object add menu. Select Add-Mesh-Monkey, as before.
Let's look at the outliner window, in the upper right corner of the screen, and scroll down. Guess what? Suzanne isn't there. She has been renamed "Mesh". I guess they'll have to rename the Suzanne Award.
We'll create 3 monkey objects to demonstrate rotation. First, duplicate our monkey - it will take a bit of time getting used to the name "Mesh" - with Shift-D. Shift-D works as before. We grab the copy and move it away from the original, and left click to confirm. Then we press Shift-D to create another copy and drag it to form a triangle of monkeys.
Switch to Quad View, a new built in view, by going to the View menu, and selecting Toggle Quad View. The window is divided into 4 windows, Top, Front, Right, and Camera, that make it, in my opinion, much easier to navigate around your scene than before. Since Toggle Quad View is a toggle, by selecting Toggle Quad View again, you get back to the startup scene, with just one 3D window.
We'll work in Quad View. Adjust the monkeys positions so that they look right in Top View and Camera View. We'll work in Top View. Select the first monkey with right click. Then hold down the Shift key, Right Click, and select the second monkey. Hold down the Shift key, Right click, and select the third monkey. Note that the default color for the selected object and the active object - the last one you selected, and the name that displays in the lower left hand corner - has changed from pink to orange. I think orange is much easier to see. The active object has a light orange border, as opposed the light pink in the older Blender versions.
The default pivot mode is Bounding Box center, which means that the pivot point is defined by the bounding box. The Move Object Centers Only is off by default, as before. Press the R key to rotate the monkeys. Note that the rotation icon is double arrows, and that the monkeys rotate around the bounding box center. Pressing Escape cancels the rotation, as before.
Just for fun, press the R key twice (R and R). This allows you to rotate in 3 dimensions. It's a neat feature and not very well known. Press Esc to cancel.
Turn the Move Object Centers button on. This makes rotation and scaling affect the object center only, not the objects themselves. Now press the R key and rotate. The monkeys do not tilt as they rotate. Press Esc to cancel the rotation, and turn off the Move Object Centers Only button.
Now press S to scale. With the Move Object Centers Only button inactive, all the monkeys grow or shrink. Press Esc to cancel the scaling. Now turn on the Move Object Centers Only button and press the S key. Now, the monkeys don't grow or shrink, BUT they do get nearer or farther away from each other while preserving their relative position. This is useful for repositioning objects in your scene. Press Esc and turn off the Move Object Centers Only button.
Now open the Pivot Menu and select Active Object as your pivot point. Press R to rotate. Now the monkeys tilt while they rotate around the active object, similar to the bounding box behavior. Press Escape to cancel.
Turn on the Move Object Centers Only button and press the R key. Now the monkeys keep facing forward as they rotate around the active object. Press Esc to cancel the rotation, and turn off Move Object Centers Only.
Press the S key to scale. The monkeys grow and shrink. Press ESC to cancel the scaling. Turn on the Move Object Centers Only button and press the S key. Now the monkeys move away from or closer to each other but do not grow or shrink. Press ESC to cancel. Turn off the Move Object Centers Only button.
Open up the Pivot Menu and select Individual Centers as your pivot point. Press R to rotate. Each monkey rotates around its center point. Press Esc and turn on the Move Object Centers button. Now when you press R to rotate, nothing happens. That's because only the centers (all 3 of them) rotate. The monkeys don't do anything. Press Esc to cancel.
Turn off the Move Object Centers button and press S to scale. Now the monkeys grow and shrink in unison, like a dance line. Press Esc to cancel and turn on the Move Object Centers button. Again, the monkeys don't do anything because only the centers scale, and each of them is only a point to begin with. Press Esc to cancel and turn off the Move Object Centers button.
Open up the Pivot Menu and select 3D Cursor as your pivot point. The behavior of rotation and scaling is the same as for Bounding Box and Active Object, except that the pivot is around wherever the 3D cursor is situated.
Our final pivot point type, Median Point, is the center point for all the selected objects. This is similar to Bounding Box center, except that the median point might be, and usually is, different from the bounding box center because objects tend to have different sizes. As you see, the behavior is similar, but the pivot point is slightly different.
To summarize, pivoting is basically the same as before. However, because of the new Quad View, the better choice of colors and icons, and the improved design of the startup screen, it's much easier to see what's going on.
Wednesday, September 16, 2009
2.5 User Preferences
I ran the pre-alpha version of Blender 2.5, as of September 15, 2009. You see the startup screen first, then I switch to the User Preferences window. After that, I hover over each menu item long enough for the tooltip to display. If there is a menu choice, I click to display all the choices. Remember, this is pre-alpha software. No guarantees that each and every feature will make it into the final 2.5 release, but this should give you an idea about what the developers goals are. I apologize if you're not a speed reader. You might want to pause the video often, read the tooltips you're interested in, and continue.
Tuesday, September 15, 2009
2.5 Sneak Preview
I played around with a recent build (878-361, to be exact) of Blender 2.5. Blender 2.5 is a major rewrite of Blender which, in my opinion, makes Blender's great user interface and experience even greater. I'd like to give you a quick tour of the startup windows and the menus, to give you a sneak peek at Blender's makeover. Blender's new look is very exciting.
Please remember that we're looking at 2.5 in its embryonic stage. It's not even in its pre-release stage. Not all the features we see may make it into the final release. However, there's enough to explore so that we can get a general idea of what 2.5 will ultimately look like. I'm not going to try to build anything, or see whether any of the menu choices work. I just want to give you a quick peek of 2.5, under the hood.
So let's get started.
Here's the Blender 2.5 startup screen. Right off the bat, you'll notice a few changes. First, the Buttons Window is gone, replaced by the Timeline. Second, the 3D Viewport, defaults to a User Perspective view, as opposed to Top View in earlier versions. In the 2.5 view, you actually can see the cube as a cube, aligned along the grid.
Some things are the same. We still have the same 3 default object, the camera, the lamp, and the default cube. You can verify that because a small outline view window is in the upper right corner of the screen. Scrolling down will show you that the three objects are indeed in the scene.
Look at the User Preferences menu, which has changed somewhat. Gone are the Timeline and the Game menus. We have 4 menu items, File, Add, Render, and Help. So is the dropdown with the 5 default screen styles. This is replaced by a menu with the default Screen, called, appropriately, Screen. You can create your custom screens by pressing the + key, which adds a screen named Screen.001. You can delete the Screen by pressing the X key right next to it.
The default scene is called Scene, as in 2.4x Blender versions. You can click on the + button to add a scene - a change from selecting Add New.
A new menu lets you select among different rendering engines. The default, as it was before, is Blender's internal renderer. You now can select Blender Game, Povray, or install another renderer, which should (I'm only speculating) make the Engine menu item selectable.
A new "jobs timer" has been added.
The information about vertices, faces, objects, layers, memory, and so on, has not changed.
I mentioned the small outliner window earlier. You can use the scroll bar or press Ctrl - down arrow (as before) to toggle this window (or any window, for that matter) .
The panel at the lower right contains a number of menus. These menus change depending on the context you're in. The default is the scene panel, which has the buttons you need that are relevant to rendering the current scene.
These used to be part of the World buttons. If you click on the All Scenes dropdown, these buttons can apply to other collections of scenes and other data.
The menus are collapsable. Press the arrow to expand or contract. You can get full expansion or full contraction. Fully collapsed into groups, the scene groups are: Render, Layers, Dimensions, Anti Aliasing, Shading, Output, Performance, Post Processing, Stamp, and Units. The groupings have changed from the old World settngs. Look at Output, for example.
At the bottom is a group of icons that let you toggle among different button settings. The default is the camera icon, for the scene. Next is World, which has the menu choices that are more global - Preview, World, Ambient Occlusion, Mist, and Stars.
The Object buttons are Transform, Relations, Groups, Display, Duplication, and Animation. Note that the default name of the cube, which is selected by default, is NameCube - no doubt, to encourage you to actually name your objects - a good habit to get into. These buttons control aspects of the selected object. Look at Transform, which controls location, rotation, and scale. Note that X, Y, and Z are assumed, so LocX, LocY and LocZ labels are gone.
Next are Constraints. From the dropdown, you can add the constraints shown.
Next are the Object Data buttons, grouped into Normals, Vertex Groups, Shape Keys, UV Texture, and Vertex Colors.
Next are the Modifiers. The modifiers are grouped into an easy to read 3 column list.
Next to last are the Material buttons, with the groups you see.
Finally, there are the Texture buttons.
Each window has, at its lower left corner, a menu from where you can change its type. We'll go to the Timeline window, which currently has its menu bar displayed, and click on its window type icon. A few changes, right off the top: the Scripts Window has been renamed Console, User Preferences has been renamed Info, and the Action Editor has been renamed Dopesheet. I'm sure there are other changes.
I hope you enjoyed our sneak preview of Blender 2.5. It looks like the best is only going to get better. So happy Blending and see you next time.
Subscribe to:
Posts (Atom)