SA-MP Forums [Include] Rotations.inc
 New Account Members List Search Today's Posts Mark Forums Read

 14/08/2016, 01:19 AM #1 Nero_3D High-roller     Join Date: Jun 2007 Location: Germany Posts: 2,827 Reputation: 666 Rotations.inc Rotations This include gives you the possibility to convert rotations Installationand reference GitHub Download Master Version 2.0 Version 1.2 Last edited by Nero_3D; 22/04/2019 at 02:35 AM.
 14/08/2016, 11:11 AM #2 PT Godfather     Join Date: Nov 2012 Location: Portugal Posts: 7,180 Reputation: 780 Re: Rotations.inc You and the maths.. My god xd Good work __________________ http://steamcommunity.com/id/pt_player/
 15/08/2016, 01:37 AM #3 Sanady High-roller     Join Date: May 2012 Location: Los Santos Posts: 1,170 Reputation: 132 Re: Rotations.inc My god, nice maths. You can really help me with exams joking but really nice maths. __________________
 06/01/2017, 11:59 PM #4 Nero_3D High-roller     Join Date: Jun 2007 Location: Germany Posts: 2,827 Reputation: 666 Re: Rotations.inc Translation and Rotation function for RotationMatrix added New functions PHP Code: ``` // AroundRelPoint RotMatrixMatrixAroundRelPoint(Float: matrix1[4][4], Float: oX, Float: oY, Float: oZ, Float: matrix2[4][4]) RotMatrixQuatAroundRelPoint(Float: matrix[4][4], Float: oX, Float: oY, Float: oZ, Float: w, Float: x, Float: y, Float: z) RotMatrixEulerAroundRelPoint(Float: matrix[4][4], Float: oX, Float: oY, Float: oZ, Float: rX, Float: rY, Float: rZ, eulermode: mode = euler_samp) RotMatrixAxisAroundRelPoint(Float: matrix1[4][4], Float: oX, Float: oY, Float: oZ, Float: angle, Float: aX, Float: aY, Float: aZ) // AroundPoint RotMatrixMatrixAroundPoint(Float: matrix1[4][4], Float: x, Float: y, Float: z, Float: matrix2[4][4]) RotMatrixQuatAroundPoint(Float: matrix[4][4], Float: x, Float: y, Float: z, Float: w, Float: qX, Float: qY, Float: qZ) RotMatrixEulerAroundPoint(Float: matrix[4][4], Float: x, Float: y, Float: z, Float: rX, Float: rY, Float: rZ, eulermode: mode = euler_samp) RotMatrixAxisAroundPoint(Float: matrix1[4][4], Float: x, Float: y, Float: z, Float: angle, Float: aX, Float: aY, Float: aZ) // TranslateMatrix TranslateMatrix(Float: matrix[4][4], Float: x, Float: y, Float: z) // RotateMatrix RotateMatrixWithMatrix(Float: matrix1[4][4], Float: matrix2[4][4]) RotateMatrixWithQuat(Float: matrix[4][4], Float: w, Float: x, Float: y, Float: z) RotateMatrixWithEuler(Float: matrix[4][4], Float: rX, Float: rY, Float: rZ, eulermode: mode = euler_samp) RotateMatrixWithAxisAngle(Float: matrix[4][4], Float: angle, Float: aX, Float: aY, Float: aZ) // GetTranslationMatrix GetTranslationMatrix(Float: matrix[4][4], Float: x, Float: y, Float: z)  ```
 06/02/2017, 06:25 PM #5 Crayder Banned   Join Date: Sep 2013 Location: Flames of Hell Posts: 3,367 Reputation: 652 Re: Rotations.inc Hmm... Wasn't there a lot more comments on this thread? I know I had a discussion about this include here and said how badass it was...
10/02/2017, 01:37 PM   #6
Nero_3D
High-roller

Join Date: Jun 2007
Location: Germany
Posts: 2,827
Reputation: 666
Re: Rotations.inc

Quote:
Never was but thanks anyways, maybe another thread, 3DTryg from AbyssMorgan ?

I still get this feeling that this include isn't very user friendly but I am not sure how to accomplish a more compact structure within pawn

10/02/2017, 05:09 PM   #7
Crayder
Banned

Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,367
Reputation: 652
Re: Rotations.inc

Quote:
 Originally Posted by Nero_3D Never was but thanks anyways, maybe another thread, 3DTryg from AbyssMorgan ?
YES! Lol...

Quote:
 Originally Posted by Nero_3D I still get this feeling that this include isn't very user friendly but I am not sure how to accomplish a more compact structure within pawn
