PDA

View Full Version : Surface following and NURBS


Jhavna
11-10-2004, 03:21 PM
I'm working on my grass generator script (http://www.cgtalk.com/showthread.php?t=185227) and have found a problem with the surface following.
When a blade is planted, i want to plant it just below the surface (so it's properly in the surface even on slopes).
I work out the amount I have to move the blade down using some trig and the grass normal (always 0,1,0) and the surface normal of the nurbs surface at that point. (should be easy to see from the script)

What I found is that the values I expect aren't coming out. The grass seems to float above the plane at certain points where there's a bump in it, and be too low at other points. However, if I then convert the nurbs plane to a poly plane, the grass sits there pretty much perfectly [or how I want it].

It seems that to make it work properly, I have a few options, either push the blade down a fixed amount (to ensure it's below ground at all slopes), increase the factor I multiply the angle (between grass normal and plane normal) with, or convert the NURBS to a poly once the blades are created.

I am using NURBS to start with, as it was easier to get position information from random points along the surface.

Anyone have any advice or another method to follow a surface properly?

I mean, as the script is now, it's ok.. it just looks a little odd with blades protruding at different lengths under the surface, but I guess you wouldn't see that in the final render.

Buexe
11-10-2004, 06:47 PM
Have you tried the Rivet script from highend3d ? I think it does a pretty good job putting things on a nurbsPlane in a way that they stay there and don`t float around like when you use a geometry constraint.

CGTalk Moderation
01-19-2006, 08:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.