Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
Junior_Djjr

Get RwFrame's offset and rotation

Recommended Posts

Junior_Djjr

i tried RwMatrix but don't worked what i need

 

i need this to translate/rotate a frame... get the actual position and rotation, and then modify to a new position/rotation

i used iCombine to continues the actual position/rotate, but thats dificult to create the animation and it make impossible to use delta time in movements, cause the frame continues moving everytime, eg: set the rotation X to 1.0, then every frame of the game will increase 1.0 in rotation of rwframe .-. thats a sh*t

 

 

then, what address i can read the offset positon and rotation of rwframe in a model?

 

btw: i already tried to move a child of dummy and not the dummy... but don't works, the 0.0 0.0 0.0 of child is the 0.0 0.0 0.0 of the model and not of the "father"............

Edited by Junior_Djjr

Share this post


Link to post
Share on other sites
MasterHK

you tested this DK func?

[email protected] = 0.0 // [email protected] = 0.0 // [email protected] = 1.0 // Zwhile true    wait 0    0A97: [email protected] = car [email protected] struct    [email protected] += 0x678 // bump_front_dummy                               0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0    if        [email protected] <> 0    then        0AA5: call {RwFrameRotate} 0x7F1010 num_params 4 pop 4 _combine 2 _angle+= 1.0 _axis [email protected] _frame [email protected]    endend

Share this post


Link to post
Share on other sites
Junior_Djjr

_angle+= 1.0

thats my exactly problem, i said, using iCombine the rotation IS NOT SET, the angle INCREASE! (or decrease...)

i want to set the new value .-. ...but to set the new value i need to put 0 in iCombine, then, now, the frame go to 0.0 0.0 0.0 of model, thennn i need to get the original position/rotation to thennnnnnn edit the values and set the new

 

 

i need to make the movemment like this:

 

....    if key_pressed 107    then        AX += 0.1    end...0AA5: call _rwFrameRotate num_params 4 pop 4 iCombine 1 fAngle AX pstAxis _pstAxisX pstRwFrame pFrame
set the var and set the new angle/position

 

 

btw: Combine "2"? i thought of is 0 and 1 (false/true) @[email protected] but no, "2" is the same of "1"

Edited by Junior_Djjr

Share this post


Link to post
Share on other sites
MasterHK

what about this?

0A97: [email protected] = car [email protected] struct [email protected] += 0x670 // left front door                           0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 if  [email protected] > 0   then        0AA7: call_function 0x7F09B0 num_params 1 pop 1 [email protected] [email protected] // _RwFrameGetRootend

Share this post


Link to post
Share on other sites
Junior_Djjr

this is Root and not Rotation :p

Share this post


Link to post
Share on other sites
MasterHK

0x7F0990 _RwFrameGetLTM

 

i don't know what's LTM. :cry:

 

Edited by MasterHK

Share this post


Link to post
Share on other sites
Junior_Djjr

0x7F0990 _RwFrameGetLTM

 

i don't know what's LTM. :cry:

 

LOL :lol:

this is global position i think

 

but thx for try :3

Share this post


Link to post
Share on other sites
MasterHK

if yes so it's possible to calculate offset from global position.

Share this post


Link to post
Share on other sites
MasterHK

and this? :D

0x7F1290 _RwFrameGetPluginOffset

Share this post


Link to post
Share on other sites
Junior_Djjr

if yes so it's possible to calculate offset from global position.

thats is not so perfect i think .-.

 

 

and this? :D

0x7F1290 _RwFrameGetPluginOffset

haha, i don't know exactly, but RwFrame+nodeNamePluginOffset is the name of frame, nothing about position/rotation

Share this post


Link to post
Share on other sites
MasterHK

i think its better to wait for pros to answer. : |

Share this post


Link to post
Share on other sites
Wesser

You are probably attaching the RwFrame to the wrong object. You should post your code.

 

Anyway, the iCombine flag of the RwFrameTranslate function handles the following circumstances:

  • 0, the object moves to the specified coordinates and the rotation matrix gets re-initialized (identity);
  • 1, the object moves according to the rotation of the parent object by an increasing relative offset;
  • 2, the object moves by an increasing absolute offset.
Similarly, the same parameter of the RwFrameRotate function behaves as follows:
  • 0, the object rotates by an absolute angle and the offset gets re-initialized (zeroed);
  • 1, the object rotates by an increasing relative angle;
  • 2, the object orbits by an increasing relative angle at the specified offset.
Ofcourse, the position and rotation of an object are always relative to its parent. Edited by Wesser

Share this post


Link to post
Share on other sites
Junior_Djjr

