Getting hands dirty with molehill

Few weeks ago I played with molehill and Away3D engine. Creating 3D scene is straightforward with an engine, but I still wanted to get deeper inside and understand the low level api and agal. So I took another approach and created pure molehill version of 3ddm. Soon I realized that I have been already familiar with some procedures from drawTriangles version so I could easily use algorithm for defining vertices, indices and uv.

Read the rest of this entry »

125000 Triangles & Still Smooth

A few months ago I played with an idea of creating 3D illusion from an image and its depth map. First versions were based on displacement maps (custom implementation in pixel bender) and later I used common 3D engines to transform image into a 3D model. With software rendering I hit fps limit somewhere around 10000 triangles, what is like 70×70 segments per plane. Now if your source image is something like 700×700 pixles, the fragmentation is 10px per segment, that is not enough details for me 🙂 .

Luckily, Adobe introduced Molehill a GPU-accelerated 3D API and I was curious about where the limits of this are. While Away3D already released its molehill version, I have transformed existing 3ddm Away3D version what literally was just like 10 lines of code.

Read the rest of this entry »

Superfast 3D Scene Without 3D Engine

Based on my previous post about z-sorting indices, I have created a superfast 3DDM version using drawTriangles(). The following example renders 100×100 segments = 10201 vertices = 20000 triangles (faces) per frame. Just to imagine how much that is, see the main image fullsize. There is no 3D engine used at all, everything is handled by native flash classes and functions. Z-sorting is not calculated on every frame (however it could be, because the sort algorythm is pretty fast), but it is pre-cached for some rotation. Feel free to run the example in new window in order to see the real speed (there is more flash content around here on my blog template). I can go up to 12 fps with the best flash quality for the first image in demo, how much can you?

Read the rest of this entry »

Z-sorting Indices For drawTriangles()

While constantly improving 3DDM (drawTriangles() version soon to be released), I was looking for the fastest possible solution to render simple 3D object. It soon appeared to be drawTriangles() – the native ActionScript 3 method, that let you make illusion of 3D object based on deforming your texture. In fact native ActionScript contains a lot of useful and fast classes to work with 3D like: Utils3D, Vector3D, Matrix3D, PerspectiveProjection… so you do not need to create your own basic 3D engine tools. One thing that it does not contain is z-sorting. Z-sorting is very tricky job, that is why modern 3D engines let you decide which sorting method to use with your scenes (faster vs. precise). For my needs it is enough to use simpliest z-sort possible, based on projected max z coordinate of face (3 vertices).

Before continue reading, make sure you understand the basics of Using triangles for 3D effects, Transforming bitmaps, UV mapping and Culling. Everything is very good described by Adobe.

Read the rest of this entry »

3D Displacement Maps

Good news everyone, since 3D displacement maps gained big success, I was asked to make a standalone application, so anyone could use it within their webpages. After few hours of hard work, the 3 applications are finally out and you can see and download it from 3ddm.yoz.sk. Feel free to use it on your own webpages. If you do so, please notice the copyright, and/or consider a small donation via PayPal (donation button in footer). If you are willing to see the source code of these application, you can download it from here: App3DDMSimple.as, App3DDMFade.as, App3DDMAnaglyph.as, App3DDMSimplePV.as, App3DDMFadePV.as, App3DDMSimpleAW.as, App3DDMSimpleTriangles.as, additional classes, .pbk and .pbj files can be downloaded from classes.yoz.sk. Any feedback welcome 🙂

Read the rest of this entry »