Announcement

Collapse
No announcement yet.

Standalone :: Override Transformation Matrix error.

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

  • Standalone :: Override Transformation Matrix error.

    Hello I'm trying to rotate an object by overwriting the transform matrix via the "-parameterOverride" parameter and I think I'm doing something wrong with the syntax.


    So I have a node in my scene that looks like this:

    Code:
    Node VRSCENE_base@node_2 {
      transform=Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, 0));
      geometry=Mesh_18072159227833634042;
      material=BeachChair_Wood_TEX@mtl_0;
      nsamples=1;
      visible=1;
      primary_visibility=1;
      scene_name=ListString(
        "VRSCENE_base",
        "scene/VRSCENE_base",
        "layer/_VRSCENE"
      );
    }

    Now if I try to override the "visibility" for example it works flawlessly by doing this:

    -parameterOverride="VRSCENE_base@node_2.visible=0"

    But If I want to override the transform matrix, I get an error. I'm using this command:

    -parameterOverride="VRSCENE_base@node_2.transform=T ransform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, 0))"

    and this is the error:



    Any Idea what I can do about it? aleksandar.hadzhiev To the rescue!!!

    Thank you!
    -Robert
    Last edited by Fridayvfx; 27-02-2020, 08:23 AM.

  • #2
    Parameter overriding of matrixes is not supported. However, there is a workaround:

    1. Write the matrix override code in a notepad and save it as a .vrscene:
    Code:
    Node VRSCENE_base@node_2 {
    transform=Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, 0));
    }
    2. Create an empty assembly .vrscene in notepad
    3. Include the two .vrscenes into the assembly with the #include tag (make sure the override .vrscene is below the original):
    Code:
    #include "C:\Users\Alexander\Desktop\vrscenetesting\original.vrscene"
    #include "C:\Users\Alexander\Desktop\vrscenetesting\override.vrscene"
    4. Render the assembly .vrscene

    Try it out and see if it works out for you.
    Last edited by hermit.crab; 27-02-2020, 09:28 AM.
    Aleksandar Hadzhiev | chaos.com
    Chaos Support Representative | contact us

    Comment


    • #3
      That's fantastic!
      Thank you
      -Robert

      Comment


      • #4
        Hi dear hermit.crab
        could you expound the Matrit in detail
        for example:
        transform=Transform(Matrix(Vector(1, 0, 0)-sclae , Vector(0, 1, 0)-rotation, Vector(0, 0, 1)-??), Vector(0, 0, 0)-translation);


        it confuses me.
        when i rotated a box 45 degree - transform=Transform(Matrix(Vector(0.7071068, 0.7071068, 0), Vector(-0.7071068, 0.7071068, 0), Vector(0, 0, 1)), Vector(-1.208413600921631, -10.47481250762939, 0));
        i scaleda box X to 232 - transform=Transform(Matrix(Vector(2.322936, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(-1.208413600921631, -10.47481250762939, 0));
        then i both scale and rotate it - transform=Transform(Matrix(Vector(1.642564, 1.642563, 0), Vector(-0.7071068, 0.7071068, 0), Vector(0, 0, 1)), Vector(-1.208413600921631, -10.47481250762939, 0));

        any help?

        Comment


        • #5
          max_romju It is not as linear as you might think. Both scale and rotation XYZ coordinates (converted to a -1 to 1 range) are present in the first three vectors, while the fourth is indeed the translate. To override the matrix without the need for guessing, simply do so in the host platform, export as a .vrscene with the changes and get the matrix coordinates from it.
          Aleksandar Hadzhiev | chaos.com
          Chaos Support Representative | contact us

          Comment


          • #6
            yes,hermit.crab, your suggestion will work,but it is a backward Solution.is there any reference resources to show me more ,look forward to control it.
            Thank you
            come on

            Comment


            • #7
              The transform matrix is a 3x3 matrix for Affine Transformations and a separate vector for the translation. Read more about Affine Transformations here. As I said, it's not as simple as it looks.
              Aleksandar Hadzhiev | chaos.com
              Chaos Support Representative | contact us

              Comment


              • #8
                ok,thank you very much

                Comment

                Working...
                X