Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

18. May 2011

 

We 354px-Cartesian-coordinate-system.svgare all familiar with 2 dimensional Cartesian coordinates for describing positions in 2D space, often used to represent pixels on screen, but ultimately the very foundation of algebra.  The two values, x and y can be thought of to represent Left <-> Right and        Up <->Down respectively, at least when dealing with two dimensions.  But when you throw one more dimension in the mix, it gets a bit trickier.  I mean sure, coming up with Z as the label wasn’t exactly rocket science, but what does Z represent and here is where everything goes to hell!

 

 

 

See, there are two schools of thought on this subject and unfortunately both make perfect sense.  On one hand, one group views X,Y as already representing Left/Right and Up/Down on a computer display, so the most logical conclusion is that Z should represent depth.  Imagine for a second if you could reach INTO your monitor… that would be the Z coordinates.  If you have already done some 2D graphics work, X and Y are probably pretty well entrenched in your mind as representing screen position, so this probably makes a lot of sense to you.  For the record, this type of coordinate system where Z represents depth is referred to as a Y-up as Y represents the up direction.  Personally, this is the most intuitive to me.

 

 

But then there are these other types of people in the world… engineers and architects and to them X,Y are viewed in a much different context.  See instead of thinking in terms of a computer monitor in front of them, they think in terms of blueprints on a table.  With a system 300px-Z_axislike Autocad, the Z-axis is added when the blueprint is extruded in the 3rd dimension.  Think about it in terms of building a house from a floor plan, the X,Y coordinates represent the layout of everything on your floor, then Z represents the distance of things UP from the floor.  So, to a CAD person, it makes complete sense for Z to represent “UP” and Y to represent “depth” like in the figure to the right.  This obviously is referred to as Z-up.

 

 

 

 

 

Now you may be asking yourself… how exactly does this affect me?  Well, that’s an easy one… all kinds of tools work with a different axis set.  Of the 3 we use, Wings 3D is Y-up, Blender is Z-UP and Unity 3D is Y-up.  So… as you are creating your assets they spend a lot of time flipping around between programs!

 

With Wings 3D, if going directly to Unity, you are in luck, no more work has to be done.  Most of the time though, we will be going from Wings to Blender first.  Fortunately this fix is pretty easy.  When you export your model ( via the menu File->Export->Collada ), click the little box icon to bring up options.  Then make sure you select “Swap Y and Z axis” checkbox as shown in the picture below, then OK and export.  This setting is “sticky” so you should only have to choose it once.

UntitledSetting Wings 3D to export Z-up friendly

 

 

 

 

 

 

 

 

Now in Blender things get a bit trickier and therefore it’s really easy.  Frankly, there is nothing you can do.  The axis system is fixed so you can’t change that, and there are no options when exporting.  I suppose you could model everything rotated but that would add a great deal of confusion.

 

 

So that leads us to Unity, currently the importer (version 2.57b ) is working properly, so thankfully you *shouldn’t* have to do anything, it automatically rotates it for you.  That said, this importer isn’t always the most… stable thing.  In cases where it doesn’t import correctly, you have one of two options.  First you can rotate manually 90 degrees about the X axis when you create an asset in Unity.  Otherwise, you can perform the conversion as part of the import process by creating an AssetPostProcessor which is a script run during the importation process, allowing you to make last second alterations.

 

 

 

For the record, this isn’t only a Blender/Unity problem, Max, Maya and Softimage are all Z-Up modelers by default, while I believe Cinema 4D is Y-up.  It is something to be aware of when moving from one application to the next. If it seems like your model is doing a backflip, the axis difference is most likely the cause.

Art , , ,

14. May 2011

Here you can follow the process of creating a game from the very beginning to the very end. I will be posting to this site as I progress on my game. In a nutshell, that means you can learn as I learn, letting me make the mistakes for you!

 

