Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon
22. October 2013

 

Hot on the heels of their 100,000$ contest announcement the guys at Project Anarchy have another major announcement.  The latest update to Project Anarchy now includes Scaleform… for free!

 

SAN FRANCISCO – October  22, 2013 –Havok™, a leading provider of 3D game development technology, announces today that it has integrated the full version of Autodesk® Scaleform® software into Project Anarchy, Havok’s completely free end-to-end mobile 3D game production engine. The addition of Autodesk’s industry leading UI solution to Project Anarchy complements Havok’s Vision Engine, Physics, Animation and AI technologies and offers developers a complete solution for faster, more efficient game development.  Games built using Project Anarchy can be deployed for free on iOS, Android and Tizen mobile platforms without commercial restrictions on company size or revenue. The latest version of Project Anarchy, which now includes Scaleform is available for download now at www.projectanarchy.com/download.


Autodesk Scaleform has helped game developers create immersive UI for over 1,500 game titles. Leveraging the power of the Adobe Flash toolset, Scaleform provides streamlined, artist-driven workflows that help developers create 3D game menus, HUDs, animated textures, in-game videos and mini-games more quickly.


“Project Anarchy was created to give mobile developers a complete solution for all aspects of the game development process, and Scaleform is the perfect addition to round out that package,” said Ross O’Dwyer, Head of Developer Relations at Havok. “We have an incredibly active community and their feedback is really important to us. We saw demand for an improved UI system and we’re happy to be able to deliver it and further empower our developers with the strength of the Scaleform toolset.”


“Scaleform provides a robust solution that allows developers to rapidly create high production value user interfaces for a wide range of game genres.  Coupled with the comprehensive Project Anarchy toolset, developers are empowered to design innovative user interfaces seamlessly across many platforms,” said Marc Bennett, Director Interactive Display Solutions, Autodesk Media & Entertainment. “The Scaleform toolset and the robust functionality offered by Project Anarchy allow developers to give their mobile titles a level of polish usually reserved for big-budget console games.”    
Project Anarchy includes Havok’s Vision Engine together with access to Havok’s industry-leading suite of Physics, Animation and AI tools as used in cutting-edge franchises such as Skyrim™, Halo, Assassin’s Creed®, and Uncharted. With features like an extensible C++ architecture, a flexible asset management system, Lua debugging, customizable game samples and tutorials, and a full fmod® integration for audio, Project Anarchy offers game developers the ability to quickly iterate on their ideas and create incredible gaming experiences.


For further information on Project Anarchy, developers can visit www.projectanarchy.com and www.havok.com. More information on Scaleform can be found at: http://gameware.autodesk.com/scaleform  

 

You can read the official announcement here.  If you’ve never heard of Scaleform it’s basically a striped down game oriented version of Flash intended to be embedded in games.  Tons of AAA games use Scaleform for their UI layer ( Crysis, Deus Ex, Witcher 2, etc ).  Scaleform is also available for Unity as a plugin, but in the case there is a 300$ price tag attached!  Scaleform is also available for the UDK although I am unsure of the licensing conditions.

 

So, if you are looking for a cross platform mobile 3D engine, Project Anarchy just got a great deal more attractive.  Oh yeah, in case you didn’t know, GameFromScratch does have a series of tutorials available! If you just want an overview of what Project Anarchy actually is, start here.

News


1. September 2013

 

One of the oldest and most popular articles on my site is I want to be a game developer… now what?  It offers a collection of advice for new game developers.  I keep intending to update it but frankly, not enough changed.  The following was recently posted on GameDev.net:

 

https://www.gamefromscratch.com/post/2011/08/04/I-want-to-be-a-game-developer.aspx
This article was written 2 years ago, and is very informative about each game development language, but 2 years sounds like too much for how events quickly change now, XNA is partially dead, more books released, etc..

Is there a newer article of that kind of information? and is C++ still a bad choice (with the introduction of SFML 2.1 and SDL 2)?

 

Which got me to thinking about what all has changed since I wrote that guide.  The following was my answer.  Of course, I have no idea how many thousands of things I forgot to mention.  All told, the world hasn’t changed all that much, languages don’t really move all that fast.

 

Truth is, I keep meaning to update it, then look at the state of the game development world and there hasn't really been enough changes.  I will be doing a v2 eventually, but in summary, here is what's changed since the article was written:

