Tuesday, June 16, 2009

What superhero am I?

Your results:
You are Superman
























Superman
80%
Green Lantern
65%
Iron Man
65%
Hulk
60%
Spider-Man
55%
Supergirl
55%
Wonder Woman
50%
The Flash
50%
Catwoman
50%
Batman
40%
Robin
32%
You are mild-mannered, good,
strong and you love to help others.


Click here to take the "Which Superhero are you?" quiz...

Sunday, February 08, 2009

XNA Game Project


I've been working on a demo project in XNA. This completes my content process for games. I first use my own model editor (going into beta this year) to create the geometry and animations and export a .x file. The level is built in a custom level editor tool we've written for this XNA project, and everything is pulled together in an XNA game engine.


My first goal for this phase of the project was to animate a .X model in XNA. I searched around on the web and found samples and found one that was close. I started with the skinning sample that is available for download from the XNA Creators Club. It animates a bald soldier ("dude") .FBX file. The issue with this code is that it rendered FBX files AND .X format, but it didn't do any blending between the key frames. This wasn't a problem for the sample model "dude" because it had a ton of frames, but for my animation that was only 10 or so key frames, it posed a real problem. So, I rewrote the code, preprocessor, and HLSL .fx files to properly load and animate .x files. After that, I had used some level editing code to create a height map and load my own model and have him walk around on the height map.


Here is a video of my western character running around on a test height map. It demonstrates character animation and basic height collision.


video

My next goal will be to add some objects with collision such as buildings, towers, and other objects the character can jump on. I'll also be animating a frog for an elementary school project coming up here real quick. I would love to here from anyone on ways to handle objects and areas such as a multi-floored building that the character can go into.


Happy Coding!
Jason

Friday, December 19, 2008

Hidden Text in Word

This post explains how to collapse multiple sections in a word doc.


There may come a time when you need to collapse sections of a word doc based on a checkbox. The sample form I'm using looks like this:




To create this form:

1. Create a new word doc and add a checkbox.

2. Type some text under the text box.

3. Select the area you wish to hide and add a bookmark: Insert->Bookmark. The Bookmark dialog will appear. Type "Section 1" as bookmark name and close.

4. Repeat the process two more times.



What we've done is create "Enclosing Bookmarks" around some text. There are actually two types of bookmarks. These are:

1) Placeholder Bookmarks which look like a beam.

2) Enclosing Bookmarks that will show up as graphics.

You can see these book marks by going to Tools->Options->Display Bookmarks.

(Bookmark indicators in Red)

Now for hooking up the checkboxes.
The Checkboxes need to call a function. So, first we have to write the function. The code should look like so:




Public Sub Hideit()

'unprotect the document
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect Password:=""
End If

ActiveDocument.ActiveWindow.View.ShowHiddenText = False

'Get the range of the bookmark.
Dim rng As RangeSet rng = ActiveDocument.Bookmarks("Section1").Range

If ActiveDocument.FormFields("Check1").CheckBox.Value = True Then

rng.Font.Hidden = 0
Else
rng.Font.Hidden = 1
End If

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

End Sub



Now in the Checkbox, select this function and your
done! Additional Info here: http://word.mvps.org/faqs/MacrosVBA/WorkWithBookmarks.htm

Happy Coding!

Jas

Wednesday, December 03, 2008

Line Ring Selection Algorithm

I'm thinking about adding a tool that will select a ring of lines.
Here is an example of a ring you want to select.


Okay, what I've come up so far is something pretty simple.
1. Copy the target face.
2. Check to see if the selected line is an edge.
3a. Yes, calculate all the edges that are attached to the selected edge and select. END
3b. No, remove all polys that have edges. goto 2.

This image shows how it would work on the example.


I know there are some exceptions. It seems simple enough. I'll let you know how it works.

Happy Coding!
Jas

Thursday, November 13, 2008

Character Modeling II

Picking up from the previous post, I've modeled a basic character using a billboard as a guide. See picture:

You can see the bone system residing inside of the character. For the hands I only needed the ability to move the thumb, index, and rest of fingers as a group so I used three bones.

