Away Builder - Cinema 4D - HPB vs XYZ rotations

200 views
Skip to first unread message

mc

unread,
May 8, 2009, 9:05:15 AM5/8/09
to away3d.dev
Hi There,

I'm been having a bit of trouble with the away builder & Cinema 4D.

I setup a simple scene in C4D, with a cube and camera.
I then animated the camera around the cube using an animation track
and keyframed start and end positions over 90 frames (still in C4D).

I then exported the Cinema XML
I also exported a JPEG sequence to make sure the camera i would
animate in Away 3D matched up perfectly *

The first test I did, the geometry matched up perfectly. (I had to
tweak the zoom on the camera slightly to make it match which was a
minor problem I had with it)

The second test I did was a more complex camera move. and didn't work
so well.

After many hours scratching my head I realized that as soon as I
introduced a "Bank" rotation in Cinema 4D, it went all wrong.

The values for the Away 3D camera's "rotationZ" were exactly the same
as the value for "Bank" in Cinema 4D.

I'm no expert when it comes to the working out of rotationX/rotationY/
rotationZ, and its relation to Heading/Pitch/Bank, but the "Bank" and
"rotationZ" don't seem to relate to each other directly, as it messes
up the positioning.

Am I right in thinking this? if so this may be a bug in the away
builder

Really enjoying Away 3D though :-)

*if you want me into more detail on how I did that i can, but i
basically just spat out keyframe data from Cinema using Xpresso and an
array in AS3, then drove the camera parameters by that array.

Andreas Engstrom

unread,
May 8, 2009, 7:08:21 PM5/8/09
to away3...@googlegroups.com
Hi.

That does sound a bit odd, I'll have a look at that. I'm wondering if
it might be a case of gimbal lock (see link below).

http://www.youtube.com/watch?v=rrUCBOlJdt4

.andreas

Andreas Engstrom

unread,
May 10, 2009, 11:16:46 AM5/10/09
to away3...@googlegroups.com
I have had a look at resolving this and have committed a fix on svn
that should fix a problem with reversed 'bank' direction for parsed
C4D cameras.

When I was looking over the parser code I noticed something I had
forgotten about that might help with your issue. Switch the xml values
for the camera rotations x and y and see if that helps. The parser
does this automatically but since you are extracting the values
straight from C4D doing that might fix it.

I also noticed that the camera rotation conversion seems to produce a
slight offset when 'banking' the camera which I'm not sure why it is
happening. I will look into this some more given the time but let me
know how you get on in the meantime.

.andreas

mc

unread,
May 11, 2009, 5:25:14 AM5/11/09
to away3d.dev
Hi there

yeah i had already swapped the X & Y rotations in my first test.

this worked fine. but as soon as I rotate about the Z axis it doesn't
seem to work.

What I realised is that a Z-rotation of the camera in Away, doesn't
rotate about the Z-axis like "Bank" in Cinema Does.

the closest to "Bank" in cinema is roll() but roll sets a relative
value as apposed to an absolute one.

thanks for looking into this! :-)

cheers

On May 10, 4:16 pm, Andreas Engstrom <i...@andreasengstrom.co.uk>
wrote:

mc

unread,
May 11, 2009, 6:35:34 AM5/11/09
to away3d.dev
i've uploaded a file that will illustrate the problem better "no
Banking-Banking.zip"

cheers

Andreas Engstrom

unread,
May 11, 2009, 7:18:04 AM5/11/09
to away3...@googlegroups.com
Link? :)

mc

unread,
May 11, 2009, 8:02:14 AM5/11/09
to away3d.dev

Andreas Engstrom

unread,
May 11, 2009, 1:51:47 PM5/11/09
to away3...@googlegroups.com
Thanks for those files, that comparison makes it a lot more clear to
see what is going on (and hopefully a solution easier to find also) :)

mc

unread,
May 12, 2009, 5:51:22 AM5/12/09
to away3d.dev
i've got another file uploaded with a really complex camera move (its
a Matchmoved sequence)

http://groups.google.com/group/away3d-dev/web/Tracking.zip

I tried to use camera.roll() this time (as it's similar to bank in
cinema 4D) but unfortunetly didn't work :-(

thanks for looking into this, much appreciated! :-D

On May 11, 6:51 pm, Andreas Engstrom <i...@andreasengstrom.co.uk>
wrote:
> Thanks for those files, that comparison makes it a lot more clear to  
> see what is going on (and hopefully a solution easier to find also) :)
>
> On 11 May 2009, at 13:02, mc wrote:
>
> http://away3d-dev.googlegroups.com/web/no+Banking-Banking.zip?gda=8Y7...

mc

unread,
May 14, 2009, 5:17:36 AM5/14/09
to away3d.dev
still struggling with this one!

doh :-(

Andreas Engstrom

unread,
May 18, 2009, 8:35:44 AM5/18/09
to away3...@googlegroups.com
I have had another go trying out a few things but no solution yet I'm
afraid.
Reply all
Reply to author
Forward
0 new messages