C++

-----------------------------------------------------------------------------

SFML 2/2.1 released.  Frankly it's not all that different.

SDL 2 was released.  Again, not massive changes.

Gameplay3D engine released  Site Link My Look

Hands down the biggest change to C++ ( and over the last two years ) was the release of C++11.  This completely changes the C++ book recommendations.  C++ changes a lot about the language, especially how it should be taught.  Some books did a horrid job updating to the new standard ( just bolting on the new features ), while others did a better (less lazy) job.  I will probably do a post specifically about C++11 books at some point in the future.

C#

-------------------------------------------------------------------------

XNA was put out to pasture by Microsoft.  Fortunately, Monogame also got a lot better.  XNA is still an option, just not as good of one as it used to be.

PlayStation Mobile was released and C# based.  SDK Link (My Tutorials)

Unity 3D is now free.

Mono for iOS and Android 100$ cheaper

C# 5 released.  Outside of parallel programming functionality (async), not much changed.  Nowhere near the change of C++ for example.

Java

-------------------------------------------------------------------------

Slick2D is dead or abandoned.

Java took a few hits in terms of deployment due to security concerns ( Apple yanked it for example ).

LibGDX is probably the strongest option in Java now.

Don't believe there were any major language updates ( 1.7 then and now ), just service releases.

Python

-------------------------------------------------------------------------

Um.... anything?

Otherwise there would be a few things I would mention that weren't as relevant 2 years ago.

Misc

---------------------------------------------------------------------

Rise of the Lua game engines.  Add Dreemchest to that list as well.

In the mobile space, Lua just simply put got big.  Lua is also the scripting engine of choice for CryEngine, Gameplay and Project Anarchy.  Lua is a very very very good starting point for people looking to just start out.  Corona is now available free and at the same time, is more expensive...

HTML5 got a little bit more viable ( but still limited ) Flash suffered some major blows ( but still viable ).  There are now a number of solutions that make appifying HTML5 applications possible, such as CocoonJS.  Tons of libraries exist for HTML5 game development..

Previously niche/limited game maker software ( GameMaker, Construct2 ), as well as cross platform tools like Haxe (tutorial series) or LoomScript ( my look ) have made cross platform game development a hell of a lot easier.

The 3D engine space saw a bit more activity.  As mentioned earlier, RIM released GamePlay3D.  On top of that Torque was released for free, CryEngine leaked it's developer information in a hack attempt... ( thanks for that btw... :( ) and Project Anarchy (my look) was announced and released.  Project Anarchy is a bundle of Havok's game developer technology released completely free for mobile development.  On the 3D game engine space the story is Unity Unity and Unity.  Frankly Unity had a good year, made partnerships with pretty much every single platform available and is available in a free version for pretty much every platform now.

Grand total, not all that much happened, not really enough to full write a v2 version, hands down the biggest changes in the last two years:

C++ 11

XNA killed

Unity took over the world.

I miss anything?

 

Anything else I missed in the last two years of game development?

Programming


28. August 2013

 

As you may have noticed yet we ( somewhat prematurely ) reported on Maya LT, a new indie focused version of Maya.  Today marks the official release of Maya LT. I also got the opportunity to get some additional clarification from Autodesk, in an interview below.

 

Here is the official press release:

Autodesk Unveils Maya LT for Indie and Mobile Game Developers Starting at $50 a Month

 

 


Powerful Tools and Affordable Pricing Expand 3D Options for Independent Game Developers and Small Studios

SAN FRANCISCO, Calif., August 28, 2013 — Autodesk, Inc. (NASDAQ: ADSK) today introduced Autodesk Maya LT 2014, a new 3D modeling and animation tool tailored for independent and mobile game developers. Available immediately and compatible with certain industry-standard game engines, Maya LT draws inspiration from award-winning Autodesk Maya software to bring an intuitive, affordable new toolset for the creation of professional-grade 3D mobile, PC and web-based game assets.MayaLT__HyperShade_DX11_UberShader__1920x1080

