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 »

Pixel Bender Displacement Map Fakes 3D Effect (update)

Few days before I saw an amazing 3d effects on VidazPhoto. That made me want to master this effect. So, starting today morning I played around with flex and pixel bender and here are the results. I have created simple pixel bender kernel that uses monochromatic bitmapData to calculate amount of displacement for each pixel. All you have to do, in order to make your 2D images become 3D, is to create monochromatic map (black & white image) with the same dimensions as the original image (use lighter colors for closer objects, darker colors for distant ones). Than, based on rotation, push correct amounts of full displacement (dx, dy displacements for full white color) into shader. The displacement is linear starting on 0, 0 for black color, up to dx, dy for white color. All sources available to download.

Read the rest of this entry »

s.Oliver Rubik’s Cube

The Rubik’s Cube is a 3-D mechanical puzzle invented in 1974 by Hungarian sculptor and professor of architecture Ernő Rubik. My latest project was to create a 3D engine (I have used papervision) based on this logic + integrate with facebook. Finally, the game is ready and you can play s.Oliver ‘s Cube on Facebook.

Flash 3D Engine List

3d

If you are looking for 3D flash engine you have multiple open source choices. The best one offers modeling editors, so creating your scenes is click easy, or other animation / physics frameworks, pixel bender shaders etc. List of most popular 3d engines:

Read the rest of this entry »