Assigning the geometry to the bones:
In my tool I do this by selecting the desired bone. I select the geometry I want to assign to it and associate the selection tot he bone. In the following image you can see that I have part of the spine selected and I'm assigning verts to the torso.(GREEN=assigned, Yellow=assigned to another bone, BLUE= not assigned at all)

Note: In other tools, you'll be able to do this by some tool automatically, but since I haven't coded that, I alternated the model color to help in the assignment process.

After applying all the geometry to the bones, I created some test animations that ran the character through basic movments. Each joint was a different animation.

As I tested the animations, I would make adjustments to the bone assignments, applying multiple bones to influence the points. This is great in areas like the shoulders, hips, knees, and neck. You'll need to add additional geometry to improve the animations. My character jumped from 1100 polys to over 1500+ polys by the time I was done with this process.

Once the models movement looks acceptable with the test animations you're ready for texturing. (I made the mistake of texturing first and had to do it again later. Not too bad but could have saved time to wait.)

When you're finished texturing your character is ready for producing the real animations.

The picture above shows my gunslinger (Guns aren't textured yet) in his loiter pose. This guy was exported in .x format and loaded quite nicely into a demo app. Total polys (1530).

Note: I used my own editor to do this character. Let me know if you're interested in trying it out. I'm always looking for people who can give me some suggestions and feedback.

Thanks for reading and happy coding!

Jas

Monday, October 06, 2008

Character Modeling




My goal was to create a model with 1000-1500 polygons. These are the steps I followed:

1. First, I drew and scanned a finished character front and side view in standard pose. Take the time to get it as close as possible to the real thing here in pencil.

2. I took the image and billboarded it in my editor for reference and started building geometry with the same general shape.

3. Modeling: I started with a box and scaled it the size of the chest. I then worked down the torso and did the legs. Next, I worked up the neck and did the head. I then extruded out the arms on both sides, placing geometry in the proper joints to allow for animation. Doing the hands takes some time. Basically, extrude out the fingers and play with the vertices.

The head took quite some time. After adding detail to the face and moving things around I kept shrinking the head and had to readjust things at the vertex level. In your tool you probably have a way of using a select box and scaling the selections. I'm missing that tool. Doing the ears were not so bad but I had to make it look the same on both sides of the head.

4. Grouping the polygons. I went through and grouped the polygons. I'm basically associating polygons within region together for the texture mapping stage.

5. Texture mapped all the groups (faces in my editor), and sized them to a 2048 bitmap. Note, this should be done after step 6 next time. because I'll have to do it again if I change any geometry.

6. (Stopped here) Bone support: Start adding the skeleton and working on animations. Most likely in this process there will need to be some tweaking of the geometry to improve joint areas. (This version of my editor has not implement multiple weighted influences on vertices from multiple bones yet. Coming soon.)

7. Once animation is good and a few of the animation sequences are finished, the geometry is stable and the texture can be generated to the model.

8. Add additional animation sequences.

What I learned or ran into during the process:
1. I'm really needing a mirror tool, and a few other essential modeling tools.
2. I don't know how I'm going to do the gun yet. That involved attaching and detaching a bone to the animation. I'm guessing this will be handled in the engine.
3. It was way more work than I thought it would be but I can use this model as a base for later models if it works out.
4. Been playing spore and would like to add additional features to my editor that allow me to modify geometry by using the bones themselves. (Cool!)
5. I'm not sure yet if the movement (up and down, and jump height) should be coded in the animation or when rendering the animation in the engine. I'm guessing that should be handled in the engine.

Would love to hear how this process differed from your experience developing a fully animated model.

Happy 3Ding!

Jason

Monday, September 22, 2008

DirectX Mesh Loading

It's been awhile since my last post. I got a little burned out on meshes after working on the xfile format. I did recently write a little app that lets me load my walking sequence and walk the little "Jake" model around. Here's a video.
video
This is just a DirectX 8 application with a skinned .x file loaded. I'm going to create a really simple character and start playing with breaking up the animations by lower and upper body as well as moving the head where the camera is pointing. It will support jump, swing, run, walk, back up, sit, and lay. We'll see how it goes. After that I might start working on lighting a little. but, it would be neat to get more than one person moving things. My editor is comign along well. I have a short buglist and then its on to deployment code. If anyone is interested in trying it out let me know in the reply.

Happy Coding!
Jason