“We see indie game developers as a key part of the industry, driving innovative new production techniques and gameplay,” said Chris Bradshaw, senior vice president, Autodesk Media & Entertainment. “The market is fiercely competitive, and Maya LT can provide indie developers and small studios with a powerful, yet simplified workflow for designing and animating remarkable 3D characters, environments and props – at a price that fits within even the most modest budget. It’s a practical solution that closely matches the needs of the mobile game development production cycle and helps developers rise above the noise and really shine.”

Smaller studios like Phyken Media, creators of the mobile game Wizard Ops Tactics, saw both the economic and workflow benefits of the new product.
“I jumped at the chance to try Maya LT, as the cost flexibility means we could grow the studio much more comfortably,” said Phyken Media President Kunal Patel. “With an option like Maya LT, our small team can accept bigger challenges and take on various new types of projects that may require more artists without having to worry much about any large upfront expenses. We even found operating expenses are much easier to determine.”

Maya LT for Game Developers
Maya LT debuts with an easy-to-navigate user interface (UI) and industry-renowned 3D modeling and animation tools that enable independent game developers to rapidly deliver 3D assets into game engines. The software integrates seamlessly into game development workflows with out-of-the box support for Unity 3D Engine and Unreal® Engine™ through the FBX file format for primary data exchange, and the ability to import certain 3D asset formats [Maya (.ma, .mb), Maya LT (.mlt), OBJ, FBX, AI, EPS] and texture formats (BMP, PNG, DDS, EXR, TGA, TIFF), as well as export 3D assets in FBX and .mlt.

MayaLT__HumanIK_AnimationGraph_and_Outliner__1920x1080Key Features
Maya LT has a number of features customized specifically for the needs of mobile and independent game developers: powerful modeling tools to help create and alter 3D assets of any size and export FBX files containing up to 25,000 polygons per object, animation tools that include a skeleton generator and inverse kinematics with Autodesk HumanIK, and high-quality viewport previews to help developers view assets as they would appear in game, reducing iteration and asset creation time. Other key features are lighting and texture baking, giving designers professional global illumination tools to help simulate near realistic lighting through baking lighting data into texture maps, and vertex maps.

 

Pricing and Availability
Autodesk Maya LT 2014 is now available for Mac and Windows at a starting price of $795* SRP per perpetual license. Term licenses will also be available as part of a monthly, quarterly or annual rental plan in the near future, starting at $50* SRP, $125* SRP and $400* SRP respectively.

Learn More About Game Development with Autodesk Maya LT
For more information, and to download a free** trial of Maya LT, visit: www.autodesk.com/mayalt. Connect with the Maya LT development community at: http://area.autodesk.com/mayalt.

 

I got the opportunity to get a bit more detail from the team at Autodesk.  Answers where provided by Wesley Adams (WA), Autodesk Industry Market Adams  and Frank Delise (FD), Autodesk Director of Game Solutions.

 

Question: What are your target audience with this release.  Are you aiming primarily at game developers working with UDK and Unity, or indie developers in general?

Answer (WA) : Maya LT was specifically created to address the needs of indie game developers who want to create 2D and/or 3D assets for mobile platforms and much of its feature set is dictated by these requirements. It is primarily a 3D asset creation tool although it has a broad range of animation tools as well. It is engine agnostic and the assets created in Maya LT can be exported to any game engine via FBX including both Unity and UDK. Maya LT is designed to expand our portfolio of mobile game development tools, which already includes the Scaleform Mobile SDK with a Unity plugin. The Mobile SDK is based on the core technology of Autodesk Scaleform, but enables developers to use it as a standalone Flash runtime to port games to mobile platforms. This gives indie and mobile developers two different ways to access technology that was somewhat inaccessible to them previously.

 

Question: Are you considering launching a similar program for other tools such as Softimage or Max?

Answer (WA): Although we cannot talk specifically about future product releases, we do intend to continue to evaluate many different productization strategies, including LT versions, for our core entertainment markets of Film, Games and Television as well as to address new markets. However, it is not our intent to release multiple products for new markets. In this case we are targeting game developers who want to create 2D (sprite sheets) and 3D assets for mobile games. They require a solution that works both on PC and Mac and so we chose Maya as the basis.

 

Question: Will it be possible to white list certain plugins.  For example, the current no plugin policy will make it impossible to use Maya with Project Anarchy's art tools from Havok.  Will Autodesk be working with third parties in this regard?

