Experiment : Create in Cinema4D and finish in Flash

March 26th, 2008 by Jaap Kooiker

I wanted to combine the power of Cinema4D and Flash (in a relatively short period) and see what happens.

I started to create a simple 'lava planet' in Cinema4D, made a video of it and put it on the timeline in flash (I know on the timeline is not a best practice but it will do for now). Next I came up with a nice effect with dynamic particles and decided to get lava pouring out of the sphere.
What it does:
- Every frame
1. It creates a bitmap of the video.
2. It "reads" every pixel (of the bitmap) and looks for a specific color range.
3. When there's a pixel located, a new particle is added.
4. The particle starts to live its own life untill it reaches a specific y value and dies.
5. From all the particles one bitmap is created
6. Put some filters on the particles bitmap.
7. Place the particles bitmap on top of the video and your done.


Posted in 3D, Actionscript 3.0, Cinema4D, Flash CS3, Flash Video | 2 Comments »

Cinema4D here I come…

March 21st, 2008 by Jaap Kooiker

The last couple of days I spend some time working with Cinema4D. I think it's really great.
I just started to do 3d stuff (remember http://totallosameland.nl) and I'm still a long way from perfect, but I decided to place some of the renderers. Tell me what you think...

FCS Sphere

Volumetric Light

Sword (updated)

That's it for now....

Posted in 3D, Cinema4D | No Comments »

Why SOMETIMES … (String == Number) ….

March 10th, 2008 by Jaap Kooiker

So I encountered a really weird, but probably "explainable" problem in AS2 yesterday.
We all know that
trace("200.1" == 200.1) //true
and
trace("200.2" == 200.2) //true
trace("200.3" == 200.3) //true


trace("200.81" == 200.81) //true
trace("200.81" != 200.81) //false

This above works fine...but the following is what scares me the most....
trace("200.82" == 200.82) //false
Why the hell is the above false ???? And the really weird thing is
trace("200.82" != 200.82) //false
also false ???
So... it is NOT the same and it is NOT NOT the same?...wtf is it. AS doesn't seem to know what it is.

Ok, bear with me a second. The following:

trace("200.83" == 200.83) //true
trace("200.83" != 200.83) //false

...that seems alright

At this point, I tried to make some sense of it and applied the following rules....
If a string has one decimal....it turns out to work fine...
If a string has two decimals....it only works fine if the last digit is uneven...

The next thing to check is a string with three decimals and...there seems to be a different stupid rule here...check...

trace("200.811" == 200.811) //true
trace("200.811" != 200.811) //false

trace("200.812" == 200.812) //true (should be false according to last "rules")
trace("200.812" != 200.812) //false

Hmmm, it seems that we can erase the above rules from our head. It works fine at this point...what is that about?

One more sample...the second decimal after decimal point is an even digit.

trace("200.821" == 200.821) //false
trace("200.821" != 200.821) //false

trace("200.822" == 200.822) //false
trace("200.822" != 200.822) //false

Oh my god.....the second digit after decimal point is even and it is always false?? I can't seem to make sense of it....sorry...
I can probably go on and on with more samples (four / five / etc. decimal digits) but the point is clear....it's fucked.

If I trace typeof, it all seems to be a Number

trace(typeof(parseFloat("200.81"))) //number
trace(typeof(parseFloat("200.82"))) //number
trace(typeof(parseFloat("200.821"))) //number

Converting the String to a Number or use parseFloat doesn't work....so don't bother trying.

Maybe it has something (the way it parses a string to a number or visa versa) to do with rounding Numbers...see what Arno has to say...

Jaap

Posted in Actionscript 2.0, Bugs, Flash 8, Flash CS3, Flex | 6 Comments »