Suggestion: Combiner device with arbitrary math expressions?

Hi all,

I’m currently trying to create an island with WM, essentially using the approach described at http://world-machine.com/forum/viewtopic.php?t=49 , that is, creating the island by combining component terrains, e.g. one for beach, one for woodland, one for mountains, etc.

Well, for that purpose, it would be great if the combiner device was able to parse arbitrary mathematical expressions.
For example, the following predefined variables could exist:
h1 height of input terrain 1 (a scalar between 0 and 1),
h2 height of input terrain 2 (a scalar between 0 and 1),
h3 height of input terrain 3 (a scalar between 0 and 1),
hn height of input terrain n (a scalar between 0 and 1),
p1, p2, p3, … parameter values (the “strength” in the existing Combiner).

Then, another Combiner method could exist with name “Math Expr.”, where one could freely write e.g. h1 + (h2-0.5)*0.123 to obtain the Combiner output.

It would even be possible to replace all existing Combiner methods with pre-made expressions. For example:
Average: p1*h1 + (1-p1)*h2
Add: h1 + p1*h2
Sub: h1 - p1*h2
Multiply: p1*h1 + (1-p1)h1h2

Just a suggestion. :wink: Being able to enter math terms directly would be a great help when one has a precise idea or definition of the desired output.

This is definitely an interesting idea. It strikes me as a good (almost exercise-like) project for someone to create as a WM plugin. If you included the basic higher functions (trig functions, exp/log, etc) and wrote a solid expression parser you could do a lot of experimentation in context-insenitive terrain shaping/combining.

Yeah I agree this sounds like a prime candidate for a plugin author. Anyone? Anyone? :smiley:

  • Oshyan

Oshyan, you’re not insinuating anything, are you? :wink:

Stephen, Just a question… Won’t such a plugin be replacing the existing combiner device, if well developed? That is what worries me.

Also, such a formula parsing code could see some use in other devices… Like a Math Expression scalar device… no?

Such a math device would be useful in general… also for integers.

I would not like to see the normal Combiner replaced by this unless this device had a very good setting storage system and the ability to have a certain number of “most used” expressions accessed through buttons in the main device config. So that you could still easily select the standard combiner operations by default but would also have access to additional possibilities.

  • Oshyan