AS3 analog clock in 3D

Hi,

In the previous post I have presented how to create a simple analog 2d clock using as3 only.

Now it is time to do it in Papervision3D :)

I’ve used the same mechanism as in the 2D one - the polygon generator I’ve created serves now as a vertex creator - and basing on the vertex - cubes are added to the scene. Tweener is used for animating the cubes then. A simple mathematical mechanism is used for camera movement.

You can download the source code here. The source is well commented. All classes included.

Comments are welcome as usual ;)

Have fun with it,

FLAIM

 

Real 3d in Html - updates

updates to html3d

Hello,

The update includes:

- z-sorting for html objects (see this page),

- simple mouse interactivity,

- optimized z-scaling of fonts,

- optimized speed (redesigned communication with js).

 

The complete updated source is here.

Known issues:

- Antivirus software (checked with KAV) causes major slowdown when checking Javascript (only Internet Explorer browsers) …use Mozilla if you have Kaspersky turned on - fixed that

- slow…as hell ;) - it’s better now :)

have fun,

FLAIM

***** RECENT UPDATE ******

I’ve optimized the code and changed the files in this post (both the sources and example link) - everything is 500-800% faster than in the previous post. Thanks to the optimization the issue with Kaspersky disappeared also :)

… have fun :)

Real 3d in html / javascript / pv3d

Hello everyone,

In the previous post I’ve mentioned that it could be possible to use papervision 3d and ExternalInterface to create 3d in HTML :)

..well that wasn’t too hard to imagine when I’ve found out that it is possible to get coordinates of any vertex of a pv3d object you want - using : “..geometry.vertices[index].vertex3DInstance.attribute “..so I did it..

It’s a bit “proof of concept” idea - it of course ‘doable’ rather than ‘usable’ (too slow) but that didn’t put me off ;)

You can see the test movies right here (or by clicking the large image above). Click the embed button first and then wait for the flash to load. I did it on purpose - because it is processor heavy.

You can download the complete source! here.

So how does it work?

It’s described in the sources but shortly:

- creates a whole pv3d environment with a simple cube, a camera and so on…

- dynamically creates html content then used to animate (simple divs with text),

- creates communication (see the html source) between js and as3,

- uses Tweener for animation :) yep - that’s a cool part:),

- the pv3d cube is a fake all the time - it exists but it’s not really visible - the coordinates are passed to html objects using the method described in the beginning of this post,

What could be done with it? 

- a lot! You could do a whole menu/website with it - as long as you don’t use too many items on the stage. It’s very easy to add full mouse interaction to it using the same methods I used in the demo. It’s also very easy to modify the 3d environment and steer the camera from js :) Use your imagination!

I hope you like the little demo - comments are welcome!

FLAIM

*** UPDATE

Please use the code from my newer post about the 3dHTML - it’s optimized and works significantly faster.