Quote: "You could glue hidden objects which have the same geometry and UV coordinates as the animated mesh to each limb of the character and then use sparky's on those objects."
How would that help? Wouldn't you just have the same problem?
Quote: "I think that I read somewhere that you have to allow object scaling in Sparky's, to support animated models."
That improves matters but the collision point doesn't seem to move correctly with the object. Here's the code I used (it uses the "tiny.x" model from the MS DX SDK). The long thin box represents the raycast.
set display mode desktop width(), desktop height(), 32
sync on : sync rate 60 : sync
autocam off
position camera 0, 100, -500
point camera 0, 100, 0
load object "media/tiny.x", 1
set object speed 1, 500
loop object 1
sc_setUpComplexObject 1, 0, 2
sc_allowObjectScaling 1
make object sphere 2, 10
color object 2, rgb(255, 0, 0)
` create ray cast object
xTest1# = -60
xTest2# = -60
yTest1# = 50
yTest2# = 50
zTest1# = -500
zTest2# = 500
make object box 3, xTest1# - xTest2# + 3, yTest1# - yTest2# + 3, zTest1# - zTest2# + 3
position object 3, (xTest1#+xTest2#)/2, (yTest1#+yTest2#)/2, (zTest1#+zTest2#)/2
color object 3, rgb(0, 0, 255)
repeat
sc_setUpComplexObject 1, 0, 2
hit = sc_rayCast(1, xTest1#, yTest1#, zTest1#, xTest2#, yTest2#, zTest2#, 0)
x# = sc_getStaticCollisionX()
y# = sc_getStaticCollisionY()
z# = sc_getStaticCollisionZ()
position object 2, x#, y#, z#
text 20, 20, "hit = " +str$(hit) + " fps = "+str$(screen fps())
if hit then text 20, 40, " hit at X, Y, Z = "+str$(x#,2)+", "+str$(y#,2)+", "+str$(z#,2)
if hit = 0
hide object 2
else
show object 2
endif
sync
until spacekey()
end
@TheComet
Neat demo.