Update time. (again) Well, I kind of had to go back to basics on this one. The AS3 3D library I use got updated, and some of the new features were must-haves. So I had to go back and reprogram the viewer to take this into account. I made some other adjustments to increase flexibility. You can now specify the size of the rendering window, and you can adjust the origin of your 3D model without re-exporting your mesh. You can also load up 3DS, DAE (collada), and ASE files. Just specify where the 3D model is in the xml file, and the texture you want to use.
Click on the image below to see the player in action.
Click Here to Download the model viewer
Naturally, there is still much to be done. Multiple viewing modes are a must-have. (wireframe, cel-shading, and gourad should be possible in the near future) And I would like to throw in a few more rotation options. I was going to hold off on those until I had conjured up some arrow graphics for my button class. But the current version is fully functional and should be perfect for viewing low to mid-range poly models.
Replies
Also, the artifacting on my model is actually caused by the way that I constructed the model. I have a lot of faces too close to each other, and the 3D engine is having trouble handling the z-testing for them. A less convoluted mesh wouldn't have any problems. I'm not used to such low-poly endeavors, my choice of subject was questionable, and I can't paint to save my life.
looking forward to more progress on this
One of the issues with this method is that it is compile-time. The model isn't being loaded into the flash player. It is compiled into the flash swf itself. As such, you can't really use this method to load any model you wanted. Each model would have to be compiled (or published, if you prefer) as its own swf file.
Of course, once they are swf files, it is entirely possible to load those into another swf file that could serve as a "viewer" with standardized controls and options. That is definitely an option that I will want to explore.
It's also true what you say about XML. Flash is actually quite adept at handling XML, and loading it at runtime. A 3D file stored as XML could be quite easily loaded into Flash at runtime. And textures are cake. Flash has built-in objects and functions for loading textures dynamically at run-time. It even has full support for PNG's and their transparency values, so alpha masking is no problem.
The reason I'm sticking with this solution for the moment is becasue it makes it very easy to get models into Flash, and there is a slight performance advantage to having the model pre-defined in the 3D engine's native type. It's actually already possible to load external 3D files into the engine, this solution is just more convenient for a code-monkey like myself.
http://www.papervision3d.org/
it is an open source project and released under MIT license. so lots of artists might profit from it. i have no experience with it, but those who are interested might check out papervision3d.
http://boards.polycount.net/showflat.php?Cat=0&Number=264839&an=0&page=1#Post264839
If not there are tons of others floating around here.
direct link:
http://blog.papervision3d.org/
it would be a nice project for some people to write a modelviewer in flash using paper vision so everybody could easily add 3d models on his/her website without having a background in flash or 3d in flash.
do you think it possible for a sub 2000 tris game?
As to a sub-2000 tris game, I suppose it would be possible. The example model I'm using (Bobo's Demon) is actually a 1024 triangle model, and it runs pretty smoothly at lower resolutions. I would not suggest attempting full-screen rendering with this, though. The larger you render it, the more it chugs. But a very simple sub-2000 tri game would probably be possible if you kept the rendering resolution down. (say between 320x240 and 640x480)
Speaking of which, I have to make a new on-line portfolio soon. I've already got a couple of pretty sweet ideas for it. But I would love to hear any suggestions.
are you gonna make this thing available for other people? that would be awesome
Why not use google pages? free and I've had no issues with bandwidth
Oh, just in case you wanted to know, it works good in Linux too. Not that it shouldn't, since it's flash, but there weren't any anomolies using Ubuntu with Firefox.
I actually spent an hour or so this morning working on a custom 3D model to use as the default model selection. Thanks for the testing, btw, notman. It's great to know that there aren't any cross-platform issues. That's always been one of the things I liked most about flash.