Itoo Software Forum
Forest Pack => Forest Pro (*) => Topic started by: allemyr on March 23, 2020, 07:29:11 PM
-
Hi Itoo.
I would like to ask if its powwible to random transform objects inside a Forest Pack object less then 1.0 value, like random rotate between -0.5 to 0.5 for example.
I can only write hole integeres but need something around 0.2 to 0.2 in rotation.
Thx in advance!
-
You can use custom Effect.
This will ranzomize Z axis from -0.5 to 0.5 degrees:
fpItem.rotation.z = degtorad(randomReal(-0.5,0.5));
-
Hi, Thank you very much works great!
What would the same be for translation in small amounts don't what to write instead of degtorad, value?
-
You can use already existing effects for that:
(https://i.imgur.com/26R6aSZ.png)
-
Hi, I would like to randomly translate items say 0.5 values in the Z direction how do I do that?
I'am working on a brickwall with Forest Pack right now, placing bricks in spline vertex positions.
-
Hi
You can use "Translate in world units: effect and specify exact units in cm:
(https://i.imgur.com/cwWtcly.png)
Hope this helps.
-
Hi again, thx for the repleis, helped a lot!
I also wonder If you on top of that can move random items 180 degrees to get more random bricks that I'am rendering right now. So a brick is rotated zero or 180 degrees in any axis, is that possible?
-
Hi, There is another built-in Forest Effect called Stepped rotation that should be able to do that for you. You can see a little more about it here: https://docs.itoosoft.com/forestpack/forest-plugin/effects/effects-examples/stepped-rotation
You can add as many Forest Effects as you need
Hope that helps,
Paul
-
Ok cool! Thats nice, I found the premade effect. But I also want to add it in Y and X axis.
When I paste the expression in the expression box I get compile error.
I'am pasting this:
real rotateRange = fpItem.randRotMax.z - fpItem.randRotMin.z;
real stepsInRange = floor(rotateRange/Z_Rotate_Step);
real ZRotation = randomInt(0,stepsInRange)*Z_Rotate_Step;
fpItem.rotation.z = degtorad(ZRotation);
I want to rotate randomly in 180 degrees to get more variation off bricks in all axis. I'am also rotating all the bricks with a value of 0.5 in all axis aswell, will that be overridden by "Stepped rotation"?
Thx in advance :) Really appriciate it!
-
Compiler stops at unidentified variable. You need to define it first:
(https://i.imgur.com/dESOYxc.png)