User avatar
By deadalvs
#205675
hmm... well, they should be put right onto the surface.

in the example i posted, i dragged the nurbs ground a little down. but You can control that with the y-offset number...

maybe You misinterpreted this setting ? the y-offset defines, how much above the ground, the plane will be placed. if You enter 0, then the pivot of the plane should be placed right on the surface.

but i have tried that once, now i remind, that they were all placed a little too low and i did not know why exactly... i'll check again.
User avatar
By deadalvs
#205676
i could also script that objects are aligned to the surface's normal at the specific point, but i really have no time to do this all...

i'm in the middle of finishing my semester project ...

i'll see if i can update the stuff in reasonable time.
User avatar
By deadalvs
#205693
SunlightRocker... can You post an image with the visible settings ?

ummm... did You correct the position of the poly-plane's pivot point before copying?
User avatar
By deadalvs
#205748
Version 3

http://www.jumpgates.com/matthias/MEL/G ... ier_V3.zip

updated:

- x, y and z rotations can be accessed
- x, y and z offsets can be accessed
- all grass fibers are cast into one group after being created

still to go after:
- scattering onto polygons (idea how to solve the problems already exists, HA!)
- why objects are sometimes placed too low (no idea why!)
- speed
User avatar
By deadalvs
#205750
i found out that objects are being placed correct, when the cvs only are moved to the right «pivot position» instead of editing the object's pivot.

i don't know why this doesn't work properly...

* * *

the part of the script that «places» objects:

setAttr ($currentSel + ".translateX") ($vectorP1.x + $xOffset);
setAttr ($currentSel + ".translateY") ($vectorP1.y + $yOffset);
setAttr ($currentSel + ".translateZ") ($vectorP1.z + $zOffset);

has anyone an idea ?
User avatar
By deadalvs
#205763
Version 4

http://www.jumpgates.com/matthias/MEL/G ... ier_V4.zip

updated:

- polys can be selected to scatter objects onto. ONLY meshes with QUADS and TRIANGLES supported. n-gons will be ignored.

note: since the polygon area can not be directly accessed, the script must randomize based on face number and the related cvs. in this version of the script, faces with 3 and 4 cvs are differentiated and each point gets a kind of «force» to drag the copied object to it. thus, the coordinates of the duplicated object is calculated based on the sum of these forces. since these forces are linearly calculated, the resulting form of grass planes shows «clumping» in the middle of the polygon.

i'll have to figure out a better scattering «algorithm» inside each face to get a more even distribution.

still to go after:
- scattering onto polys to improve
- why objects are sometimes placed too low (no idea why!)
- speed

* * *

i thought i'd speed up my progress with this script so You guys can use it... it's 3 a.m. now... :)

good night !
User avatar
By SunlightRocker
#205778
Great work deadAlvs. Except for the problem you already have, I noticed, one polygon is always left out, getting no grass on it. I guess its always the last or the first polygon on the ground plane... Noticed?

Hehe, I just got another wish. Is it posible to have the placed grass (or whatever) facing straight out from the object? Like the normals?

So, if you have a sphere, and scatters spikes onto it, you will have a spike-ball. That would be great. :D

// Tobias
User avatar
By deadalvs
#205813
no, i did not notice... thanks for the BUG !!! :)

yay i have a BUG to kill !! *lala*

* * *

i know pretty exactly where to find this problem, must be the for-loop.

* * *

yeah, the normals. i mentioned that above... i'll do that when i have time...
User avatar
By deadalvs
#205816
so it's this new list then:

still to go after:
- normal orientation for polys and nurbs
- scattering onto polys to improve
- why objects are sometimes placed too low (no idea why!)
- speed

bugs:
- one poly is left out with grass
User avatar
By deadalvs
#205818
come on guys !

show some renderings !!! :)

my tests look great !

and that image was only done with one 4K floor texture and the standard grass patch by thxraph !

Image
User avatar
By deadalvs
#205820
Version 4.1
http://www.jumpgates.com/matthias/MEL/G ... r_V4.1.zip

updated:
- all polys get grass

still to go after:
- normal orientation for polys and nurbs
- scattering onto polys to improve
- why objects are sometimes placed too low (no idea why!)
- speed
- overall script layout and GUI

bugs:
-

bugyard:
- last polygon in the mesh got no grass
User avatar
By SunlightRocker
#205853
I dont know why no one posts here, cuz I think the work you are doing is fantastic. Im really in need of this script.

Im gonna show you some render when I have some to choose. :) Maybe tomorrow.

Thanks again deadalvs, great work.
User avatar
By deadalvs
#205886
SunlightRocker wrote:I dont know why no one posts here, cuz I think the work you are doing is fantastic...
thanks a lot... :oops:

i'm using spare time i don't have... :?
User avatar
By SunlightRocker
#205944
:)


Hey, I just came to think of one thing. If you get rid of that clumping-thing, can you please keep it as an option, like "polygon-clumping". I think its quite usefull. :)

btw, still the same request over and over but, rou[…]

So far my only option was to ungroup (my group wa[…]

Thanks Miguel I know 5.2+ is a big development hi[…]

SketchUp 2021 Update

Hi Alberto, Many thanks for taking the time to ma[…]