I feel sure I'm missing something obvious.
I want to create and align a simple shadow quad under a tree, then AddMesh it as part od a larger 'shadow' mesh.
The tree will always sit on a known triangle.
How can I (a) get the slope of the triangle's surface and (b) align the quad to that slope?
Currently the shadows are not aligning to the slope of the triangle below.
This is the code I'm using:
indshadow = CopyMesh(mastershadow)
FitMesh indshadow, x1,y1,z1, x2,0.001,z2, True
ScaleMesh indshadow,newscalex#,1,newscalez#
LinePick(treex#,treey#+10,treez#, 0,-20,0)
AlignToVector indshadow,PickedNX(),PickedNY(),PickedNZ(),3,1
PositionMesh indshadow,treex#,treey#+0.1,treez#
AddMesh indshadow, treeshadowmesh
FreeEntity indshadow
I want to create and align a simple shadow quad under a tree, then AddMesh it as part od a larger 'shadow' mesh.
The tree will always sit on a known triangle.
How can I (a) get the slope of the triangle's surface and (b) align the quad to that slope?
Currently the shadows are not aligning to the slope of the triangle below.
This is the code I'm using:
indshadow = CopyMesh(mastershadow)
FitMesh indshadow, x1,y1,z1, x2,0.001,z2, True
ScaleMesh indshadow,newscalex#,1,newscalez#
LinePick(treex#,treey#+10,treez#, 0,-20,0)
AlignToVector indshadow,PickedNX(),PickedNY(),PickedNZ(),3,1
PositionMesh indshadow,treex#,treey#+0.1,treez#
AddMesh indshadow, treeshadowmesh
FreeEntity indshadow