What you need to know? I will aim to keep things as simple as possible and documented as thoroughly as possible. That said, some knowledge is beyond the scope of this site. Basic programming skill is a must. Most of the code will be in C#, but if you have experience in any modern language, you should be able to follow along. Finally, moderate computing skills will be assumed. If however I don’t explain something sufficiently, leave a comment or shoot me an email and I will try to clarify.

 

Another major goal is to show you how to make a commercial quality game, cheaply. Tools like 3D Studio and Maya are wonderful, but frankly they cost several thousand dollars per seat. Therefore, while I will address all of these packages, I will also present ( and favor) cheaper/free alternatives whenever possible.

 

Finally I will make all assets and source code available as it is created. The source code you are free to do with as you wish. The assets, you are free to do whatever non-commercial action you wish. In the end, I will be publishing the game we create and I don’t want to directly compete with me-too versions of my own hard work, I hope you understand.

General

13. May 2011

 

I just finished publishing an introductory tutorial about using Wings 3D.  It covers the basics like navigating the UI, common translations then illustrates many of the features like loop cutting and mirroring, extruding, cutting holes, beveling edges, bridging, etc.  I hope it is a useful introduction to those of you that are new to Wing.  It really is a powerful program and it is worth the time to check it out!

 

In all honesty though, I don’t really like how the tutorial turned out.  It is functional enough which is why I am publishing it, but the combination of software and techniques used proved to be much more time consuming than expected and the results where also less than expected.  I am embracing a different technique for future video’s and I already like the results. 

I have hosted the video on Youtube, but for those that prefer, the video is also available on Vimeo.

 

Please let me know if you have any comments, questions or suggestions for future videos.

 

Intro to Wings 3D

 

[This space intentionally left blank, except the text of course]

Art ,

11. May 2011

 

So I finally got around to moving from 2.56 –> 2.57 and apparently it some API changes seem to have broken the Unity importing.  In my case, once saving the .blend file to my assets directory I get an error message of “Blender could not convert the .blend file to FBX file”. The solution was found on the Unity forums in the post by user Woodn.  For simplicities sake and due to the importance of this fix, I will repost it here.  Again, all credit goes to woodn for compiling this fix, and to alewinn and jorrit.  Thanks!

 

Ok, collecting all infos until unity is updated officially:
Credits go to jorrit and Alewinn!
Mac:
- Get Blender 2.57a from blender.org or a recent build from graphicall.org and unzip it somewhere. Assign blend files to open with the just downloaded blender.app.
- Browse to the Unity folder and right-click "Unity.app" and select " Show Package content". Then browse to the folder Contents/Tools/ and backup "Unity-BlenderToFBX.py". Then replace it with the one in the attached zip file or change the lines described by alewinn a few posts above yourself.
- Done.

 


Win:
- Get Blender 2.57a from blender.org or a recent build from graphicall.org and unzip it somewhere. If you use a zip package, make sure you register the blender.exe by executing "blender.exe -r" in a cmd prompt or with a shortcut. If you use the installer, you don't need to do this.
- Browse to the C:\Program Files (x86)\Unity\Editor\Data\Tools folder and backup "Unity-BlenderToFBX.py". Then Replace it with the one in the attached zip file or change the lines described by alewinn a few posts above yourself.
- Done.

 

Once I replaced the .py script and restarted Unity, everything worked normally again.

File attached below.

Unity-BlenderToFBX.zip (903.00 bytes)

Art , ,

11. May 2011

 

After just completing a list of 3D Apps for this site, I just came to a pair of realizations.  First off, the demo is all but a requirement these days.  Second, and this is the point most missed it seems, but these days integration with other suites is perhaps the most important feature. Therefore, if your application’s demo doesn’t support saving, importing and exporting, testing it’s ability to slot into your pipeline is almost impossible.

To use an example, if I want to test how well Cheetah3D works with Unity, I simply cannot.  Given the horrifying number of problems and artifacts that occur when moving from various programs to programs, this is extremely important information as part of my evaluation process.

Art

Month List

Popular Comments