You are probably attaching the RwFrame to the wrong object. You should post your code.

 

Anyway, the iCombine flag of the RwFrameTranslate function handles the following circumstances:

  • 0, the object is moved to the specified coordinates and the rotation matrix gets re-initialized;
  • 1, the object is moved according to the rotation of the parent object by a relative offset;
  • 2, the object is moved by an absolute offset.
The same parameter of RwFrameRotate may behave in a similar manner.

 

i'm not attaching, i get the rwframe from a dummy of the car/weapon and object

gta-sa88.jpg

here i get the dummy "sawbarl" of sawnoff and rotate the Y (iCombine 1)

 

(i tested only rotating)

0, go to offset 0.0 0.0 0.0 and not rotate (obvious)

1, the angle is not set, the angle increase/decrease... i put 1.0 and the angle increase 1.0 in each frame of game, then, how i can move like "30°" using delta time in angle? thats a sh*t to make...

2, same as 1, but now rotates in "offside" of the model @[email protected] like "orbiting"

Edited by Junior_Djjr

Share this post


Link to post
Share on other sites
MasterHK

i think DK22Pac's newOpcodes will help you...

 

 

 

i was used this code instead of 15 lines in original version: ;)

0D06: get_matrix RwFrame position_to [email protected] [email protected] [email protected]: set_matrix RwFrame rotation 3.0 [email protected] 0.00D05: set_matrix RwFrame position [email protected] [email protected] [email protected]

 

 

Share this post


Link to post
Share on other sites
Junior_Djjr

i think DK22Pac's newOpcodes will help you...

 

i was used this code instead of 15 lines in original version: ;)

0D06: get_matrix RwFrame position_to [email protected] [email protected] [email protected]: set_matrix RwFrame rotation 3.0 [email protected] 0.00D05: set_matrix RwFrame position [email protected] [email protected] [email protected]

impossible man, the newopcodes haves A LOT of crashes, i give a idea do use but all people reclaim and said about crashes, most people of my blog don't uses the new steering mod too cause it uses newopcodes.cleo

 

the newopcodes uses "matrix" and not "translate/rotate" the frame etc... i was wondering how this will work and see the source of these opcodes, help a lot

Edited by Junior_Djjr

Share this post


Link to post
Share on other sites
MasterHK

frame to matrix:

RwFrame += 0x10

 

the newopcodes haves A LOT of crashes

maybe, but not for me...

Edited by MasterHK

Share this post


Link to post
Share on other sites
Junior_Djjr

frame to matrix:

RwFrame += 0x10

 

i tried RwMatrix but don't worked what i need

 

...this rwmatrix don't returns the OFFSET of model, e.g: rwmatrix right, returns 1.0 if the bump of car is in rotation 0.0, the you rotate and the values changes like "the position of the front of the frame of the bump of the car"...

Edited by Junior_Djjr

Share this post


Link to post
Share on other sites
MasterHK

and what about this... ?

[email protected] += 640A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0

X [email protected] Y [email protected] Z [email protected]

Edited by MasterHK

Share this post


Link to post
Share on other sites
Junior_Djjr

and what about this... ?

[email protected] += 640A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
X [email protected] Y [email protected] Z [email protected]

 

this is "rwmatrix pos", i thought thats a global position, but i tested and worked @[email protected] this is offset of model, i think of this will help!

but the biggest problem is the rotation..... and i don't found anothing about rotation in the rwmatrix and rotation of the frame (0x7F1010) is impossivel to use

Share this post


Link to post
Share on other sites
MasterHK

so lets try an different way... :D

0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00604: get_angle_between_vectors [email protected] and [email protected] store_to [email protected]@ -= 270.0
Edited by MasterHK

Share this post


Link to post
Share on other sites
Wesser

The modelling matrix of a RW object is at RwFrame + 0x10 and consequently the offset is stored at RwFrame + 0x40.

 

I still don't quite understand your problem. You can use two variables to both handle the current rotation step multiplied by the delta time and the maximum reachable rotation respectively. Before increasing the total angle, you have to check if it does overflow.

 

However, increasing the angle by a constant value is not a good idea. It's better to compute it through a total time.

 

//Edit: I edited my last post. :p

Edited by Wesser

Share this post


Link to post
Share on other sites
MasterHK

you mean a thing like this... ?

RwFrame += 640A8D: [email protected] = read_memory RwFrame size 4 virtual_protect 0RwFrame += 40A8D: [email protected] = read_memory RwFrame size 4 virtual_protect 00604: get_angle_between_vectors [email protected] and [email protected] store_to [email protected]    [email protected] >= 270.0then    [email protected] -= 270.0end