Answer (WA): Yes, our intent is to work with third parties to build a healthy plug-in eco-system around Maya LT. In many ways Maya LT is a v1 product and we plan on an aggressive development path for it.

 

Question: Any possibility of an end-to-end Autodesk bundle ( such as versions that output specifically to Scaleform ) at indie friendly pricing. Or in a Creative Cloud type subscription service?

Answer (WA): We have no further announcements to make at this time regarding other new products and offerings, but we will indeed offer customers the option of purchasing either a perpetual license (with or without subscription) or a monthly rental plan.

 

Question: Are there going to be upgrade options available like other Autodesk LT products to move from LT to full versions?

Answer (WA): Right now there are no upgrade options available to move from Autodesk Maya LT to Autodesk Maya or any other Autodesk 3D animation product, primarily because it was not designed as an entry level product to Maya but to go after a new market.

 

Question: Is LT based on 2014? Is the intention to keep them at release parity? How long is the outright license purchase eligible for support?

Answer (FD): While Maya LT is based on Maya 2014 it is not intended to just be a reduced version of Maya but follow its own trajectory as a solution for indie developers developing for mobile platforms. So while we plan to keep Maya LT and Maya very close in terms of those Maya features that are relevant to indie game development, in some cases we may take different approaches to solving certain problems or needs. This could mean Maya LT specific capabilities not available in Maya for example.

 

Question: Doesn't the 25K limit on export heavily handicap certain usage scenarios, such as using Maya as a level editor?

Answer (FD): No, Maya LT can handle the same scene sizes as Maya. Therefore you can create large complex scenes. When exporting to a game engine, you’ll need to export the scene in modular pieces, up to 25k per object via FBX. This is a typical scenario when building games, using modular design. For example, you can create a car that’s over 70k polys, but export the body separate from the wheels. Maya LT also supports hi-res to low res texture baking for complex asset work.

 

Question: Does removal of MEL also prevent creation of toolbar shortcuts? What is the reason for removing MEL in general, is it not remarkably core to the Maya experience?

Answer (FD): In Maya LT, you can still create custom toolbars; however, Mel was removed. Maya LT is not a replacement for Maya in games; it is designed for asset creation for many indie game assets. We still expect Maya to be used by game developers who want the functionality to build custom pipelines\tools and advanced features.

 

Thanks for taking the time to answer guys!

Art


27. August 2013

 

This one comes care of Tom’s Hardware:

 

Autodesk has introduced Maya LT, a new 3D animation product based on their award-winning Maya software. This new product also brings with it a subscription pricing model that they hope will make it more affordable to indie developers.

 

 

Indie developers, whether working for mobile, PC, or web-based games, need a professional 3D animation software that can be used to create 3D and 2D assets to be used in game engines. Autodesk has developed Maya LT as a new product whose focus is on the needs of indie game developers. It brings the established tools of Maya into the affordability range of indie game developers and also allows them to import assets that were created in Maya proper (as well as OBJ and FBX), giving them access to thousands of available models from sites like Turbosquid. Through support for FBX export, Maya LT also can be used for game engines like Unity Engine and Unreal Engine.

 

I have been advocating for an indie friendly version of Autodesk products for a long time, as they are easily the most expensive aspect of the game development tool chain.  This release certainly lowers the price, but does it lower it enough?

 

Pricing and Availability

Maya LT is available immediately for both OSX and Windows at a price of $795 for a perpetual license. Term licenses are available as part of a monthly, quarterly or annual rental plan in the near future, starting at $50, $125 and $400, respectively.

 

So, 800$ is certainly a better price than 3,675$ for a license of the full version.  The monthly and quarterly licenses are certainly a great option for short term game development and complement the Adobe Creative Cloud offerings nicely.  But

 

What exactly do you give up for that savings?  Well, here is where things get a bit tricky.

  • Does not support external renderers; cannot render 'scenes' or animations
  • No MEL support, and currently no plugin support or SDK.
  • Export to FBX format of up to 25,000 polygons per scene (but the .mlt format allows denser meshes within Maya LT)

 

The first item, the inability to render scenes means you cannot use Maya LT to create pre-rendered animations, such as cut scenes.  Perhaps worse, you also can’t even create a composited still, or any graphic more complicated than a rendered sprite.  So if you were thinking about rendering your title screen using Maya LT, you are out of luck.

 

