-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|373|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Showcase Home -> Graphic Demos


 
zebeste
Created : 06 March 2009
Edited : 08 March 2009
System : Windows
Language : Blitz

SpinningCubesB3D

Spins cubes around and then blows them apart!

https://socoder.net/uploads/226/SpinningCubesB3D.zip
Screenshots
Modified extensivly from code found on blitzbasic.com

It spins the cubes around for a random amount of time then blows them apart. Then it'll reverse the process and bring the cubes back together into the original image. Then it repeats.

Read revision details for usage details on new features.


Recommended image dimensions: 50x50
Performance decreases dramatically as image size increases.
Images do not have to be square.

Controls:
Esc-Ends the program
1-Show program stats

Other Notes:
I actually plan to rewrite it in C++ later for increased performance and for the experience

Latest Update

Version 1: Initial Release

Version 2:
-Added a file loader dialog on startup, replacing the old system of loading SpinImage.png from the Images folder. Supports the .png, .jpg, and .bmp file formats.
-Added a screen resolution picker immediately after the file dialog.

Version 3:
-Added a file load dialog to load an alpha image. The image is used to set which pixels have cubes created for them. If the value of the red channel is <128 then no cube will be created. If the value is >=128 then a cube will be created
-Added a file load dialog to load a grayscale height map image. The image is used to scale the cubes by a value between 1 and 10. A totallly black image will result in all the cubes having a length of 1. An all white image will result in all cubes having a length of 10.
-If an alpha or height map image is not selected the program will still continue to work as long as a valid color image was loaded
-If an alpha or height map image is loaded, then they are required to have the same dimensions as the color image

 

Comments


Saturday, 07 March 2009, 01:36
Jayenkai
Neat stuff!

It'll be interesting to see what kind of difference C will make to a simple 3D program like this.
I found that, with 2D at least, I annoyingly ended up with exactly the same limit as with Blitz!!
Let us know how you go on.
Saturday, 07 March 2009, 05:34
CodersRule
I tried to use SplitImage1 and for like a split-second, it showed up correctly, then it blew up. Seriously, it exploded. Pieces were flying everywhere. Didn't manage to get a screenie. I tried it again and it worked perfectly fine o.O

|edit| EDIT: |edit|
Whoa it happened again, but not as bad as the first one, i wasn't right in the center of the explosion like the last one. But I managed to get a screenie:


Saturday, 07 March 2009, 06:27
Jayenkai
LOL! That's meant to happen!
Saturday, 07 March 2009, 07:15
CodersRule
Oh.
Saturday, 07 March 2009, 07:27
zebeste
I added a description above to better explain whats supposed to happen.
Saturday, 07 March 2009, 09:19
zebeste
Updated to version 2!
Sunday, 08 March 2009, 08:24
9572AD
I'd like to see a version where a certain color would simply be an empty space. This could also help increase the size of usable images.

Nice toy!
Sunday, 08 March 2009, 14:45
zebeste
Version 3 has been added.

[qoute=9572AD]I'd like to see a version where a certain color would simply be an empty space. This could also help increase the size of usable images

Version 3 adds a feature that gives the ability to set certain pixels to not have cubes created for them.

[qoute=9572AD]Nice toy!

Thanks
Sunday, 08 March 2009, 18:35
blanko1324
That's pretty awesome!
Friday, 13 March 2009, 21:25
dna
Sensational algorithm.

It definitely has other uses.

Good Job.

** A few questions about the code. Did you use types, arrays, or both in the source.
Also, did you have to align the shapes into the image or can the software scan an image and explode it?
Monday, 16 March 2009, 16:13
zebeste
Thanks for the compliment (and the vote).

To answer your first question, it only uses types

As for your second question, I'm not entirely clear, but I hope what I'm about to say answers your question. When it loads an image, and it can be of any resolution and width/height ratio, it checks the height and width of the image, then creates a cube for every pixel. The cubes are scaled so that all of them can be seen at once.
Friday, 20 March 2009, 23:29
Stealth
Picking Random Photos on Your Hard Drive = Crashed Computer