Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

3D Object Rotation problem

Featured Replies

  • Author
  • Localization

h3x3r, posted Fri Aug 26, 2022 10:32 am (73187)


Hi there. I need figure out something guys. I find out Positions but can't figure out Rotation. There are values but they don't make any sense. I tried multiple them by 360.0 with not good results.
On the image i manually set the most correct object rotation but can't find these values. Are they converted somehow? I serached for floats, doubles and nothing. It's possible that rotation are writen in integrers/shorts and converted with float modifier?
Image
  • Author
  • Localization

h3x3r, posted Sat Sep 10, 2022 12:34 pm (73412)


Another example... As you can see object without any rotation has whole number.
Image
Image
  • Author
  • Localization

h3x3r, posted Sat Sep 24, 2022 8:58 am (73565)


Found something... Maybe it is that case. But can't figure out how to convert it as Template for 010 HEX Editor. I think the order is x,y,z and it has something with "Tait-Bryan angles". All what i need is convert these values to degrees. If someone has an idea please help. Thanks in advance!
Code:
// Checks if a matrix is a valid rotation matrix.
bool isRotationMatrix(Mat &R)
{
    Mat Rt;
    transpose(R, Rt);
    Mat shouldBeIdentity = Rt * R;
    Mat I = Mat::eye(3,3, shouldBeIdentity.type());

    return  norm(I, shouldBeIdentity)
}

// Calculates rotation matrix to euler angles
// The result is the same as MATLAB except the order
// of the euler angles ( x and z are swapped ).
Vec3f rotationMatrixToEulerAngles(Mat &R)
{

    assert(isRotationMatrix(R));

    float sy = sqrt(R.at(0,0) * R.at(0,0)   R.at(1,0) * R.at(1,0) );

    bool singular = sy
    float x, y, z;
    if (!singular)
    {
        x = atan2(R.at(2,1) , R.at(2,2));
        y = atan2(-R.at(2,0), sy);
        z = atan2(R.at(1,0), R.at(0,0));
    }
    else
    {
        x = atan2(-R.at(1,2), R.at(1,1));
        y = atan2(-R.at(2,0), sy);
        z = 0;
    }
    return Vec3f(x, y, z);

}

Structure of file is like:
Image
Got it. Order is Z,Y,X
Image
Now how to write code for 010 template to parse and output results???
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.