I think it is user friendly, but it's just not something the majority of the people here are going to use. It's extremely useful for those who know what it is though. I've already used it quite a bit.

 10/02/2017, 05:13 PM #8 AbyssMorgan High-roller     Join Date: Apr 2015 Location: Poland Posts: 1,246 Reputation: 347 Re: Rotations.inc 3DTryg.inc partly uses rotations.inc (Internal) I suspect that this include useful for more advanced developers. Typically create a function that is easy to use by anyone (Not including programmers from my country XD). __________________ 173.234.31.34:8282 Discord Website Code: ```3DTryg SAOI StreamerFunction RGB BitFunctions VehicleMissile DataConvert Mines Random Gift UnsignedLong Knife VehPara EVF V3 Magic Stingers PortalGun VNPC Graffiti Hunting mentiones ExtendedGrenade hashtag Missions Hyperion```
 16/06/2017, 04:44 PM #9 ball Huge Clucker     Join Date: Jul 2012 Location: Poznan, Poland Posts: 281 Reputation: 33 Re: Rotations.inc I am trying to create graffiti object in front of another graffiti object (graffiti tagged), but I don't know how to get position in front of object relative to object's rotation (rx, ry, rz). My actual code Code: ```new Float:lGraffitiX, Float:lGraffitiY, Float:lGraffitiZ, Float:lGraffitiRX, Float:lGraffitiRY, Float:lGraffitiRZ; GetDynamicObjectPos(Graffiti[tagid][graffiti_object], lGraffitiX, lGraffitiY, lGraffitiZ); GetDynamicObjectRot(Graffiti[tagid][graffiti_object], lGraffitiRX, lGraffitiRY, lGraffitiRZ); Use(lGraffitiX, lGraffitiY, lGraffitiZ, lGraffitiRX, lGraffitiRY, lGraffitiRZ, lGraffitiX, lGraffitiY, lGraffitiZ); Graffiti[tagid][graffiti_object_made] = CreateDynamicObject(18659, lGraffitiX, lGraffitiY, lGraffitiZ, lGraffitiRX, lGraffitiRY, lGraffitiRZ, .interiorid = 0); Use(Float:oX, Float:oY, Float:oZ, Float:rX, Float:rY, Float:rZ, &Float:x, &Float:y, &Float:z) { new Float: matrix[4][4] ; // Get rotation Matrix from Euler GetRotationMatrixFromEuler(matrix, rX, rY, rZ); // Rotate matrix around relative point of object // 0.0, 0.0, 1.0 = relative point = 1.0 above object center // 5.0, 0.0, 0.0 = euler rotation = 5.0 degress in rX direction RotMatrixEulerAroundRelPoint(matrix, 0.0, 0.0, 1.0, 5.0, 0.0, 0.0); // Getting relative point, 0.0, 0.0, 0.0, 1.0 = offsets x, y, z and translation // because we only need the translation we set, x, y, z offsets to 0.0 MatrixRotate(matrix, 0.0, 0.0, 0.0, 1.0, oX, oY, oZ); x = oX; y = oY; z = oZ; }``` It works only with one angle, see image below. Grove tag should cover another tag. On the wall it works, but on the ground it does not. Any ideas? https://i.imgur.com/3DXKHt7.jpg //EDIT Done it, I used wrong function. Working code Code: ```GetQuatFromEuler(rx, ry, rz, qw, qx, qy, qz); QuatRotate(qw, qx, qy, qz, -0.05, 0.0, 0.0, x, y, z); //use x, y, z```
16/06/2017, 09:43 PM   #10
Nero_3D
High-roller

Join Date: Jun 2007
Location: Germany
Posts: 2,827
Reputation: 666
Re: Rotations.inc

Quote:
 Originally Posted by ball Done it, I used wrong function. Working code Code: ```GetQuatFromEuler(rx, ry, rz, qw, qx, qy, qz); QuatRotate(qw, qx, qy, qz, -0.05, 0.0, 0.0, x, y, z); //use x, y, z```
That is excatly what EulerRotate does

Also one thing to note, normally +oY would be in front of a vehicle (facing north)
But for objects it matters in which direction they look without rotation (If facing North, +oY is the front, East = +oX, South = -oY, West = -oX)

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post thefatshizms Scripting Help 4 21/06/2013 11:27 PM BlackAtom Scripting Help 1 23/07/2012 03:28 PM Arrows73 Help Archive 0 18/07/2011 07:22 PM Dragonoir Help Archive 2 03/06/2009 07:38 PM

All times are GMT. The time now is 01:38 PM.

 -- (EN) English -- (RU) Русски SA-MP - Archive - Top