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 / Point command giving wierd results

Author
Message
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 11th Dec 2006 02:47
For AI, on ship (80) needs to move towards another (90). I used the following code to get 80 pointed at 90.

point object 80, object position x(90), object position y(90), object position z(90)

Sometimes, it points in the right direction, but more often than not, it points in a random direction.What did I do wrong?

Thanks for your help!

"There will always be evil, for, without evil, the good shall lose their virtue."
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Dec 2006 14:23
It's something else you are doing - that line of code is just fine

Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 12th Dec 2006 01:31
The wierd thing that I realized is that the object is moving in the right direction, as if it's pointed towards the other object, but it's pointed somewhere else. I saw something about fixing a pivot point. Should I do something with that?

"There will always be evil, for, without evil, the good shall lose their virtue."
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 12th Dec 2006 01:53
It's not always gonna know which side of the object to point from.

It's probalby right, but maybe the side of the model is doing the pointing.

-Mansoor Siddiquie

Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 12th Dec 2006 02:08
So does that mean that the "front" keeps changing? Is there a way to set the front?

Thank For Your Help!!!!

"There will always be evil, for, without evil, the good shall lose their virtue."
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 12th Dec 2006 07:00
First, make a simple program like so to figure out what is the "front" (this will be the side furthest from you).



Now, let's say that you have a model of a plain and it seems to be facing west. >.> To fix this, we need to alter the yaw and fix the pivot so that the modified orientation becomes the actual orientation.



Now it will be "facing" in the desired direction--you should edit it in your 3D modelling program and save it in the new orientation.



Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 12th Dec 2006 07:07
Maybe I should just post all the code:


sync on
sync rate 30

hide mouse

for i = 1 to 75
make object sphere i, 10
position object i, rnd(1000), rnd(1000), rnd(1000)
next i

make object box 80,1,1,3
color object 80, 1500

make object box 90,1,1,3
move object 90,10
color object 90,50505

color backdrop 0

`game loop
do

pitch object up 90, joystick y() / 100
turn object right 90, joystick x() /100
roll object right 90, joystick twist z() /100


set object to object orientation 80,90
point object 80, object position x(90), object position y(90), object position z(90)

if upkey()=1 then pitch object up 90, 180

move object 90, 5
move object 80, 5


position camera object position x(90),object position y(90),object position z(90)
pitch camera down 9
move camera -30
pitch camera up 9
set camera to object orientation 90


sync
loop

"There will always be evil, for, without evil, the good shall lose their virtue."
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 13th Dec 2006 06:49
Upon further testing, everything works untill I move the front object up or down. Does the point command not work in 3d? I'm trying to have one space ship face the other; how do I do that?

"There will always be evil, for, without evil, the good shall lose their virtue."
Ankillito
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Litigious California
Posted: 14th Dec 2006 01:08
Turns out I just needed to add:

set object rotation zyx 80

Thanks for the help though!

"There will always be evil, for, without evil, the good shall lose their virtue."

Login to post a reply

Server time is: 2024-11-26 05:44:30
Your offset time is: 2024-11-26 05:44:30