I really need to stop playing with isometrics, more addictive than lego. Anyway made this from boredom.
Can you guess what it is? Post a comment if you know…
as3 experiments,source,code,snuffyTHEbear, robert daniels, as3, actionscript, flash, air, blog, developer, freelance, buxton, derby
I really need to stop playing with isometrics, more addictive than lego. Anyway made this from boredom.
Can you guess what it is? Post a comment if you know…
So there’s no built in method to truncate a number in actionscript. Well a bit of playing around and a simple work around is just as good.
As most of you will know String’s can be truncated via substr();.
Well just typecast your value to be truncated to a String, call the substr(), using the length of the string minus your amount of digits to trincated, then typecast it back to a Number.
Code:
1 2 3 4 | function truncate(val:String,truncCount:uint):String { return val.substr(0,val.length-truncCount); } |
To use:
1 2 3 4 | var num:Number = 56.673856; trace(num)//56.673856 num = Number(truncate(num.toString(),5)); trace(num)//56.6 |
Playing around with isometrics, perlin noise and sine waves. Something I have wanted to do for a while.
Anyway first app uses perlin noise for height or y pos depending if floating or not, click to toggle floating and randomise the x and y offset’s for the perlin noise.
The second app is using a simple sine wave accross a grid, well the first isometric block is using a sine, the rest just of the blocks just set their height or y pos to the one before it, again click to toggle floating.
Yet some more of the book, not long after i posted the flutterby experiments.
Renders very quick but kinda expected it to as it is very simple, 3D maybe…?
Click to generate a new set of coloured cross sections…