- Home /
Matrices to rotation
I need to convert values found in Cheat Engine of a program (Minecraft in this case) by reading memory to Vector3 or Quaternions so that I can match my Unity's camera's rotation to that of the target program's camera's rotation.
.
So far I can find values (see images) but I cannot make sense of them. Please halp.
.
Most of the valuies range from -1 to 1, but some stay between 1 and 0.
.
Here is my original forum post: https://forum.unity.com/threads/3d-in-game-overlay-in-any-game.631612/
.
https://i.imgur.com/EFSjj55.png
Answer by Bunny83 · Feb 20, 2019 at 10:46 AM
This question is actually pretty off-topic. However the values doesn't look like they represent a matrix. It looks like they are just the forward and the up vector (so not a full rotation matrix). However finding the values would only make sense if you know / control the actual values in game. You display float values while MC mostly uses double values. I'm not that into MC development, so i'm not familiar with the internal representation. Keep in mind that MC is a pure client-server architecture. So you will most likely find the same values several times. Doing black box memory reads is dangerous and unreliable.
Thanks I successfully made a rotation from the forward vector because of your feedback. Explain to me why it is dangerous and unreliable to read memory and any alternatives.
Thanks
I guess it's because you can never reliably tell what you actually are reading. $$anonymous$$emory assignements might change. Also when multiple processes try to access the same resources at the same time this might lead to undefined behaviours/segmentation faults. This is why when you work with multiple threads in one programm you always use mutexes as guards against access issues.
That makes a lot of sense thanks for that. Someone give me an alternative to what I am doing, as I can't think of any other way to get the target program's current location and rotation without reading memory.
Also isn't there a way to get the address of the value if you know what writes the value? The memory location changes each time, but there's some code that writes to it and that code can be targeted each time?