HornBerger
01-17-2010, 08:26 AM
Goad: to make a spline conform to deformed mesh
Uses: to make a road on a "noisy" (plane with noise modifier on it ) terrain
idea01 : the dumb way :P
i made a spline path in the top view then i applied the normalize spline modifier so that i get more points on the spline while maintaining the shape of the curve (i used a setting of 5.0) next i applied a "Spline I.K. Control" modifier (my settings : link types = no linking ; press create helpers ) and that gives me a set of point helpers that can be used to deform the shape of the spline (similar to a linked xform modifier applied to each vert in the spline)
next i made a plane and gave it 32 length and width segments and applied a noise modifier that gave the ground surface to place my road spline on
next i shot rays from each of the point helpers in the road spline in the direction of the ground surface ([0,0,-1]) - my road spline is exactly above the ground surface - and where the ray intersected the ground surface i placed the point helper controlling the spline onto the intersecting point heres the maxscript for it :
for p in helpers do
(
myray = ray p.pos [0,0,-1]
col = intersectray $plane01 myray
p.pos = col.pos
)
this deformed the confoms the spline to the deformed plane
the problem with this technique is that if i modify the plane the spline doesnt change and if i loft a rectangle on the spline it doesnt stick to the surface
idead02: patch and surface deform
is there any other way of doing this ?? i have tried patch deform and surface deform but they only work for quad patches and nurbs also when i loft my spline after doing patch deform it doesnt loft about the deformed spline instead it lofts on the original spline :S ( i tried to convert to editable spline , group etc.. but no use :( ) so i tried to deform a box with patch deform but i need to first do a path deform on the box so it represents my roads curve after doing path deform on the box .. the patch deform modifier gives wierd results if applied to the box .... I am in deadlock ! s.o.s
any help is appreciated !!
Uses: to make a road on a "noisy" (plane with noise modifier on it ) terrain
idea01 : the dumb way :P
i made a spline path in the top view then i applied the normalize spline modifier so that i get more points on the spline while maintaining the shape of the curve (i used a setting of 5.0) next i applied a "Spline I.K. Control" modifier (my settings : link types = no linking ; press create helpers ) and that gives me a set of point helpers that can be used to deform the shape of the spline (similar to a linked xform modifier applied to each vert in the spline)
next i made a plane and gave it 32 length and width segments and applied a noise modifier that gave the ground surface to place my road spline on
next i shot rays from each of the point helpers in the road spline in the direction of the ground surface ([0,0,-1]) - my road spline is exactly above the ground surface - and where the ray intersected the ground surface i placed the point helper controlling the spline onto the intersecting point heres the maxscript for it :
for p in helpers do
(
myray = ray p.pos [0,0,-1]
col = intersectray $plane01 myray
p.pos = col.pos
)
this deformed the confoms the spline to the deformed plane
the problem with this technique is that if i modify the plane the spline doesnt change and if i loft a rectangle on the spline it doesnt stick to the surface
idead02: patch and surface deform
is there any other way of doing this ?? i have tried patch deform and surface deform but they only work for quad patches and nurbs also when i loft my spline after doing patch deform it doesnt loft about the deformed spline instead it lofts on the original spline :S ( i tried to convert to editable spline , group etc.. but no use :( ) so i tried to deform a box with patch deform but i need to first do a path deform on the box so it represents my roads curve after doing path deform on the box .. the patch deform modifier gives wierd results if applied to the box .... I am in deadlock ! s.o.s
any help is appreciated !!
