Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Z-Facing
Z-Facing [message #256643] Tue, 01 May 2007 12:20 Go to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Is there a way to get the player's z facing since theres already a script which gets the players xy facing? Rocked Over

a100 Big Ups
Re: Z-Facing [message #256644 is a reply to message #256643] Tue, 01 May 2007 12:26 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3811
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
a100 wrote on Tue, 01 May 2007 13:20

Is there a way to get the player's z facing since theres already a script which gets the players xy facing? Rocked Over

a100 Big Ups

If there is not it does not take much to script a new one.


Re: Z-Facing [message #256647 is a reply to message #256643] Tue, 01 May 2007 12:29 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Would you happen to know how? In Love
Re: Z-Facing [message #256674 is a reply to message #256643] Tue, 01 May 2007 15:17 Go to previous messageGo to next message
Yrr is currently offline  Yrr
Messages: 556
Registered: October 2006
Location: Germany
Karma: 0
Colonel

Isn't Commands->Get_Facing what you're looking for?

Re: Z-Facing [message #256688 is a reply to message #256643] Tue, 01 May 2007 15:50 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
no that returns the xy(right/left) facing im looking for a way to get z(up/down) facing
Re: Z-Facing [message #256692 is a reply to message #256643] Tue, 01 May 2007 15:56 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Vector3 pos = Commands->Get_Position(obj);
//use pos.Z
Re: Z-Facing [message #256693 is a reply to message #256643] Tue, 01 May 2007 15:58 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
But that doesnt return the z-facing it retruns where z is but not the z angle Wink
Re: Z-Facing [message #256695 is a reply to message #256693] Tue, 01 May 2007 16:01 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
You mean the Y facing?

I don't think it is possible.

[Updated on: Tue, 01 May 2007 16:02]

Report message to a moderator

Re: Z-Facing [message #256698 is a reply to message #256643] Tue, 01 May 2007 16:07 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Well i thought it would be the z facing i think, since z control's height so the pos.z would be relative to z angle

Thought it would be possible =\
Re: Z-Facing [message #256700 is a reply to message #256643] Tue, 01 May 2007 16:22 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Well, no because it would never change (unless you were in a vec).

Rotation or facing around a Z axis would turn it left and right.
Rotation or facing around a X axis would make it face up or down
Rotation or facing around a Y axis would make it lean to the left or right.
X == -----
Y == |
     |
     |
     |
Z == . (straight up)

Sorry about my post, i got it wrong. It's X not Y.
Re: Z-Facing [message #256703 is a reply to message #256643] Tue, 01 May 2007 16:29 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Ohh i see well thnx for the explanation Thumbs Up
Re: Z-Facing [message #256713 is a reply to message #256643] Tue, 01 May 2007 17:56 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

You can get a Matrix3D which describes the position and facing from a object using PhysicalGameObj::Get_Transform (Note that this definition is only availible in a quite new version of scripts.dll). The return matrix should be read as

Matrix[0].x/y/z = X axis vector
Matrix[1].x/y/z = Y axis vector
Matrix[2].x/y/z = Z axis vector
Matrix[0].w = X pos
Matrix[1].w = Y pos
Matrix[2].w = Z pos

For more info on that I would suggest you to read about translation matrises or transformation matrix or something like that.

I'm not sure what you want to do with it, but to get the Matrix3D from the object you would use something like this:

Matrix3D* Matrix = ((PhysicalGameObj*)Object)->Get_Transform();
// Do something with Matrix[2].x, Matrix[2].y and Matrix[2].z

It's hard to explain exactly and I doubt you will be able to do anything with this info, but maybe it helped you or someone else in some way. Smile

(for a soldier the Z-vector always points straight upwards, vector (0,0,1), so if you want to use this on a soldier, don't even try Wink)


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Z-Facing [message #256717 is a reply to message #256643] Tue, 01 May 2007 18:51 Go to previous messageGo to next message
a100 is currently offline  a100
Messages: 45
Registered: March 2007
Karma: 0
Recruit
Thank you it has infact helped me Big Ups
Re: Z-Facing [message #256904 is a reply to message #256643] Wed, 02 May 2007 23:34 Go to previous messageGo to next message
Spice
Messages: 1448
Registered: November 2003
Location: Ohio
Karma: 0
General (1 Star)
G-Facing:

http://images.eonline.com/eol_images/Profiles/20060925/244.snoop.dogg.092506.jpg


http://img46.imageshack.us/img46/8027/userbar358428pu3.gif

[Updated on: Wed, 02 May 2007 23:35]

Report message to a moderator

Re: Z-Facing [message #256940 is a reply to message #256643] Thu, 03 May 2007 05:07 Go to previous messageGo to next message
Cat998
Messages: 1081
Registered: January 2004
Location: Austria, Vienna
Karma: 0
General (1 Star)
Moderator/Captain

EXdeath, if you don't have something useful to reply, just don't reply. closed.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter then "Yes"

Programming is like sex: one mistake and you have to support it for the rest of your life

Want the best answers? Ask the best questions!

"So long, and thanks for all the fish."
Re: Z-Facing [message #256964 is a reply to message #256643] Thu, 03 May 2007 07:39 Go to previous message
Doitle is currently offline  Doitle
Messages: 1723
Registered: February 2003
Location: Chicago, IL
Karma: 0
General (1 Star)
Moderator/Captain

I'd just like to vouch for that being hilarious.

http://www.n00bstories.com/image.fetch.php?id=1285726594
Previous Topic: Level Edit bug
Next Topic: Scripts to grant powerups or weapons
Goto Forum:
  


Current Time: Thu Nov 28 11:56:26 MST 2024

Total time taken to generate the page: 0.00986 seconds