Page 2 of 4

Posted: Thu Jan 18, 2007 3:15 pm
by deadalvs
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.

Posted: Thu Jan 18, 2007 3:40 pm
by deadalvs
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.

Posted: Thu Jan 18, 2007 5:25 pm
by deadalvs
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?

Posted: Fri Jan 19, 2007 1:23 am
by deadalvs
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

Posted: Fri Jan 19, 2007 1:35 am
by deadalvs
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 ?

Posted: Fri Jan 19, 2007 4:06 am
by deadalvs
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 !

Posted: Fri Jan 19, 2007 9:16 am
by SunlightRocker
Wow. You work fast. Great job. Im gonna try it out right away.

Thanks alot.

Posted: Fri Jan 19, 2007 9:33 am
by SunlightRocker
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

Posted: Fri Jan 19, 2007 12:30 pm
by deadalvs
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...

Posted: Fri Jan 19, 2007 12:34 pm
by deadalvs
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

Posted: Fri Jan 19, 2007 12:44 pm
by deadalvs
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

Posted: Fri Jan 19, 2007 1:10 pm
by deadalvs
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

Posted: Fri Jan 19, 2007 7:27 pm
by SunlightRocker
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.

Posted: Fri Jan 19, 2007 10:21 pm
by deadalvs
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... :?

Posted: Sat Jan 20, 2007 12:47 pm
by SunlightRocker
:)


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. :)