Great presentation! It's very interesting when I see some animals
walk around. It seems like blender makes the animation of animals, but
can we use javascript to generate animation in real time(just
movement)? Currently, I just connect an function using "
frame.Updated.connect(updates);" and define the updates function like
below:
function updates()
{
var rot = me.placeable.transform.rot;
var scale = me.placeable.transform.scale;
var pos = me.placeable.transform.pos;
if (tarpos.x > pos.x)
pos.x = pos.x + moveSpeed;
else if(tarpos.x < pos.x)
pos.x = pos.x - moveSpeed;
if (tarpos.y > pos.y)
pos.y = pos.y + moveSpeed;
else if(tarpos.y < pos.y)
pos.y = pos.y - moveSpeed;
if (tarpos.z > pos.z)
pos.z = pos.z + moveSpeed;
else if(tarpos.z < pos.z)
pos.z = pos.z - moveSpeed;
if (tarRot.x > rot.x)
rot.x = rot.x + rotSpeed;
else if(tarRot.x < rot.x)
rot.x = rot.x - rotSpeed;
else if (tarRot.y > rot.y)
rot.y = rot.y + rotSpeed;
else if(tarRot.y < rot.y)
rot.y = rot.y - rotSpeed;
else if (tarRot.z > rot.z)
rot.z = rot.z + rotSpeed;
else if(tarRot.z < rot.z)
rot.z = rot.z - rotSpeed;
me.placeable.transform = new Transform(pos, rot, scale);
if(tarpos.Sub(pos).Length() <= 0.1 && tarRot.Sub(rot).Length() <=
0.3)
{
entity.placeable.transform = new Transform(tarpos, tarRot,
scale);
}
}
Reset the object's transform every frame. seems not a good way to do
that. :) So, do we have some better way to make an movement?
Thank you!
Zhao
On Dec 16, 6:07 am, Toni Alatalo <[email protected]> wrote:
> is up on youtube, thanks for the bconf folks - i posted about it to
> thehttp://www.realxtend.org/blog
> ..http://realxtend.wordpress.com/2011/12/16/tundra-and-blender-integrat...
>
> will need to install blender2ogre on more computers and configure it fully
> for the nice integration to work etc., has been really nice to have at hand
> -- thanks Brett for the work, and help with preparing the demo too!
>
> ~Toni
--
http://groups.google.com/group/realxtend
http://www.realxtend.org