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.

DarkBASIC Professional Discussion / Pointing to same direction

Author
Message
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 26th Dec 2010 20:21
Hi!

It's me again , with a new question:
Pointing to same direction techniques.

So, i have an object number 1 and i create object number 10. How to make object number 10 point in exactly same direction as object number 1 .

Cheers!

~Kamac
Mulderman
22
Years of Service
User Offline
Joined: 8th Jan 2004
Location: C:\\
Posted: 26th Dec 2010 20:50
Why don't you read help files.
Its all there.

POINT OBJECT

This command will point the specified 3D object towards a point in 3D space.

Try this



New GTA2 Map Editor :: http://www.gta2madness.co.cc
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 26th Dec 2010 21:02
You didnt understand me right .

Let's say, my object 1 is pointed at SOME direction, that coords i dont know. I want object 10 to point in the same direction as object 1 .

Cheers!

~Kamac
Mulderman
22
Years of Service
User Offline
Joined: 8th Jan 2004
Location: C:\\
Posted: 26th Dec 2010 21:03 Edited at: 26th Dec 2010 21:04
My code does exactly that.
It gets object 1 position and assigns same values to object 10.

If you want to rotate it, then there are commands for that also.
You should read help.

New GTA2 Map Editor :: http://www.gta2madness.co.cc
kamac
15
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 26th Dec 2010 21:33
Gees... it doesnt do that. Look:

point object 1,x,y,z `will point object 1 in position x,y,z

point object 10, OBJECT POSITION X(1), OBJECT POSITION Y(1), OBJECT POSITION Z(1) `will point object 10 in position of object 1 not in position x,y,z.

Additionaly, i cannot type
point object 10,x,y,z because i cannot get the co-ords.. in my code, object 1 is rotated by xrotate object and yrotate object.


PS.

I solved it by rotating object 10 by same angles and x's+y's as object 1

Cheers!

~Kamac
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 26th Dec 2010 22:18 Edited at: 26th Dec 2010 22:19
Quote: "Let's say, my object 1 is pointed at SOME direction, that coords i dont know. I want object 10 to point in the same direction as object 1"


That doesn't make sense. If you don't know the coordinates of what you're looking at, you can't find the angle between it and two separated points. If you want both angles to be the same then just use the same angle.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 27th Dec 2010 00:05
If I understand you correctly, you want to match the angle of object 10 with the angle of object 1? If so, you can just use the rotate object command, and set it to the angle like so:



I hope that's what you're looking for, best of luck!

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Dec 2010 05:42 Edited at: 28th Dec 2010 05:43


My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-21 20:34:48
Your offset time is: 2026-07-21 20:34:48