Title: DE Particle System ? Post by: glennmarshall on July 12, 2013, 11:10:30 AM Hi
I'm trying to build a ray marched particle system at the minute - to allow me to create complex structures and animation. Much like what is possible with Trapcode's Form - http://www.redgiant.com/products/all/trapcode-form/ I need some help though creating individual scale / translation / rotation on repeated objects or 'particles'. I've so far created a field of repeating cubes like in the images below. Here's my code for this. Code: float map(PVector p) {I've since been trying to translate the position of each cube with values from a 3d perlin noise field - to create a nice organic deformation of the overall structure. But I just can't get it working - it looks messed up. So this is my first problem I need help with. I'm also trying to orient each cube in the same direction - in the image below I have sort of got it working on the XZ plane, but it's a 'bend' operation really - and also I could only get this working on 1 plane - I couldn't get a full 3d rotation - but just on one plane, e.g. XZ or XY only. So I need help figuring out full rotation as well, and also how to scale each cube would complete the deal for me. Thanks for any help, Glenn. Title: Re: DE Particle System ? Post by: eiffie on July 12, 2013, 07:59:07 PM If you want to orient each cube to face the origin then create a lookat matrix from your x,y,z values.
In GLSL you can create that matrix like this... Code: mat3 lookat(vec3 v){But rotating each cube differently will cause a discontinuity so its not going to work well with ray marching. Have you read this thread? Sounds similar. http://www.fractalforums.com/index.php?topic=14990.0 (http://www.fractalforums.com/index.php?topic=14990.0) Title: Re: DE Particle System ? Post by: glennmarshall on July 13, 2013, 10:02:36 AM thanks eiffie, i think i could get that working :)
however scaling and translation are more important at the minute - the .frag link you posted kind of does that yes, I'll keep trying anyways, cheers. Title: Re: DE Particle System ? Post by: glennmarshall on July 13, 2013, 11:03:31 AM oh why doesn't this work!!
Code: float map(PVector p) {I was hoping this would give me a wavy grid of cubes using perlin noise to affect the x translation of each cube - it just looks messed up though :( Title: Re: DE Particle System ? Post by: eiffie on July 13, 2013, 05:25:44 PM One problem I see is that you sectioned the space into cubes with size 0.6 and then offset them by 0 to 1.0. You have to stay within the cubes! Even then you will see discontinuities.
I am curious if what you really wanted to do in the first place was reduce the object to smoke as in the link above? If that is the case just search for samples of cloud rendering with DE. That effect should be easy to produce (yeah easy to say). Title: Re: DE Particle System ? Post by: glennmarshall on July 13, 2013, 06:10:29 PM ahh yes I see what you mean,
I tried this and it seems to be working better, float n=noise(x, y, z); n=(n*.6f)-.3f; It's a bit limiting though - the cubes can only be displaced a modest distance - was hoping for more extremes, but I realize the DE technique makes this tricky. Might have to rethink things. I want to stay using the 'infinite space' idea to replicate the cubes - rather than within a confined space (as with the exploding fractal example), one reason being I want to create vast, infinite worlds with this technique. Title: Re: DE Particle System ? Post by: eiffie on July 13, 2013, 07:12:28 PM One trick is to use two overlapping spaces. This allows you to have more room between the objects in a single space but when both spaces are drawn it looks dense. Takes twice as long to compute :(
Title: Re: DE Particle System ? Post by: glennmarshall on July 13, 2013, 07:36:14 PM yes nice idea - i'll try that out thanks. |