Linepick animated mesh

Blitz3D Forums/Blitz3D Programming/Linepick animated mesh

LamptonWorm(Posted 2008) [#1]
Hi,

Ok - first, sorry as I know this is a topic that has been done a million times, but I'm having problems, is there a way to pick an animated .b3d file? I don't belive there is. I don't mind if it is an external DLL or whatever but it would be nice to be able to do it!

I tried the 'use a DirectX model, set all children to use pickmode' approach but I couldn't get that to work either, but it may be the model setup (using the freebeast.x from here, http://www.psionic3d.co.uk/gallery/displayimage.php?album=2&pos=0), as checking for children only comes back with 1 result.

What I'm trying to achieve is if a bullet hits an animated mesh.

Other methods I've heard of are changing the color of the mesh and checking the pixel color at the right position, seems an interesting approach if anyone has a demo.

Again, sorry for asking this question again, I spent a while searching the forums with various results. If there is a definitive can/can't do list with solutions and demos that would be fantastic ;)

Cheers,
LW.


t3K|Mac(Posted 2008) [#2]
you can always parent some cubes/spheres/whatever to the model's bones. make them pickable and entityalpha 0 them.


LamptonWorm(Posted 2008) [#3]
Thanks, looking into that now.

By the way, I was being daft with .X collision using freebeast, I messed up my code - sorry guys. Using this function now btw which works a treat (for .x) ...

Function SetEntityCollision(m)
For i=1 To CountChildren(m)
ww=GetChild(m,i)
EntityPickMode ww,2
SetEntityCollision(ww)
Next
End Function

Cheers,
LW.


LamptonWorm(Posted 2008) [#4]
@t3k|Mac, might be an obvious question, but how do you find the bones as apposed to the joints?

The function I was using above finds joints. Guess I could find the middle of the bone to pos the col box by finding the middle between say 'elbow and wrist' joints, use the dist between the joints to set the length etc.

[EDIT] I just tried this and I've now got col boxes for various limbs, on an animated .b3d that I can linepick against, thanks all.

Cheers,
LW.


t3K|Mac(Posted 2008) [#5]
your welcome ;)


Ross C(Posted 2008) [#6]
For a FPS, the colour idea is a very good one. Grab the mouse position, then readpixel/fast on that part of the backbuffer. Wouldn't work for slow moving bullets though...

Good suggestion though t3k, is works well :o)