View Full Version : Developing a 3D Engine
csdstudio
09-07-2006, 05:47 PM
Anyone working on a 3D engine or has had experience in 3D and would like to help improve my texture mapping somewhat? I've managed to get the engine itself working with 1000's of vetices without hassle. But when using the DistortImage class, I picked up from another board, seems to really drag things down a bit. There must be another way to map images without taxing the cpu too much while keeping the distorted image smooth. I'm using face normal calculation to hide back faces and add shading by using the ColorTransform filter on each face, but that also seems to tax the cpu quite a bit. :confused: Not to mention the overlapping polygon issue. :(
blockage
09-07-2006, 09:03 PM
I've been playing around with one of these too - haven't got as far as texture mapping. I'm actually more interested in the physics bit.
Anyhow, I've used a BSP tree (binary space partition) to do the depth sorting and overlapping. It works really well with both concave and convex polys. There's a bit of pre-calculation involved but it's worth it at run time. Recursive functions are really fast in AS3 which is great for tree traversal (forget recursive traversal in AS2, way to slow). Also, back-to-front traversal really suits the AS3 display list, simply traverse the tree and addChild() each time you find a polygon - nice :D
The other nice thing about bsps is back face culling comes as free - you only traverse the visible parts of the tree.
Anyhow there are loads of ways to do it but you really need to find the right data structure. Bsp trees are a good place to start. You'll find loads of useful stuff here http://www.gamedev.net/reference/ and the Programming Gems books are good too...
astgtciv
09-08-2006, 03:35 AM
Have you guys seen http://www.flashsandy.org/ , might be a worthy effort porting it to AS3...
firdosh
09-08-2006, 05:52 PM
sandy 3d is already ported to AS3 , they are just optimizing the code now :)...its a great 3d engine
astgtciv
09-09-2006, 11:36 AM
Oh how cool firdosh, I couldn't find any mention of AS3 on the site...
senocular
09-09-2006, 03:27 PM
http://www.actionscript.org/forums/showthread.php3?t=110474
kiroukou
09-09-2006, 08:48 PM
Hey Guys :)
Indeed, Sandy is ported into AS3. I've done this job with franto's help (www.franto.com).
Unfortunately I'm very busy at the moment (I'm looking for a job, for the first time :rolleyes: ) and I didn't find time to do some complete tests, and to implement the optimizations i have in my head.
I really don't want to provide a simple ported version, I'll do my best to take care of the new AS3 possibilities.
thanks for your interesst !
csdstudio > When I've delopped the DistortImage class, my goal was to provide a simple and quite accurate solution to map a bitmap on 4 points. There are some others great solutions to look at, especially the displacmentFilter that is able to give some nice results too.
As long as we need to tesselate the original bitmap and use beginBitmapFill, the process will be slow.
I'll give a look to the displacmentFilter in the near future.
++ ;)
PS : csdstudio I'm talking about an AS3 port in the website........ but in the donation section ^^
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.