finally i had a few days to continue this project. it takes a LOT of time to do the scripting of such a beast...
watch here what's waiting:
we know the basics, but now with a lot of new features. [only NURBS part yet, but most basics will be the same, so the poly part will take much less time]
idea: 4 different algorithms:
1[ use numer: enter a number of copies to be created
2[ use cvs: copy a copy to each cv position
3[ use numer per square unit: like 1[, but more intelligent, for example «2 tombstones per square meter». (takes also slope in account !)
4[ use UV grid: create a rectangular grid like shingles, ...
defines if a copy is created if the stipulations are fulfilled
(multiple selections possible)
automatically orients the copies based on the options
(only one option of «orient, point, turn» possible, of course)
in the end, after a copy is created, the values are randomized a little based on the options
* * *
the GUI and most of the needed commands (for example:calculate nurbs surface area, calculate triangle area, calculate normals, get material of face, check Slope of normal, ...) are programmed, but now comes the complex part.
maybe someone can help me.
i have a way to calculate the number of copies, but since every copy is based on a random number there have to be a lot of checks to be done before the actualy copy can be created. so i need a counter and some kind of infinite loop until the number is reached. efficiency is very important !
form of stipulations for a copy: [on a NURBS surface]
((in order of programming efficiency !! there's no reason in checking slope and uv range if the surface has the wrong color !))
1[ surface has the correct material (if option activated)
2[ texture brightness [0 to 1] is in the interval (if option activated)
((restricting the colors to white and using a black texture with only a few white pixels equals an infinite loop and causes the user to write bad posts here....))
3[ uv space is correct (if option activated)
4[ slope is correct (if option activated)
which could be the basic form of the loops going through these checks ?
any help appreciated...
* * *
• copy icicles only on surfaces facing down
• copy moss only on surfaces with the material «tree bark»
• place copies only on places with texture brightness (0 to 1) between 0.6 and 1. (great with noisy images or black-white maps.)
• copy grass blades only on places with slope of max. 36.78 degrees
• create fields of grass or forests that automatically face the active camera
• re-orient an array of selected objects to the camera, with re-randomizing the values based on the GUI values