Announcement

Collapse
No announcement yet.

Make rotator / make transform - problem with incorrect values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Make rotator / make transform - problem with incorrect values

    Hello guys,

    i´m currently building a modular house blueprint and i really like it, but unfortunately there is one problem that occurs (see screenshots) .

    How come that the values coming from the "make rotator" differ from the ones coming from the transform node ? This seems to be no problem in a large environment, but for me, building a house from hundreds of modules this is a real problem because i need the accuracy of the angles so everything fits together.. any ideas ?

    The scripts works like this:
    - choose a mesh
    - rotate it by specified angle
    - place mesh

    thanks !

    #2
    No Ideas? This is really an important part here, because the length of the Mesh and the angle you rotate it around the z axes, determines the starting point of the following mesh.. as i floor the bounds, because ue4 seems to be a bit unaccurate some times, i really need the exakt angles.. like 90.0 .. basically i dont need any decimal places..
    thanksssss

    Comment


      #3
      What you are seeing is the effect of Rotators transformed to Quaternions (MakeTransform) and then back to Rotators (BreakTransform). The double conversion introduces some inaccuracies which result in the angles being slightly different. If you need precise angles, you can write a "snap" function to ensure you are always rounding off to the nearest integer (e.g. 90, 180, etc.) or avoid using transforms and stick to Euler's angles (Rotators) only.
      CTO | Head of VR Development - Visit us at http://humanxr.com
      My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

      Comment


        #4
        Hello Marco,

        thanks for your reply. How can i write something like the snap function ? Basically i can not move away from the transformation, because i store a lot of transformation data in arrays and this data is connected with meshes. In the end a bunch of meshes has exactly one transformation data which is crucial for my script..

        Rounding off to the nearest integer would be nice but i dont know how to accomplish that. Do you have an idea how to do that ? I am not good at c++ coding what might become a problem here... I would also copy the c++ data from the transformation node and try to rewrite it with the rounding function but i cant find the data in the first place..

        cheers David

        Comment


          #5
          Try with this first:

          https://docs.unrealengine.com/latest...h/Float/Round/
          CTO | Head of VR Development - Visit us at http://humanxr.com
          My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

          Comment


            #6
            Oh ok. But this will not work because the problem lies somewhere else.. You can not use floor or round in this case...

            In Unreal you can see the transformation widget, now you can rotate it with the standard ue4 tools, but when it shows 90° , the angle of the transformation is off.. I dont have any nodes in between. When you now floor or round the float it doesnt really change the outcome. I took some screenshots of the things i tried..

            There are three versions:
            1. simply using unreal build in rotation to rotate the "Transformer" widget
            2. using a "rotator" node pluggen in transform
            3. splitting the rotator node, round it (floor also works) back into transformation..

            Nothing seems to work...

            Comment


              #7
              So what you are saying is that the angle is already off when you place the actor in the level? Instead of 90 you get 89.99999... and instead of 180 you get 179.99999... ?
              CTO | Head of VR Development - Visit us at http://humanxr.com
              My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

              Comment


                #8
                No, when i place the actor the angle is 0,0,0 . But when i now type in 90° for the z rotation of the "transformer" (first and second picture) it´s not 90 but 89.9999 and so on.. In the first picture the transformer is an editable Transformation.

                I used the blue Z Value from the rotator tab under transformation (second picture on the right side in the red box) .

                Thanks !

                Comment


                  #9
                  Made a short vid..

                  https://youtu.be/ssGjfujGspE

                  Comment


                    #10
                    Did you try with a different mesh which is not the one shown? Say a standard one that comes with the engine, a cube for example. Do you get as well a 90 deg angle automatically "corrected" to a 89.9999... in the editor?
                    CTO | Head of VR Development - Visit us at http://humanxr.com
                    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                    Comment


                      #11
                      Yes it´s the same with all meshes..

                      Comment


                        #12
                        I can see that. I just tested it on 4.18.0 and there is a gradual degradation of the angle accuracy rotation after rotation. I tried to place a cube in the level and rotate it by 90 degrees around each axis using the editor's rotation gizmo. After the 4th or 5th rotation the angles are very much off while one would expect they all stay multiple of 90 (or at least very close to it). Actually there is an error which keeps increasing. I believe this may be a bug with the accuracy of the rotation transforms which needs to be pointed out to Epic.
                        CTO | Head of VR Development - Visit us at http://humanxr.com
                        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                        Comment


                          #13
                          Allright thank you marco... i will try contacting epic how to solve the problem... Thanks for your time and efforts !

                          Comment


                            #14
                            Sorry for digging out this thread, but I still have the same problem with the latest version of the UE4!
                            Is there any solution?

                            Added a screenshot, all the actors are spawned via blueprint.

                            Click image for larger version

Name:	problem.jpg
Views:	510
Size:	522.7 KB
ID:	1666960
                            Last edited by EvilReFlex; 09-20-2019, 09:21 AM.

                            Comment


                              #15
                              *push*

                              Is there no solution? I'm working on a random dungeon generator, but if the spawned piece are spawned with wrong coordinates it causes problems!

                              Comment

                              Working...
                              X