|
 |
Mike Horvath <mik### [at] gmail com> wrote:
> 1. How do I make it so that the probability is lower depending on the
> slope of the terrain? This should vary depending on the type of
> object. For instance, the sphere might not like a high slope. The
> spike might not care very much.
I just took a brief look at this.
Since your objects get placed using a loop, you can add conditionals and
multipliers.
So maybe have a rand value selecting for each type of object. Using #switch,
you can do object-specific things like define values, orientation, etc.
In each block of object code you can simply do a calculation on the slope to see
if it's a good value. If it is, you can just use another rand value and if it's
below a certain threshold, then place your object. #if (RandVal < 80) object
{Object} #end Would place it 80% if the time.
There's a terrain scale that gets used to adjust other calculations in the
scene. That ought to make the fairly code size independent.
Looks like everything is at the origin, so you'll have to do it and then
translate, or translate to the origin, do it, and then translate back.
That's all I picked up / thought up on a quick read-through.
Post a reply to this message
|
 |