No MEL support; that either sucks or is a non-issue depending on your workflow.  No plugin support is the same story with a bigger downside.  The inability to support plugins makes Maya LT completely useless for game engines that require plugin support such as the indie friendly Project Anarchy.

 

FBX export limited to 25,000 polygons.  This is probably the biggest problem as higher polygon count meshes are becoming more and more common as devices improve in power.  Granted, you generally wouldn’t use this many polygons on a standard mesh in a mobile title, yet.  On a desktop title though, you certainly would.  Perhaps the biggest downside is, this limit pretty much precludes you using Maya LT as your level editor.

 

In the end, it is certainly a step in the right direction but falls flat for me.  If Blender didn’t exist and wasn’t getting better with every release, this might be more appealing. At 800$, that is getting incredibly close in price to Modo, Lightwave and Maxon in price.

 

Oddly enough, Tom’s Hardware is the only source of information right now.  There are no details on Autodesk’s site.  I will update more information as it becomes available.

 

EDIT:

The Tom’s Hardware link is now down and as it was the primary source of this information there may be something fishy with this story.  I have found no other source to verify the story, nor have I heard back from Autodesk.

 

EDIT: 2:37PM

Shawn McClelland from Autodesk’s games solution group made the following post, with a great deal of clarification over on the Polycount forums:

 

Hey guys!
My name is Shawn McClelland and I am a product designer over on the games solutions group. I'll pause in case people would like to throw any objects at me upfront.

I wanted to come in and clarify a couple of things with regards to the Maya LT release and hopefully answer any questions you all might have or listed to your input/feedback.

As far as the 25k poly limit goes this is purely on export so the FBX file will not store anything larger than 25k. You could stuff a gigajillion polygons into a Maya LT scene and still save out the LT file and have zero issues but when you want to export that out to your game engine it needs to be packed in 25k chunks. We felt that limiting the contents of the scene was dumb but wanted to manage things on export a bit better so that's the reasoning there though we're not adverse to hearing your input and changing this to suit your needs.

With regards to the scripting I will say yeah it's a bit of a bummer and I totally get the disappointment of some tools guys or folks that like to rely on third party scripts floating out there on the web. We've heard this feedback and it's loud and clear to us that you need a scripting solution as part of this offering so we're going to see what we can do here. There is no Script Editor inside of Maya LT by the way just to clear that up as well.

JonJones: Your feature list isn't actually all that far off from what LT provides We did our best to provide a feature set that was enticing to the non-highend crowd so we removed things like rendering features, dynamics and various other things that cause a ton of UI bloat but aren't really all that useful to the indie, mobile, casual games developer or the freelance modeler. While we don't provide an SDK out of the box we do provide ShaderFX, FBX and Turtle all as pre-compiled included plug-ins. For third-party stuff we have a few ideas we've been mulling about but I don't think I can go into specifics just yet but if there are plug-ins you feel are a necessity to your work please let me know and I'm happy to work with dev on it.

For Rendering output we're relying on the VP2.0 and playblast options to output essentially hardware renders of your scene. Turtle is also provided for map baking needs as well and we've got a pretty sweet build of ShaderFX included as well that will let you build node networks for surface shaders. I have a few sample scenes I've built up using ShaderFX if people are interested including a version of the DOTA2 Hero Shader I've been working on as a ShaderFX graph.

Hopefully I've answered some questions and concerns here. If you have any further questions please don't hesitate to ask me via these forums or you can reach me direct at shawn(dot)mcclelland(at)autodesk(dot)com. If you're interested in becoming a beta tester you can also email me about beta participation and I'd be happy to get you added to the LT program.

Cheers,
Shawn

 

It basically confirms the majority of what was said earlier.  They are listening for feedback though, so if you strongly disagree with the 25K limit or removal of scripting for example, let them know!

Art


12. August 2013

 

So today on Safari Books Online came a book that was a complete flash from my past.  Computer Graphics: Principles and Practices 3rd edition has been released.  What’s so special about this book?

cgpap3

Three things… 

 

First, it was the textbook I used to learn computer graphics a very long time ago.

Second, it was one of the only ( incredibly expensive ) books I had to purchase for school that I actually found valuable.  ( Code Complete was the other book, if you were curious )

