Real 3d in html / javascript / pv3d
April 28, 2008 — flaimHello 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.







April 28, 2008 at 11:38 pm
That is so incredibly awesome man. I would have never thought about using papervision 3d to do something like this. It’s so mind blowing. I’m very impressed.
Being skeptical just for the sake of it, I can’t see any reason for it other than impressing people with proof of concepts. The reason I say this isn’t necessarily because of the speed, but the fact that it relies on both javascript and flash. I’d use javascript for those who don’t have flash, and I’d use flash to do 3d stuff like this. However, pretty much all advantages of doing it one way or the other are thrown out the door when you’re relying on both for any functionality.
That said, I’m definitely going to play with this idea as much as I can. Thank you for this.
April 29, 2008 at 8:13 am
Hi Flaim!
I am really up for such experiments man!
Good work.
April 29, 2008 at 8:23 am
I’ve recently noticed a major issue with this method…
Antivirus software (in this case KAV) slows down the 3d in Internet Explorer to ZERO… FF doesn’t suffer this.
I didn’t check any other antivirus software but it’s possible that it works the same.
FLAIM
April 29, 2008 at 9:29 am
Thanks Og2t!
I’ve been to your blog - great stuff!
FLAIM