Jump to content

When and Why should we use FreezeWorldMatrix?


ian
 Share

Recommended Posts

@ian -  If I understand correctly, Great question. I always freeze all transforms on all objects prior to export - especially for any skeleton and/or bone objects. For characters, the reason is that in building and setting up your skeleton for binding vertices to bones, the transforms (especially scale and rotation) will/may generally not end up to hold values of 1.0, and 0.0 respectively. And if your scale is anything other than 1.0 in any channel, then your animation will be scaled to a value other than 1. And if your rotations are other than 0.0 and especially if they are already approaching values of -179 or +179 (or even half this), then you will often observe "flipping" and/or gimble lock when you animate bones approaching and certainy beyond these values - depending upon your scene and any proceedural animation of course. 

However, such issues can also easily apply to parent/child relationships (especially scale); so you have everything to gain by freezing transforms prior to animating in your application or in BJS. But even if you're simply exporting objects in your scene, always freeze transforms to avoid the issues above, and far more issues than I listed. Again, you have nothing to loose and will eventually have problems at some time - perhaps not with your current project, but it will happen in time - guaranteed. So simply play it safe. And as an example, while working on films at Weta in NZ, I made one of the rules in the production pipeline to always freeze all transforms prior to animating and/or exporting from any application. Prior to this rule, almost 30% of work produced by our animation and mocap teams were rejected for flipping of bones and/or gimble lock on objects - costing tons of hours and loads of money. But by the 3rd LOTR film, this # was reduced to less than 2%. I know this isn't a film animation production we're working on here, however, the very same rules apply regardless of the application you are using or the framework used to animated and to render.

And BTW - we never had a single asset or animation returned to us by EA or UBISoft once this rule was embedded into all Artists brains and the technical team reviewed and followed it through our pipeline integration - prior to delivery of any game assets to the aforementioned developers.

 

EDIT - Actually, I believe I did misunderstand what you were asking, however, I hope that someone got the message to freeze transforms prior to any export. As for your specific question, there are several circumstances to freezeWorldMatrix(); - including setting bounding boxes to resolve their transform values to maintain consistant physics and collisions - among other uses including texture mapping and vertex animation. Pleae check out the topic below:

Cheers,

DB

Link to comment
Share on other sites

Is freezWorldMatrix() (or in blender exporter addon in blender - check box "Freeze World Matrix" same as if I select object manually in Blender and press ctrl+a (Apply Object transformations) and select "Rotation & Scale" (so that Rotation is set to (0,0,0) and Scale is (1,1,1)) ? (as I see is not same)

Does "Freeze World Matrix" do the same to object (so set Rotation (0,0,0) and Scale (1,1,1)) when we are exporting to .babylon file?

If I scale Box object (2,2,2) and rotate (30,30,30) and check "Freeze World Matrix" then if I export to .babylon (file still have scale 2.2.2 and rotation 30,30,30.
but.

 

greetings

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...