Third, it’s one of the only dead tree books I have kept.  I am almost entirely digital these days, so you have to be a good book for me to keep you around, especially given the size of a few of the condos I’ve moved into over time, I’ve gone through a lot of book purges!  When you consider how incredibly out-dated it had become, the world of graphics has changed a great deal since the second edition of the book was released in 1990!  On top of that, all of the code examples where in Pascal, using a library I’d never heard of at the time, or used since.

 

Fortunately with the release of the 3rd edition, I now have one less piece of dead tree fighting for space in my house!  There are a few things to know about this book, it’s has no code for OpenGL or Direct3D, it’s not really about that.  The book actually uses WPF for it’s examples, but don’t worry, the concepts are easily applied elsewhere. The entire point of this book is to teach graphics programming concepts, not really about the implementation.  If you don’t already know one of those APIs, you are going to want to pick up an additional book on your graphics library of choice ( if needed. )  That said, this will make you **understand** what you are doing with either of those graphics libraries.  You will find when reading this book, it doesn’t really matter what programming languages or library you use, you will be able to digest and adapt to your tools of choice without a lot of effort.  This book has been almost completely re-written at this point, and does cover the modern graphics pipeline.

 

What does it cover?  Well, just about everything actually.  That’s why I kept it around all these years.  For example, here is the Table of Contents:

  1. Introduction
  2. Introduction to 2D Graphics Using WPF
  3. An Ancient Renderer Made Modern
  4. A 2D Graphics Test Bed
  5. An Introduction to Human Visual Perception
  6. Introduction to Fixed-Function 3D Graphics and Hierarchical Modeling
  7. Essential Mathematics and the Geometry of 2-Space and 3-Space
  8. A Simple Way to Describe Shape in 2D and 3D
  9. Functions on Meshes
  10. Transformations in Two Dimensions
  11. Transformations in Three Dimensions
  12. A 2D and 3D Transformation Library for Graphics
  13. Camera Specifications and Transformations
  14. Standard Approximations and Representations
  15. Ray Casting and Rasterizations
  16. Survey of Real-Time 3D Graphics Platforms
  17. Image Representation and Manipulation
  18. Images and Signal Processing
  19. Enlarging and Shrinking Images
  20. Textures and Texture Mapping
  21. Interaction Techniques
  22. Splines and Subdivision Curves
  23. Splines and Subdivision Surfaces
  24. Implicit Representations of Shape
  25. Meshes
  26. Light
  27. Materials and Scattering
  28. Color
  29. Light Transport
  30. Probability and Monte Carlo Integration
  31. Computing Solutions to the Rendering Equation: Theoretical Approaches
  32. Rendering in Practice
  33. Shaders
  34. Expressive Rendering
  35. Motion
  36. Visibility Determination
  37. Spatial Data Structures
  38. Modern Graphics Hardware

 

… so as you may be able to tell, this isn’t a short book.  In fact it’s 1264 pages in length, which would be why this isn’t a proper review, I am not done the book.  In fact, it’s one of those book I will probably never read entirely front to back.  Instead I jump in to the areas I need, unless of course I struggle with the concepts being taught, then I tend to read the entire chapter until I’ve gotten the subject down.  Of course, I read chapters from time to time just for something to do.

 

That’s another great part of this book.  I am no math wiz, I have forgotten far too much, so with many pure math texts I struggle.  This is why this book is very good.  It’s not simple by any means, but it doesn’t just throw an equation at you and leave you scratching your head.  Things are introduced in escalating difficulty, but if you have a late high school or first year university math education, you should be OK.

 

The math is fully explained over the course of the book.  If you have trouble parsing out equations, they are explained fairly well in the book including how to decipher them.   The book doesn’t magically make math easy, but it does do an effective job of explaining it, so that even a non-genius can make sense of things.  Here for example is the excerpt on Euler Angles, and is typical of how things are explained:

 

Example taken from book:


 

11.2.2. Euler Angles

Euler angles are a mechanism for creating a rotation through a sequence of three simpler rotations (called roll, pitch, and yaw). This decomposition into three simpler rotations can be done in several ways (yaw first, roll first, etc.); unfortunately, just about every possible way is used in some discipline. You’ll need to get used to the idea that there’s no single correct definition of Euler angles.

The most commonly used definition in graphics describes a rotation by Euler angles (φ, θ, ψ) as a product of three rotations. The matrix M for the rotation is therefore a product of three others:

