Results tagged “experiment” from Swell 3D

A couple weeks ago, I posted a Flash experiment moving an object to different specified depths. In that post, I mentioned that I was assuming values for three variables that I could not measure:

  • Pixel density, or how many pixels per inch your monitor is displaying.

  • Pupillary distance, or how far apart your eyes are.

  • Monitor distance, or how far away you are sitting from your display screen.

This experiment shows the effect of those three variables on anaglyph display. If you set those three values to the right numbers for your own eyes and monitor, these coins will appear at their actual size and actual depth to you.

(If this file is running too slow on your computer, I made a simplified version with fewer coins, which should work better on slower machines.)

Flash 3-D Experiment 05: Effects of Variables

If you don't know your pixel density, don't guess: you can measure it yourself here. Your pupillary distance actually won't matter much, unless you are sitting very close to your monitor.

2 euro coin The depth of each coin is actually based on its face value. For instance, all of the 2-euro coins are two inches in front of your monitor.

1 euro coin All of the 1-euro coins are one inch in front of your monitor.

1 cent coin All of the 1-cent coins are one inch in back of your monitor.

2 cent coin All of the 2-cent coins are two inches in back of your monitor.

5 cent coin All of the 5-cent coins are five inches in back of your monitor.

10 cent coin All of the 10-cent coins are ten inches in back of your monitor.

The coins used in this picture total 6.46 euros. (I had a large budget for this project.)

|

Not every experiment is a success; some fail. But if we learn why they failed, the failures are in a sense successful.

For some reason, I thought maybe I could compose a good 3-D anaglyph using screenshots from the terrific strategy game Age of Mythology. I was wrong.

aom_heroes_3d.jpg

As you can see, the results were... not particularly good.

aom_villagers_3d.jpg

The main problem is, AOM renders everything isometrically, so moving to the left and right doesn't really give you different views of the world. But it does let you rotate your view. I thought I could simulate left and right views by slightly rotating the map. It didn't work well. After a while, I gave up and branded the effort FAIL.

Here are the full screen shots I used, if you want to see what I had to work with:
aom_heroes_left.png
aom_heroes_right.png
aom_villagers_left.png
aom_villagers_right.png

And this is a bit of a tangential question, but... am I the only one who thinks the Egyptian villager women are pretty hot?

|

I thought I should try Papervision3D, an open-source ActionScript 3D engine, to see if I could use it for anaglyphic animations and games and such. So I downloaded it, and did their "Rotate" example, then turned it into an anaglyph:

Flash 3-D Experiment 04

I got it to work, but not how I hoped. I was hoping to have two cameras in the scene, a left and a right, looking at the same objects, and apply some kind of color filter to each camera, red for one, cyan for the other. Then, render both the cameras.

But it didn't work that way. I could put two cameras in the same scene, but I couldn't render them both. If I tried, only the second one actually rendered.

And so, to make this anaglyph, I actually had to have duplicates of everything. Not just two cameras, but two containers, two scenes, and two rotating squares too (since I couldn't register the same square with both scenes). It doesn't seem efficient, and it's almost exactly the opposite of my original goal, which was to create 3D effects one symbol at a time. So, Papervision3D might not be for me.

On the other hand, some other developers have managed to do very nice anaglyphs with Papervision3D. For example this works very well [1]. And this is quite good (be sure to turn "STEREO 3D: ON," in the lower right corner) [2]. And so is this [3].It is possible that they have hit upon something that I haven't found yet. So I won't totally write PV3D off yet, until I know more.

FOOTNOTES:
[1]: Ben Stucki (Ben Stucki did post his source code, but I think it's for Flex instead of Flash.)
[2]: Barcinski and Jeanjean
[3]: Mr. Doob

|

At the heart of any good Flash anaglyph engine would be a function that renders objects at the correct scale, and at the proper red/cyan offsets, based on their z-axis value (or how far they are away from the viewer). This experiment uses a simple formula to render an object in 3D at any given distance. Move the slider back and forth to render the egg closer or farther.

Flash 3-D Experiment 03

The units are in inches from your monitor surface. That is, if z = 3", that means it's supposed to appear that the egg is three inches deep into your monitor. A negative value means it is sticking out that many inches in front of your monitor.

The computation makes assumptions for factors I can't measure, and these assumptions are probably not all true. (It assumes your monitor resolution is 72 pixels per inch. It assumes your pupils are 2.5 inches apart. It assumes you are sitting 24 inches back from your monitor.) If the assumptions are untrue, your perceived depth will differ from the given depth proportionally. (To see just how much these factors would affect the calculations, see experiment 05.)

At the extreme negative range, ghost images appear. In a real game or animation, I would avoid these, but I wanted to test the extremes in this experiment.

|
In experiment 01, I applied color blends to three vector symbols to achieve 3-D effects. In this one, I'm doing the same thing. Only this time, I'm doing it with ActionScript at runtime! Click on any of the three buttons to toggle the 3D on and off for the individual symbols.

Flash 3-D Experiment 02

This humble experiment demonstrates my idea of applying 3D effects one symbol at a time, and proves it is possible. A sophisticated ActionScript engine could handle all the computations and color blending needed to generate amazing anaglyphic worlds.
|
I have an idea for creating 3-D animations and games in Flash. The idea is to render vector symbols into 3-D at runtime, one symbol at a time, rather than calculate the two entire views first and then merge them. I believe that for most purposes, rendering each symbol separately will save processor speed and simplify the workflow, making amazing things possible.

What follows, however, is not amazing. It's just an experiment. There will be lots of these. Gotta crawl before you can walk.

Flash 3-D Experiment 01

The picture you see here was made from just three symbols: a star, a face, and an egg. These symbols were not drawn in 3-D, just in black and white and gray. I applied the red and blue for 3-D effects using only the tints and blends in the authoring environment. I'll explain more about this in future posts.

So, I think my idea is possible.
|
Page Views