Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Hartskeerl, posted on January 05, 2002




Image Description, by Hartskeerl



This image is a screenshot of my Cell Texture Generator. It's a very simple program, you can download it (binary with souce) from http://www.tfhweb.nl/cellgen.htm.

It is very unoptimised but it works, and I like the results. For more information, check out the 'Making Cellular Textures' article at www.GameDev.net.


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Tobias Franke

January 05, 2002, 06:27 PM

Hey, nice mosaic window generator :)

 
davepermen

January 05, 2002, 06:34 PM

i read the gamedev tutorial..

looks like a straight implementation of the ideas, well done

with unoptimiced i guess you mean you dont partition your scene, do you?

cellular stuff looks cool.. would be nice if it could be done somehow in realtime, procedural

 
Matt da Monkey

January 05, 2002, 06:58 PM

A couple of years ago I read the Worley Siggraph article about Cellular textures, and made a limited implementation that was able to render a 256x256 texture of about 30 points at 50 fps on a p3 500, uisng MMX and a couple of tricks... if any of you guys is interested on it drop me a line.

Regards

Matt

 
Bronto

January 05, 2002, 09:05 PM

just curious.. what does this formula in your sig mean?

 
Rectilinear Cat

January 05, 2002, 10:05 PM

Woah....cool. Looks like a Voronoi diagram.

 
Gareth

January 05, 2002, 10:09 PM

It plots the heart pictured in his sig :)

 
Dr.Mosh

January 05, 2002, 10:17 PM

thats exactly what I thought.
-slightly- simpler to implement though :)

 
Mathieu 'POĻ' HENRI

January 05, 2002, 10:35 PM

I haven't read tutorials on cellular texture generators but I guess it should be easily done with some simple mathematical morphology operators... in fact I did something similar for a project of 256bytes intros ^_^

 
DxAvatar

January 06, 2002, 03:38 AM

Hi

Nice Stuff ...

I've got a question : are you using Delphi ?

once more : very nice stuff

Bye

dxAvatar

ps:I'm french so understand that my English is not very good !!!

 
davepermen

January 06, 2002, 05:18 AM

yeah, i found this formula while searching for a heart-pic on images.google and i couldn't resist to see if i can plot the heart myself with a simple opengl-program. its slow and just points and no lights but at least i could prove the formula is correct:)

lovely, not?

 
Pierre Terdiman

January 06, 2002, 05:55 AM

Hey Poļ! Here's a version I did some years ago, for procedural terrains:

http://www.codercorner.com/CellularNoise.jpg

I've always called this a "Voronoise" actually :)))

 
Kanda

January 06, 2002, 06:39 AM

Bahhh ca va ca pourrait etre pire :-)

 
maddoc

January 06, 2002, 06:51 AM

How to research such formulas?! The formula looks really.
wow. Lets say: long =)

And how to use this formula?!?!


for (x = 0; x <= MAX_Z; x++)
for (x = 0; x <= MAX_Y; x++)
for (x = 0; x <= MAX_X; x++)
PlotPixelAtResultOfFormula (); //?!?!







 
Alexander Blach

January 06, 2002, 07:57 AM

According to the icon of the main window he is using Delphi 4.

 
davepermen

January 06, 2002, 08:07 AM

its not the formula wich is interesting but the equation.. means where f(x,y,z) = 0.. now my idea is simple:

if f(x-1,y,z) < 0 and f(x,y,z) > 0 then the result (f(x,y,z)=0) lays somewhere between those two points.. so we plot a red pixel

means if
sign(f(x-1,y,z)) = -sign(f(x,y,z)) or
sign(f(x,y-1,z)) = -sign(f(x,y,z)) or
sign(f(x,y,z-1)) = -sign(f(x,y,z)) then
plot point(x,y,z)

the results of f(x,y,z) are first stored into a grid so in the rendering i only have this:

if sign(f[x-1][y][z])=-sign(f[x][y][z]) etc.. so far so fast..