1

Thus, objects are first rotated by angle φ in the xy-plane, then by angle θ in the zx-plane, and then by angle ψ in the yz-plane. The number φ is called pitch, θ is called yaw, and ψ is called roll. If you imagine yourself flying in an airplane (see Figure 11.1) along the x-axis (with the y-axis pointing upward) there are three direction changes you can make: Turning left or right is called yawing,pointing up or down is called pitching, and rotating about the direction of travel is called rolling.These three are independent in the sense that you can apply any one without the others. You can, of course, also apply them in sequence.

jet

 

Figure 11.1: An airplane that flies along the x-axis can change direction by turning to the left or right (yawing), pointing up or down (pitching), or simply spinning about its axis (rolling).

Writing this out in matrices, we have

2

3

With the proper choice of φ, θ, and ψ, such products represent all possible rotations. To see this, we’ll show how to find φ, θ, and ψ from a rotation matrix M. In other words, having shown how to convert a (φ, θ, ψ) triple to a matrix, we’ll show how to convert a matrix M to a triple (φ′, θ′, ψ′), a triple with the property that if we convert it to a matrix, we’ll get M.

The (1, 3) entry of M, according to Equation 11.14, must be sin θ, so θ is just the arcsine of this entry; the number thus computed will have a non-negative cosine. When cos θ ≠ = 0, the (1, 1) and (1, 2) entries of M are positive multiples of cos φ and – sin φ by the same multiplier; that means φ = atan2(–m21, m11). We can similarly compute ψ from the last entries in the second and third rows. In the case where cos θ = 0, the angles φ and ψ are not unique (much as the longitude of the North Pole is not unique). But if we pick φ = 0, we can use the lower-left corner and atan2 to compute a value for ψ. The code is given in Listing 11.1, where we are assuming the existence of a 3 × 3 matrix class, Mat33, which uses zero-based indexing. The angles returned are in radians, not degrees.

Listing 11.1: Code to convert a rotation matrix to a set of Euler angles.


  1  void EulerFromRot(Mat33 m, out double psi,
  2                             out double theta,
  3                             out double phi)
  4   {
  5    theta = Math.asin(m[0,2]) 
//using C# 0-based indexing!
  6    double costheta = Math.cos(th);
  7    if (Math.abs(costheta) == 0){
  8       phi = 0;
  9       psi = Math.atan2(m[2,1], m[1,1]);
10    }
11    else
12    {
13       phi = atan2(-m[0,1], m[0,0]);
14       psi = atan2(-m[1,2], m[2,2]);
15    }
16
  }


It remains to verify that the values of θ, φ, and ψ determined produce matrices which, when multiplied together, really do produce the given rotation matrix M, but this is a straightforward computation.


Inline Exercise 11.3:

Write a short program that creates a rotation matrix from Rodrigues’ formula (Equation 11.17 below) and computes from it the three Euler angles. Then use Equation 11.14 to build a matrix from these three angles, and confirm that it is, in fact, your original matrix. Use a random unit direction vector and rotation amount in Rodrigues’ formula.


Aside from the special case where cos θ = 0 in the code above, we have a one-to-one mapping from rotations to (θ, φ, ψ) triples with –π/2 < θ ≤ π/2 and –π < φ, ψ ≤ π. Thus, the set of rotations in 3-space is three-dimensional.

In general, you can imagine controlling the attitude of an object by specifying a rotation using θ, φ, and ψ. If you change any one of them, the rotation matrix changes a little, so you have a way of maneuvering around in SO(3). The cos θ = 0 situation is tricky, though. If θ = π/2, for instance, we find that multiple (φ, ψ) pairs give the same result; varying φ and ψ turns out to not produce independent changes in the attitude of the object. This phenomenon, in various forms, is called gimbal lock, and is one reason that Euler angles are not considered an ideal way to characterize rotations.

 



If you can make sense of the above, you will be good with this book.  This sample is pretty typical of how things in this book are covered.  So if you are looking for a text for learning or brushing up on computer graphics Computer Graphics: Principles and Practices is probably one of the best.  With the exception of Physics, and library specific instructions, this book has pretty much everything you might need to know.

General Programming


AppGameKit Studio

See More Tutorials on DevGa.me!

Month List