Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How can i make objects (e.g. humans) walk around correctly?

Author
Message
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 29th Jul 2008 13:34
Hi,
I have a DirectX-File with a human, that has a boned animation.
So far it's working correctly.

But when I want that human to walk around in my city it just walks straight. When there is a wall it walks through and the human is away....
I'm using this code so far:
That's how I load the human (DirectX-File)

Thats how I let the human walk in the While-Loop

I've already tried to let the human Turn at the Y Axis that it walks a circle, but when i use this...:

...it's the same result like the first code.
Why is it not rotating at the Y-Axis?

Do you have any ideas?
I'v read the GDK-Documentation and searched for functions, but found nothing...

kind regards
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 29th Jul 2008 21:19 Edited at: 29th Jul 2008 21:22
Hi
firstly:
why do you say dbMoveObject ( 1000, -1 );?
why not dbMoveObject ( 1000, 1 );?
since now it is moving backwards... it doesnt really make a difference but I am asuming that your model is loading the wrong way around... to fix that you can say: dbYRotateObject(1000, 180) and then use dbFixObjectPivot(1000); do this when you load you model.
- assuming you have this problem

and then...

dbYRotateObject (1000, 80 );
is the right way to rotate it like you want to. But remember, the 80 is not an amount like in dbMoveObject, it is more like a float angle from 0-360 relative to the object's y-axis (as far as I understand it). So you are constantly telling it to rotate 80 degrees, see the problem? instead do something like this:



This will rotate it clockwise, for anti use rotate--;

if you wanted to rotate the object with the left and right keys for example:



now the reason it is walking through the walls is because there is a not colision code as far as I can tell. That is a whole other can of worms....
MES
16
Years of Service
User Offline
Joined: 9th Feb 2008
Location: AFK
Posted: 30th Jul 2008 19:28
Thank you very much for your codes. That helped me a lot!


I don't know why, but when i use a positive number, it walks backwards, even if i use dbFixObjectPivot(1000);


I already use that for the Camera (first person), so that makes no sense.


I've already tried to manage that with the old code, but it didn't work...
And with the new Code:

It's also walking straight through the Object (0=Camera)
And: I do not only want the Object(1000) not to walk through the Camera(0), also through other Objects(0-100), so:

read comment..

Thank you very much for your help so far!

kind regards

Login to post a reply

Server time is: 2024-11-20 17:44:44
Your offset time is: 2024-11-20 17:44:44