Fractal surface
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 05:48, xxxxxxxx wrote:
Check your other threads regarding this topic. I have posted some examples there.
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 05:50, xxxxxxxx wrote:
Okay Jack here's what I have...
BaseObject *SpaceRock::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh) { Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA); if (!dirty) return op->GetCache(hh); BaseObject *cube = BaseObject::Alloc(Ocube); if(!cube) goto Error; cube->SetParameter(PRIM_CUBE_SUBX, GeData(4),0); cube->SetParameter(PRIM_CUBE_SUBY, GeData(4),0); cube->SetParameter(PRIM_CUBE_SUBZ, GeData(4),0); PolygonObject *polyCube = ToPoly(cube); if(!cube) goto Error; Vector * points = polyCube->GetPointW(); LONG pointCount = polyCube->GetPointCount(); for (int i = 0; i < pointCount; i++) { Real arr[20]; InitFbm(arr,10,2.0,0.5); RidgedMultifractal(arr, points[i], 10, 3, 7); Turbulence(points[i],10, TRUE); SNoise(points[i]); Fbm(arr, points[i], 10); } cube->Message(MSG_UPDATE); return polyCube; Error: return NULL; }
Unfortunately nothing happens to the cube .. so I must be doing something wrong... I figured I'd try all the noise functions just to see what happened.... Do you see anything I should change?
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 05:51, xxxxxxxx wrote:
And Thanks again Matthias...
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 06:55, xxxxxxxx wrote:
Maybe the changes you're making to the point positions are just too small to see? Remember, the noise functions only return values between 0 and 1 (or -1 and 1), so you'll want to multiply them with some value control the deformation intensity.
Cheers,
Frank -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 08:06, xxxxxxxx wrote:
Could you post a quick example of what you mean by that?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 17:19, xxxxxxxx wrote:
Originally posted by xxxxxxxx
What other noise functions are you refering to?
All of them, just take a look into the SDK documentation.
Originally posted by xxxxxxxx
Could you post a quick example of what you mean by that?
Well, just multiply it.
Real x = Turbulence(points[i],10, TRUE) * 5.0;
You actually do know that those Noise functions return values, right? In your code it looks like you just call them without doing anything with their results.
I strongly advise you to stick your nose into the SDK documentation and read about the basics, since most of your questions here are answered there!
Also your code looks quite inefficient in several places, e.g. initializing the Fbm array in every iteration of your loop is neither necessary nor does it lead to a good performance. Last but not least, you have to convert your allocated object to a polygon object. In your code, you just cast it. Read about Current State To Object in the SDK docs. Don't forget to check for memory leaks by using the c4d_debug.txt file.
Cheers,
Jack -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 17:34, xxxxxxxx wrote:
Hey Jack,
Yeah I did know that the functions returned a value. I often seem to come off a bit naive when I am charting in to new territory for myself because I am mostly learning as I go. I do appreciate you answering my questions as it helps to make it all more clear.
I will poke around in the SDK to get a better understanding of these concepts. The Current State To Object I have not used before but i will look in to that.
Thanks again.
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 17:39, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I often seem to come off a bit naive when I am charting in to new territory
Sometimes, maybe, a little
Originally posted by xxxxxxxx
I am mostly learning as I go.
That's how most of us learned it, I guess. Nothing wrong with that.
Originally posted by xxxxxxxx
I do appreciate you answering my questions as it helps to make it all more clear.
I don't mind answering lots of questions, but I want people to do some research on their own.
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime."Cheers,
Frank -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 17:41, xxxxxxxx wrote:
I'll go fishing. Thanks!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 18:06, xxxxxxxx wrote:
I am only find this about Current State To Object:
Current State To Object (CSTO)
CSTO has to be executed on a duplicate of an object because CSTO modifies the existing caches. In some cases you have to use a temporary document as well (GetVirtualObjects()).Is there more in the SDK about it? Should I use a CallCommand() to do CSTO?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2010 at 19:21, xxxxxxxx wrote:
Okay so after doing some more digging in the SDK and some searches here at the cafe, I have found two ways to do the current State To Object.
BaseObject *SpaceRock::GetVirtualObjects(BaseObject* op, HierarchyHelp* hh) { Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA); if (!dirty) return op->GetCache(hh); ModelingCommandData mcd; BaseObject *cube = BaseObject::Alloc(Ocube); if(!cube) goto Error; cube->SetParameter(PRIM_CUBE_SUBX, GeData(4),0); cube->SetParameter(PRIM_CUBE_SUBY, GeData(4),0); cube->SetParameter(PRIM_CUBE_SUBZ, GeData(4),0); PolygonObject *polyCube = ToPoly(cube); if(!polyCube) goto Error; Vector * points = polyCube->GetPointW(); LONG pointCount = polyCube->GetPointCount(); //mcd.op = polyCube; //mcd.mode = MODIFY_ALL; //SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, mcd); Real arr[20]; InitFbm(arr,10,2.0,0.5); for (int i = 0; i < pointCount; i++) { Real rmf = RidgedMultifractal(arr, points[i], 10, 3, 7) * 5.0; Real turb = Turbulence(points[i],10, TRUE) * 5.0; Real snoise = SNoise(points[i]) * 5.0; Real fbm = Fbm(arr, points[i], 10) * 5.0; points[i] = points[i] * turb; points[i] = points[i] * rmf; points[i] = points[i] * snoise; points[i] = points[i] * fbm; } //CallCommand(12233); //Current State To Object cube->Message(MSG_UPDATE); return polyCube; Error: return NULL; }
I have commented both ways out but you can see that I do it with the CallCommand() and I also do it with a SendModelingCommand(). Is there a particularly more effective way to do it? Also, I still must not be doing it correctly, because nothing is happening to my cube. I believe that given the changes I made to the loop that at least something should happen to the points _but nothing is which leads me to believe that it is still not correctly doing the CSTO.
Do you notice anything in particular that I am doing wrong? I will keep looking for more info here and in the SDK as well. Thanks,
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2010 at 00:43, xxxxxxxx wrote:
You need to use SendModelingCommand(), then get the result.
Also remember that you sometimes have to clone your original object, and use the modeling command on the clone, as it's shown in some threads here in the forum.The ToPoly cast can be removed, since it does not change the object. Rather cast the modeling command result to a PolygonObject, that would make more sense
Also, if you would have taken a close look into the SDK, as I advised you, you would have found some nice demo code for exactly this modeling command in the documentation. It also shows you how to get the result.
Cheers,
Jack -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2010 at 16:11, xxxxxxxx wrote:
Well after some blood, sweat, and SDK searching I finally figured it out. When you're right you're right Jack,,, I learned much more by combing through the SDK...
Thanks for the pep talk.. LOL
~Shawn -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/06/2010 at 18:26, xxxxxxxx wrote:
If I want to subdivide the rock using the SendModelingCOmmand() is this okay to do from within GetVirtualObjects or is that unsafe? I know it says you can't chan ge the scene from within GVO but if the object hasn't been added to the scene yet, is it safe to subdivide it?
Thanks,
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/06/2010 at 21:38, xxxxxxxx wrote:
Hey Jack,
So I have successfully created an object and am using noise functions to alter the look of the object.
Here is the code I am using.
Real arr[20]; InitFbm(arr,20,7,0.5); for (int i = 0; i < pointCount; i++) { Real rmf = RidgedMultifractal(arr, points[i], octaves, offset, gain) * .8; Real turb = Turbulence(points[i],octaves, abs) * .8; Real wavturb = WavyTurbulence(points[i],time, octaves, 1) * .8; Real noise = Noise(points[i]) * .8; //RIDGED MULTIFRACTAL if (bc->GetLong(SPACEROCK_NOISE_TYPE) == SPACEROCK_RIDGEDMULTIFRACTAL) { points[i] = Mix(points[i] * rmf, points[i], amt); } //Turbulence if (bc->GetLong(SPACEROCK_NOISE_TYPE) == SPACEROCK_TURBULENCE) { points[i] = Mix(points[i] * turb, points[i], amt); } //Wavy Turbulence if (bc->GetLong(SPACEROCK_NOISE_TYPE) == SPACEROCK_WAVY_TURBULENCE) { points[i] = Mix(points[i] * wavturb, points[i], amt); } //Noise if (bc->GetLong(SPACEROCK_NOISE_TYPE) == SPACEROCK_NOISE) { points[i] = Mix(points[i] * noise, points[i], amt); } } //SUBDIVISION Real subAmount = bc->GetReal(SPACEROCK_SUBDIVISIONS); bc2.SetBool(MDATA_SUBDIVIDE_HYPER, TRUE); bc2.SetLong(MDATA_SUBDIVIDE_SUB, subAmount); bc2.SetReal(MDATA_SUBDIVIDE_ANGLE, pi); mcd2.bc = &bc2; mcd2.op = polyCube; mcd2.mode = MODIFY_ALL; mcd2.doc = hh->GetDocument(); if(SendModelingCommand(MCOMMAND_SUBDIVIDE, mcd2)) { GePrint("done"); } else { GePrint("failed"); }
My results are okay but I would like to get a more detailed and fine noise look. Do you have any tips on how to improve the way I am affecting the object with the noise functions. This is how my object looks right now with noise applied.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2010 at 10:57, xxxxxxxx wrote:
well, i guess you first need to create more faces to get more details. than you could apply more layers of noise at different scales and coordinates.. or you simply add the detail using a nice mix of noises in the relief channel
cheers,
Ello -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2010 at 11:04, xxxxxxxx wrote:
Hi ello,
even when I subdivide the rock the noise still follows this broad pattern. as if it's not fully affecting each point. I would like the ripples and bumps to be on a smaller scale. Hopefully that makes sense.
Can you provide an example of layering the noise functions? I have tried to do this but don't seem to be getting success.
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2010 at 11:08, xxxxxxxx wrote:
does using the subdivide command actually add more polygons to the image?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2010 at 19:50, xxxxxxxx wrote:
okay so I'm getting some good results now but I want to add some bulges throughout the rock. Take a look at this image.
you can see that this particular spacerock is a bit too perfect. I want to use the noise functions to create som random buldges to the overall shape of the rock. Is it possible to apply noise to the whole rock? Does anyone have any thoughts on how I could accomplish these random bulges?
Would it work to create a random function and then iterate through the rock's points again and only apply noise to random points this time?
Thanks in advance.
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/06/2010 at 21:46, xxxxxxxx wrote:
you could use another noise and do something like if (noise>0.8) add certain ammount to point offset
plus, you should add different results to the x, y and z part of the points.. likeReal rmf1 = RidgedMultifractal(arr, 1 + points[i]*factor.x, 20, 0, 1)*strength.x; Real rmf2 = RidgedMultifractal(arr, 2 + points[i]*factor.y, 20, 0, 1)*strength.y; Real rmf3 = RidgedMultifractal(arr, 3 + points[i]*factor.z, 20, 0, 1)*strength.z; points[i] += Vector(rmf1,rmf2,rmf3);
hope this helps
edit: plus you really should use bools for the noise types so to make a mix off all of them