MelonBP

Mushroom Generate Command

May 26th, 2020
2,064
0
Never
5
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. # Mushroom Generate Command | by MelonBP
  2.  
  3. This command procedurally generates a mushroom inside your selection. There are 3 variables (h, u, v) in the command that allow you configure the shape of your mushroom. These variables are assigned values at the beginning of the expression, and to change them just adjust the numbers to your preference.
  4.  
  5. ## The command:
  6.  
  7. //g [pattern] h=0.5;u=0;v=0;sqrt((x+u*((y+1)/2)^1.5)^2+(z+v*((y+1)/2)^1.5)^2)<=1.8*sqrt(1-y)/(y+2)/(2*h+e^(-40*(y-1+2*h)))+0.1
  8.  
  9. ## The variables:
  10.  
  11. * 'h' controls the proportional height of the mushroom cap. For example, h = 0.5 generates a mushroom whose cap fills the top half of the total height, and h = 0.25 generates one whose cap fills the top quarter. I recommend h-values between 0.1 and 0.75.
  12.  
  13. * 'u' controls the "curve" along the x-axis, and 'v' controls the "curve" along the z-axis. Values of 0 for these variables means there will be no curvature in that direction, positive values mean curvature in the positive direction, and negative values mean curvature in the negative direction. I recommend values between -0.5 and 0.5 for either of these two variables.
  14.  
  15. ### The nerd shit:
  16.  
  17. If you read the explanation for the onion generator (link for that: https://pastebin.com/QfJYNZQB), this command works in a very similar way. Instead of the "onion function", though, there's a "mushroom function" (graph: https://www.desmos.com/calculator/yxovk0mfwu), which is a function of the generated y-coordinate and the variable 'h'. 'u' and 'v' are scalars of an offset to the center of the "cylinders" as a function of the generated y-coordinate.
  18.  
  19. Sorry for being so brief here, but I have a math test in 4.5 hours at the time of writing this, and I developed this mushroom command tonight instead of studying.
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment