Rotate MD2 and keyboard response slow

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kabutor
Posts: 3
Joined: Mon Jul 26, 2004 9:34 am

Rotate MD2 and keyboard response slow

Post by kabutor »

Hi

Im new here, just buliding a small game about ships and sea and two problems at the moment, some help be really apreciated.

I have a terrainoctree and a ship model (an MD2 file I made of a ship)

1- when I rotate the ship it rotate with the axis of rotation in the top of the model, inestead of rotating in the middle of the ship, so the movement is a bit strange, I dont know if thats a problem with the md2 or with the code, I suppose each model should have a center and I dont know where to set it, if in Blender or in the irrlicht code.

2- When I press a key, the response is really slow, it moves rotates etc, but it takes a second or half a second until it starts moving, Im just using the code form the tutorial Movement, and the fps are quite high, 300+ so I dont know why is that slowness...

Im not english native speaker so pardon me for any mistake and thanks :)
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Re: Rotate MD2 and keyboard response slow

Post by thesmileman »

Hi,

For question 1: You need to change the model's pivot point in your 3d application that it came out of. Irricht considers the models pivot as the center of its world so everything will happen from the pivot point: roatation movements etc.

For question 2: I would not recommend searching the forum for a post that is quite old by keless that explains how to do keyboard input smoothly. It is very good and has worked quite well for me as well as others.
Guest

Post by Guest »

ok, I changed the pivot point in blender and re-export it and it worked.

Also I read that post, now the movement is really smoother, but another problem raises, the movement is way too much fast than before... I suppose that the movement is attached to the fps (as the acting code is now in the main loop section) so in SDL there is an SDL delay to limit the fps, how can i achieve that in irrlicht?

Any irr:delay :)

Thx again for the replys
kabutor
Posts: 3
Joined: Mon Jul 26, 2004 9:34 am

Post by kabutor »

^^^That was me, Wasn't logged :roll:

EDIT: well I managed to slow down, with fractions numbers in the :

v.Z += 0.3f;

thingie that makes the movement, but still wanted to cap the FPS, ill search in the forum. :wink:
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post by thesmileman »

use a timer function and a conditional call to the device->drawall() funcation.
Post Reply