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.

Newcomers DBPro Corner / Problem with 3d model facing directions...

Author
Message
DevilLiger
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 24th Oct 2004 05:05
so my problem is that i don't know how to face the 3d model in different directions, but i only know how to make him move in different directions without him facing another direction. so the question is that how can i make my 3d model walk in different directions?
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 24th Oct 2004 18:21 Edited at: 24th Oct 2004 18:24
If I understand your question correctly, then you want to move an object around in a direction other than the one it is facing.

If that is correct then this code should help you.



Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 24th Oct 2004 21:04
To me it sounds like you are asking hot to rotate an object. To do this I created a variable to store the objects yrotation. I would increase or decrease the variable and rotate the object to the value of the value when the left key or right key is pressed.



Aku Soku Zan
DevilLiger
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 25th Oct 2004 12:13
i was wondering how can you make him also face another direction and start walking on that direction when pressed and after releasing the button he'll stop walking and those stuff.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 25th Oct 2004 12:38
There are basic examples of this that come with DB, please look at those. If you have any questions that aren't covered in the examples, then ask. Or, if you can't figure out a specific part of the code, ask.

Xander Moser - Bolt Software - Firewall
DevilLiger
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 25th Oct 2004 12:41
sorry i don't have the actually thing im just trying to using the trial version so i don't really have much tutorials to look at except whatevers on the net.
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 26th Oct 2004 22:36
YROTATE OBJECT
This command will rotate the specified 3D object around the Y axis dimension. The object number should be specified using an integer
value. The rotation angle should be specified using a real number.

SYNTAX
YROTATE OBJECT Object Number, YAngle

NOTE:
Using this to move an object, you have to increase the current angle
using object angle y(object number)

for example:

yrotate object object number,object angle y(object number)+1

The +1 can be changed to the amount of change negative or positive that you want to rotate to object

NOTE 2:

You can also rotate along the x and z axis by replacing the y's with either x or z

Hope that helps

Daniel

*For every problem you come across you gain something from correcting it, I hope.
Xander
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 27th Oct 2004 15:01
Oh, sorry...I guess I didn't think of that.

To make an object "look" in a direction, you set it's angles by rotating it. Use the rotate object command, or the individual xrotate, yrotate, and zrotate commands.

EX:

rotate object 1,0,50,0

yrotate object 1,45

To make it rotate in your program, you add values to its angle based on the keypresses. For example, put this in your main game loop:



To move your object, you can use the move object command or the position object command. The move object command will move it "forwards" a specified amount, depending on the angle that the object is facing. Using the position object command will let you position the object anywhere you want in 3D space. Use this command in your loop to constantly update the object's position, depending on the keypresses. For example, put this in your main game loop:



Is that helpful? Good Luck with your game

Xander Moser - Bolt Software - Firewall
DevilLiger
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 30th Oct 2004 13:51 Edited at: 30th Oct 2004 13:52
what about if i want him to move in any direction like diagonal or what about when your trying to make him move in another direction while your already moving. so that way he changes direction when he's already going in another way. I hope this is DB Pro code im using.
Sir Ollie
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location:
Posted: 6th Nov 2004 17:00
meng thao

look at the monster hunt tuts. i've found one that looks a bit like what you want

http://developer.thegamecreators.com/?f=t01/3d_tutorial_4

copy and paste the first chunk of code into dbp and run it.

hope it's right!
Ollie

"Use the force you must..."
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 6th Nov 2004 17:17
is this what you want ?

run this code in DBP:





Do you need a complete FPS,3rdPS engine ?? Or a collision command libary?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0

Login to post a reply

Server time is: 2024-11-27 15:47:11
Your offset time is: 2024-11-27 15:47:11