Well, Go3D is official – We need base 3D classes that all engines can use

What turned out to be just something to finally scratch a strict typing itch i’d had with tweening has no become and full blown side project. Not only did Moses get me started, but Graeme Asher and John Lindquist fueled the fire as well. Graeme’s been working on Tween3DCamera and John’s been helping me add some other properties like scale/scaleX/scaleY/scaleZ to the property types as well as a small refactor.

If you’ve tried Go3D lately, you’ll notice that I had put static property methods (yeah kinda weird name, but that’s what they do ) in Go3D.as, but have now moved them to Value.as in the properties directory. It seemed to make alot more sense with what their function was, and Go3D.as has been deleted for now since it serves no purpose.

check out the project here:


One thing I added just today was the ability to pass a tweenTarget for a 3D object. If you look at the code samples below, you can now just pass a target and it’s position and rotation will be used to tween to. You can also use constants to just tween to position or just rotation. You can also pass custom properties for it to use with the target. The swf demo I’ve posted in the playground basically tells the Cylinder object to use the properties of the orange sphere.

protected function tweenAll(e:Event=null):void
tween = new Tween3D(targetObject, [Value.tweenTarget(middleObject)], duration, Easing.easeOutElastic);

protected function tweenXYZ(e:Event=null):void
tween = new Tween3D(targetObject, [Value.tweenTarget(middleObject, Value.XYZ)], duration, Easing.easeOutElastic);

protected function tweenCustom(e:Event=null):void
tween = new Tween3D(targetObject, [Value.tweenTarget(middleObject, [Value.X, Value.Y])], duration, Easing.easeOutElastic);

protected function tweenRandom(e:Event=null):void
tween = new Tween3D(targetObject, [Value.x(getRandom()), Value.y(getRandom()*.5), Value.z(getRandom())], duration, Easing.easeOutElastic);

Value.tweenTarget() returns an array of Go3DProperty objects that Tween3D expects to get to do the tween. It’s basically a convenient, yet strictly typed way of doing things. I’d say we’re having as much fun as untyped objects at this point – Even more probably 😉

I’ll be teaching on Go3D at the Toronto class in 2 weeks, and if you haven’t signed up yet, I seriously suggest getting out there asap – seats are filling up

Now, the reason I say we need base 3D classes for all 3D engines to use is because in a situation where I want to open this up for Sandy3D or Away3D or any other 3D engine that uses x/y/z/rotationX/Y/Z/scaleX/Y/Z, I’d have to write specific classes tailored to their api and object types.

We need to have one set of common 3D classes that define the atom level of a 3D object with the main 10 properties:

x, y, z, rotationX/Y/Z, scale, scaleX/Y/Z

So, I’m going to be starting such an effort and see how that pans out 😉 It makes too much sense especially when you consider any project that has to work with a 3D engine, but isn’t integrated with the code base. ASCollada being one, and Go3D being another.