this part of text got appeared at this moment. :D

 

 

However, increasing the angle by a constant value is not a good idea. It's better to compute it through a total time.

 

so i have to fix it...

Share this post


Link to post
Share on other sites
Junior_Djjr

The modelling matrix of a RW object is at RwFrame + 0x10 and consequently the offset is stored at RwFrame + 0x40.

 

I still don't quite understand your problem. You can use two variables to both handle the current rotation step multiplied by the delta time and the maximum reachable rotation respectively. Before increasing the total angle, you have to check if it does overflow.

 

However, increasing the angle by a constant value is not a good idea. It's better to compute it through a total time.

i ask for this cause i thought it would be easy for anyone here have a solution (another method to rotate, like rotation the matrix like newopcodes.cleo) ...but yes, this way will work too, only will be a sh*t to make the movement... but will work @[email protected]

 

the problem to create is cause, i will create a function for a dummy (like imvehft/steering) and then create a .cfg for confgs to control the function to a independent model, then the logic is for example, to use "speed" and "destination offset"

 

anyway, if anyone tell to me other way to rotate a rwframe (by matrix?) i thank, but i can try by improving too :p

 

 

you mean a thing like this... ?

RwFrame += 640A8D: [email protected] = read_memory RwFrame size 4 virtual_protect 0RwFrame += 40A8D: [email protected] = read_memory RwFrame size 4 virtual_protect 00604: get_angle_between_vectors [email protected] and [email protected] store_to [email protected]    [email protected] >= 270.0then    [email protected] -= 270.0end
this part of text got appeared at this moment. :D

 

However, increasing the angle by a constant value is not a good idea. It's better to compute it through a total time.

so i have to fix it...

 

wtf?? .--.

Share this post


Link to post
Share on other sites
Wesser

Ok, as you wish. Take the code below:

 

const    DEG_TO_RAD = 0.017453end0A8E: [email protected] = [email protected] + 0x10 // [email protected] *= [email protected] *= [email protected] *= DEG_TO_RAD0AA6: call_method 0x0059B120 struct [email protected] num_params 3 pop 0 fAngleZ [email protected] fAngleY [email protected] fAngleX [email protected] // CMatrix__setRotate0AA6: call_method 0x0059AF80 struct [email protected] num_params 3 pop 0 fPosZ [email protected] fPosY [email protected] fPosX [email protected] // CMatrix__setPos
CMatrix__setRotate also initializes the matrix position.

Share this post


Link to post
Share on other sites
Junior_Djjr

Ok, as you wish. Take the code below:

const    DEG_TO_RAD = 0.017453end0A8E: [email protected] = [email protected] + 0x10 // [email protected] *= [email protected] *= [email protected] *= DEG_TO_RAD0AA6: call_method 0x0059B120 struct [email protected] num_params 3 pop 0 fAngleZ [email protected] fAngleY [email protected] fAngleX [email protected] // CMatrix__setRotate0AA6: call_method 0x0059AF80 struct [email protected] num_params 3 pop 0 fPosZ [email protected] fPosY [email protected] fPosX [email protected] // CMatrix__setPos
CMatrix__setRotate also initializes the matrix position.

 

lol this safes a LOT of lines and maths

 

but is impossible when don't know the original rotation (i already get the original position reading the CMatrix) but i need the original rotation too, the "sawbarl" of sawnoff for example is 180° in X, then got to upsidedown:

gta-sa91.jpg

CMatrix__getRotate's address plx to close this topic? :p

 

Share this post


Link to post
Share on other sites
MasterHK
wtf?? .--.
[email protected] += 0x10 // got a pointer to the matrix position of the component in the coordinate system of the parent0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // read X-coordinate of the vectors [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // read Y-coordinate of the vector Right0604: get_angle_between_vectors_{a,b} [email protected] [email protected] and_{0,1}_store_to [email protected] // consider the angle between the axesif [email protected] >= 270.0then [email protected] -= 270.0end

...

more description?

Share this post


Link to post
Share on other sites
Junior_Djjr

 

wtf?? .--.
[email protected] += 0x10 // got a pointer to the matrix position of the component in the coordinate system of the parent0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // read X-coordinate of the vectors [email protected] += 40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // read Y-coordinate of the vector Right0604: get_angle_between_vectors_{a,b} [email protected] [email protected] and_{0,1}_store_to [email protected] // consider the angle between the axesif [email protected] >= 270.0then [email protected] -= 270.0end

...

more description?

 

man..... i know of this is..... i meant that is not of i want

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.