Archived entries for experiment

Custom Alternativa3D flat shading

Choosing the right platform, tool or engine is essential for the success of your project. Right now I’m working on a 3D game, so naturally I thought of using Papervision3D because I’m familiar with it. Our game however, relies heavily on collision detection and fast rendering, and both are done better by the Alternativa3D engine. The only thing that is missing is any form of lighting the 3D objects dynamically.

We need to dynamically add shadows on our models because baking textures by using 3D studio max is not an option, but the Alternativa platform does not support it (yet). So I had to add it myself. The only problem is that the engine is not open source. I asked if I could get it, but they didn’t give it to me. So I had to decompile the engine first, which presented problem number two: decompiled source code contains lots of errors.

It took me 1 day to fix the source code, and then another day of optimizing the code for Flash player 10. After that was done, adding the flat shading was done in less then an hour. I added flat shading for TextureMaterial and MovieClipMaterial, which are lighted only the first time their surfaces are created. But the FillMaterial has dynamic lighting (only ambient).

Check out the demo here. Click the color pallet to change the color of the light and see how it affects the color of the surfaces of the spheres.

Alternativa3D flatshading

Processing webcam

My first experiment with Processing, based on a previous experiment with Flash.

Random path

I had this idea to let the Math.random() function generate paths in flash. What does it look like? Like this. The algorithm is really simple (as usual):

  1. Pick an empty point
  2. Pick a random neighboring point which is not occupied
  3. Draw a line between the active point and the picked neighbour
  4. Set the active point to the neighboring point
  5. Repeat step 2
  6. When no neighbors are found start from step 1

Random paths

Random paths

Perlin noise generative art

Two days ago I continued to play around with perlin noise (see previous experiment). The idea is to let lots of particles crawl over a perlin noise bitmap. Each frame they will leave their trail generating nice patterns like the ones below. I wrote a little tool to influence the curve width, speed of the particles, colors, type etc. Try it out for yourself over here, and show me the result when you’ve created something nice.

perlin noise 1

perlin noise

Papervision3D and inverse kinematics

Today I had some time to do some experimenting again. In the Placebo project I used 2D inverse kinematics on the octopus tentacles, so when that project was finished I was curious how that would work in 3D. Turns out not much different then the 2D version. Check out the result over here. I also added a drawing function to the experiment, just click the mouse on the canvas to turn drawing on and off and create your own artwork.

papervision3Dik

Interactive waves

It is still work in progress, but I couldn’t keep this for myself. Based on perlin noise using the brightness of pixels (again) to push up each line of the wave, drawing the layers from back to front and giving them a different color. When you move the mouse left, right, up and down you will influence the perlin noise bitmap, which affects the waves. Try it out here.

waves

Lines with depth

I had the idea for a while to do something with points and lines in 3D space, so yesterday after reading the post of bit-101, I finally started to do some testing. After creating a 3D sphere with lines, a 3D landscape of lines I finally thought it would be more exiting to do something with the web cam.

The idea is simple. Scan an image, in this case the image from the web cam from left to right. The more brightness a pixel has, the more the line gets pushed back at that point (in 3D space), and if it contains no brightness at all, it gets no depth at all. Repeat this process until you covered the whole image from top to bottom. Because flash needs to draw plenty of lines I used the new drawPath function in Flash 10 to speed things up a bit. If you have a webcam you can play around with the result for yourself over here.

3Dlines

Kaleidoscope

Yesterday I did a little experiment to simulate a kaleidoscope. First I added some mouse interaction to  it, so the user could drag the mouse to change the shape, but then I decided it would be more fun to let the kaleidoscope react to music. So turn on you sound and check it out here. Click on the movie to change the photo that is used to generate the image.

kaleidoscope

AStar pathfinding demo

A quick AStar pathfinding algorithm demo, soon I will release an open source version that will be available to download. I just have to make it a little bit easier and flexible. Check the demo here.

AStar

Sound and Papervision3D

A long time ago when Papervision3D was just released, I did some experiments with sound. I used the capabilties of flash to analyze the spectrum of the sound that’s been played back and generated 3D triangles to match the output. I lost the original but I thought it would be fun the remake the demo. You can watch and listen to the result here.

Sound and Papervision3D experiment



Copyright © 2004–2009. All rights reserved.

RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.