its not at all correct but works very well as you can see.. now i could do some triangulation of the mesh but no:) i just wanted the proof..

 
=[Scarab]=

January 06, 2002, 08:11 AM

Google is really amazing. A Google search on "(2x^2+y^2+z^2-1)^3 - (1/10)x^2z^3-y^2z^3 = 0" (including the quotes) produced a link to a German site which calls it Das Herz der Mathematiker (The Mathematician's Heart).

 
Bronto

January 06, 2002, 08:45 AM

but how do we plot it ?

just try all values for x/y/z and see if the formula is valid ?

 
davepermen

January 06, 2002, 08:50 AM

i told you how to plot.. if p(x-1..) has a different sign than p(x..) then between there is a point where the func has value 0 => the solution is true. then i simply plot that point p(x..)

 
Gorm Lai

January 06, 2002, 09:02 AM

It is sad to see a IOTD turn into a discussion about something else. Something interesting nonetheless. Just calculate the points in a 3d grid, and then use the marching cubes algorithm to triangulate it.

There you go, a nice 3D heart. And you can shade it if you want :)

/Gorm

 
Dan Royer

January 06, 2002, 09:39 AM

For the last time:

I'M NOT YOUR GIRL.

 
Megahertz

January 06, 2002, 11:45 AM

Hear that alot eh Dan? =)

-=[Megahertz]=-

 
Lion V

January 06, 2002, 12:36 PM

Interesting iotd.
I think having the color of one cell be affected by the colors of the others touching it would be a great effect.

Regarding the heart pic;
A month or two ago I implemented a 2-variable function for 3d point plotting. I won`t give the details; but if someone is interested, they can email me at pdn@rmci.net.

 
DxAvatar

January 06, 2002, 01:19 PM

No i think that it's Delphi3 !!!

 
DWORD

January 06, 2002, 01:57 PM

Nice! Yeasterday I just thought of how the formula for a heart would look like :). Right now I'm trying to use the marching cubes algo for making surfaces described by such formulas. It's very powerful, though I don't know much about it yet.
The picture in the sig, however, is just a 3d grid with points that are either inside or outside the heart. You just plot the points in the grid, that satisfies the equation... Hope this helps ;-)

Greetings
-Christian

 
DWORD

January 06, 2002, 01:59 PM

Exactly... also try the marching cubes algorithm to make a surface describing the heart... ;)

 
ReAL

January 06, 2002, 03:19 PM

Great program! I'm creating my first game and I also need textures for it. This program only has nice black and white pictures, but does anyone know a program the makes more pictures and with colors (that like these ones) fit in eachother? (like Texturizer from Seumas (www.longbowdigitalarts.com) I tried several programs but none creates those that fit nicely in eachother (or they blur it).

 
ector

January 06, 2002, 03:42 PM

http://www.blackpawn.com also has a tutorial about cell/voronoi textures, with some interesting variations and a tree-based extreme speedup.

I've only tried the variations, didn't bother to implement the speedup algorithm since I only needed to calculate the textures at startup-time and i don't want to waste any more space than necessary in my 64k intro :)

 
Tristan_H

January 06, 2002, 06:09 PM

(to ReAL): Do you actually mean 'tiled' by 'fit in each other'? If so: it does. The program can export a bunch of bitmaps (limited to 217 x 217 pixels) whihc can be very useful when creating colored textures. So they're black-white but easy to edit thanks to the colored weird thingy (see screenshot).

 
DaVEkELLY

January 07, 2002, 01:33 AM


Very nice idea and implementation. It would be good to add points with the mouse, to arrange things as you like.

I'm sure this could be used in a pathfinding system. The nice gradients could be used as a 2d lookup table, for steering a 3D object. When the pixel gets too bright, steer to a darker area.

 
Joachim Hofer

January 07, 2002, 02:20 AM

Cool heart... Hope to see a meta-heart demo with several hearts, melting into one another, soon :)

 
This thread contains 37 messages.
First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.