Question about B3D models...

Blitz3D Forums/Blitz3D Programming/Question about B3D models...

OrcSlayer(Posted 2004) [#1]
I've got most of the framework for my game finished, so now I need to figure out how to pull this off before I tell my modeler to get to work...

In my game, I want to be able to pitch the torso of the player model by 45 degrees, up or down. I don't want to use an animation for this, I want it to be possible regardless of what animation is playing (running, standing, etc). I assume this will require bone manipulation, however I'm not sure exactly how to go about doing this. I've seen people do similar things with Blitz before, unfortunatly I've never gotten to look at the source code for those projects.

Just FYI, the purpose of this is that the player will have a somewhat GTA like autoaim, that will detect the nearest enemy in a 90 degree cone in front of the player, rotate him or her to face the enemy, then pitch the torso if the enemy is above or below the player so it looks like you're really aiming at the target, instead of strait ahead. Seems simple enough to me, and I have the code for the auto-aiming system down, but I wanted advice from more seasoned coders before I start messing with mesh manipulation.


Bot Builder(Posted 2004) [#2]
I dont have blitz help open atm, but there should be a command like "find child" thant takes a string and finds the child entity named that. So, you simple find child on your animated entity with the name of the torso bone. Then, just rotate that entity as you wish.


OrcSlayer(Posted 2004) [#3]
Hmmm, I was thinking that would be the simplest way to do it, but I heard that wouldn't work if the mesh was animating...perhaps it will, I'll try it. Thanks, I'll let ya know if it works.


OrcSlayer(Posted 2004) [#4]
Well, rotating the bone itself doesn't seem to work. You can attach objects to bones easily enough (weapons and such), but rotating the bones manually seems to have no effect on the mesh. I know I've seen this done before, there has to be a way...


Sunteam Software(Posted 2004) [#5]
Have you tried it on a static mesh (no anim data)? If that works you know you can't do it with an animated mesh. Just a thought :)


Ricky Smith(Posted 2004) [#6]
http://www.blitzbasic.com/codearcs/codearcs.php?code=660

http://www.blitzbasic.com/codearcs/codearcs.php?code=655


Here's 2 examples ! As Bot Builder says but you must manipulate the bone after UpdateWorld. This overrides the animation. Using this method you can also blend more than one animation sequence at a time.


OrcSlayer(Posted 2004) [#7]
Hmmm, got the demo to work, does exactly what I needed done! Thanks a lot for the info, you've been a big help guys!


jhocking(Posted 2004) [#8]
Clarifying Smiff's comment, bones snap to the animation when UpdateWorld is called. So moving a bone before UpdateWorld accomplishes nothing, while moving a bone after UpdateWorld (but before RenderWorld) will be visible.