ok, here we go sorry, I have to bother anyone with this, but: if there are people outside to whom it is err kind of pleasure?!? or maybe it is worth a big lol to have a look at a completely amateur script.. well: my situation is that I am not a programmer, never was, I met mel 2 weeks ago and I desperately need help on this one! so this should be a script using a simple vector formula and should give me in the end some generations of points, arranged in 3d kind of a confused decision tree ... instead of building the generation step for step, I decided to use sphrand as vector function
well, here it is:
//proc tree with recursion
proc tree(vector $vector_gen, int $points) { vector $ep; // endpoint
vector $addvec = sphrand(rand(2,10));
$ep = $vector\_gen + $addvec;
curve -d1 ($vector\_gen.x) ($vector\_gen.y) ($vector\_gen.z) $ep ($ep.x) ($ep.y) ($ep.z);
Sphere -d1 ($ep.x) ($ep.y) ($ep.z) -ax 0 1 0 -ssw 0 -esw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -nsp 4 -ch 1; //syntax ok?
int $maxpoints = 9; //zahl austauschbar
if ($points > $maxpoints) break; //need break? but. only in use with while & for possible...
//rekursion
$points++;
tree($ep);
}
select -all; delete;
vector $startP = <>; tree($startP, 0); // number changeable
ok, so dont laugh , it is my first script after helloworld, I would be pleased if you could help me with this!!! but please dont ignore what I 've already written, just how to change syntax correctly? or what to do with the break? how to make it run so it would give optically a decision tree??? big SOS
QUOTE(Joojaa @ 01/29/06, 04:38 PM) [snapback]226527[/snapback] mnake the proc return a int. and then usse if something return 1; and it will quite the recursion. Aslos by the way you have bad habit of using a global wavr pass it to your script too.
well ok, but that is a possible way for the counter.. IF I am able to write it..*g but: I think there is much more in the syntax not working... and to me it is not easy to correct (my own stuff, yes, I admitt)
*g well u didnt see my desperate thoughts bout this decision tree script really new to mel and scripting - every action seeming to you very short is a long quest for me, I suppose:-)
ok, I'll try with your suggestions...
now I'll try to go for more of the rendering of that strange space decision tree for human behaviour to choose one or another planet or..well dunno...