I’d love to hear people’s thoughts on this matter.

  1. Maybe you could explain this for me. Why create this instead of just using Tweener? I can’t tell what you’re gaining.

  2. Cool,
    i took a look to moses’ benchmark app here http://go.mosessupposes.com/wp-content/uploads/tweenbencher/tweenbencher.html
    and actually go engine seems to be even better than tweener and tweenlite. I think it makes sense inventing the wheel once and share it with other 3d frameworks… and now that adobe’s guys are going on with their “native 3D” it would be great to use only one engine to animate 3D..or better i think it would be better to use only one engine at all!:)

    cool idea 🙂

  3. @Keith: I don’t want to take away from Tweener, it’s good engine and I’ve enjoyed using it for sure. The thing about it is that it’s completely untyped in it’s arguments and objects passed. That equates to speed lossed as well as no strict typing / control over the code base. Imagine a large scale application needing control over tweening. The developers would have no clue about the API what so ever. They’d have to look through the classes themselves to find out what can / can’t be passed and what events are dispatched. With Go3D, it’s strong typed so you can use tools like FlexBuilder to get code hinting and autocomplete features. You know what you can do and what events it dispatches.

    Also, if you look at the Benchmarks that Moses put out, GoASAP is faster and more accurate over long periods of time. The coolest thing is that Tweener guys could easily adopt Go under the hood and still keep their style of syntax. That’s the beauty of GoASAP.

    Hope that helps,


  4. “The coolest thing is that Tweener guys could easily adopt Go under the hood and still keep their style of syntax.”

    so Go3D is going to have the same syntax of Tweener?…or you mean Go3D will have ALSO Tweener syntax?

  5. I was playing with Go3D and I could not find a way to update properties for a started Tween3D.

    I’m using greatWhite to rotate a sphere on mouseMove , but creating a new tween3D on every mouseMove event is causing the animation to jump chaotically .
    I would like to know if there is a way to create the Tween3D object on mouesDown and update the values on mouseMove.


    • TK
    • May 21st, 2008


    This sounds stupid but can Go3D be used on non-3d objects too, or would I have to extend Go? Last time I checked, Go was a ‘framework for building an animation engine’ which does no good to the average dev or designer. What’s the deal?

    – TK

    • keith
    • May 21st, 2008

    Thanks for the explanation John. Now I totally understand. AND, you are right… I am always going into the Tweener source code to determine what string shortcuts I need to use to adjust special properties.

    I hope to see Tweener adopt strict typing too in that case, as I love their syntax and probably won’t go away from it.

  6. Away3D’s syntax is similar to Tweener’s in my opinion. What I mean by that is: you create a new instance of an object and pass an init object to the construct in Away 3D, in Tweener you call Tweener.addTween() and pass the target and an init object as well. Tweener is simple enough that I haven’t even noticed is untyped. I’ve just started playing with Away 3D and I’m dependent on the manual, while in Papervision I use the manual occasionally. The autocomplete in Flash Develop is a huge time saver and it helps me learn new APIs as I work with them.

    Aviary seem to be using it as well as I’ve seen in this post:


    Their 3D editor seems like a large scale application. I don’t know any behind the scenes details on how hard/easy it is to work with Away3D, but it’s a proof that it’s possible.

    I haven’t worked on large projects yet, so can you please shed more light in this area ? Strict typing vs untyped …what’s faster / more reliable / etc. ?


  7. Hey this is all really cool, glad to see GoASAP getting some play. John, fyi the wiki page doesn’t seem to be updated and the link at this post points to a different page… no big though, very cool to see you on GoPlayground!

    To the other posters here, I wanted to point out that Go is not a tweening kit like Tweener, it is a totally new thing: a set of core classes for creating animation tools of any kind. Tools built with Go can range from strict typed like John’s, to tweener clones like Donovan Adams’ class Hydrotween which looks like tweener but adds sequencing, to any number of other syntaxes you might make up yourself (XML tweens, whatever!). Go is like a voluntary standard that we can all work on building and refining, it is made for creative developers who like to branch out and build their own tools.

    BTW, I will be presenting GoASAP at FlashBelt in a few days so get your last minute plane tickets! 🙂


  8. This is awesome John!

    • Morf
    • June 8th, 2008


    There are those purists that feel that untyped variables are for the lazy. Their thinking justified in that strict typing is faster and more reliable. The slightly longer time in planning and developing your code is more than offset in making your code decipherable (to say nothing of the extra goodies you get when developing in FlexBuilder, etc.).

    I *am* an insufferable speed freak, though. So, along with the above, strong typing will produce faster performance: in general because you won’t be asking your compiler to do extra work and generate extra code; and in particular it won’t significantly affect performance by adding a lot of computational overhead (because AS3 creates pseudo-code for invoking most methods and calls to run the Flash! Player.)

    And for particular variables, some will always be faster than others; for example, computationis involving int-type variables run much faster than those using Number-types.

  9. Is there bezier tweening in go3d’s future? Is the underlying go.asap architecture not permitting that at this time? I only see the LinearGo class that Go3d is built on. Go3d has such lovely sequencing capablilities, adding bezier tweening like TweenMax (but in 3d) would be so killer.

  10. @Morf Thanks ! I didn’t take in consideration that the compiler doing extra works, strict typing makes more sense now 🙂

    • Wayne Anderson
    • July 22nd, 2008

    John, Moses had posted a 0.5.0 revision of GOASAP yesterday and I think it’s busted this demo. I’m getting ‘Access of undefined property’ errors in Tween3D.as and the culprit appears to be the ‘super.state’ property which points to a problem within LinearGo.as. There is no reference to a property called ‘state’ in LinearGo…. you may want to get with Moses on this… thanks.

    BTW… the work you guys are doing is incredible. I’m anxious to start working with these fantastic tools you’ll have created, Thank You.

  11. @ Wayne: Thanks man, yeah, I’ll get the update and make the fixes – appreciate the heads up!

  12. Hey John … I’ve been playing with PV & Go3D … check out my CubeWall … http://blog.lyraspace.com/ … can you help me out with the UIComponent issue?

    • starfire17
    • September 2nd, 2008

    H, this website has been fantastic for me, I’v learned so much on Papervision through the site, especially your Video Tutorials, very easy step-by-steps and very understandable. Thanks!

    Now I would love to use this Go3D with Papervision and Flash CS3, if you have anytime, do you think you could also post an easy step-by-step tutorial on this? Or do you know of any link i could get this kind of tutorial from as I’ve exhausted my searches on he web.

    Again, Many thanks for all!!

  13. … and some more … http://blog.lyraspace.com/?p=50 … let me know what you think. I did notice that your GoEvent class has static constants for COMPLETE etc but they are coming out in Flex builder as C_O_M_P_L_E_T_E … is there a good reason for this or just your own wacky logic?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: