Hybrid View

  1. #1
    New Member User Gallery
    Join Date
    May 2007
    Posts
    16

    Default [TransformSet Gimbal Lock Workaround]

    [EDIT: original question deleted]

    I have sort of found a solution or workaround to the gimbal lock problem that allows you to circle around the mesh without flipping it using TransformSet. Basically what I do is to switch the Y-axis with the z-axis of the mesh. You can do that by applying a -90 degree X Rotation using the deformation slider(tool->deformation->rotate). You need to do this only ONCE prior to animation.

    Then you can undo that transformation by calling TransformSet with an X-rotation of +90. You can freely circle around the mesh now using the Z component of TransformSet instead of the y component. For instance:
    [TransformSet, (Document:Width*.5), (Document:Height*.5), 0, 100, 100, 100, 90, 0, 90]

    this will rotate your mesh 90 degrees around the y axis without flipping it. Rotation around X axis can also be done you just have to always add 90 degrees to make up for the initial -90 degree deformation rotation.

    When you got subtools you need to deform all of them using (tool->deformation->rotate) and then you need to (manually) reposition them again. You only have to do it once though prior to animation.
    Last edited by Syphorlate; 08-09-12 at 01:16 AM.

  2. #2
    Senior Member User Gallery
    Join Date
    May 2007
    Location
    Raleigh NC
    Posts
    453

    Default

    Hi there!

    All of this is feasible with zscript yes. If you have ANY programming background zscript should be a breeze for you. The best place to start is probably here: http://www.pixologic.com/docs/index....mand_Reference

    This has all the available commands as well as links to the "Getting Started" guides.

    As for tips on how to do the things you want....

    -To manipulate the mesh on the canvas you will probably want to use the TransformGet and TransformSet command. To center it in the doc you could use Transform>Fit and and then TransformSet with a 0.5 scale.

    -To save a Tiff file you will be using a command [FileNameSetNext] which will set the file name (obviously) for the next save action.

    - I would put all of the steps 1-5 in a [Routine] and then call the routine in the loop.

    - You can set the loop count to 35 and then adjust the TransformSet yrotation +10.



    Let me know if you have any more question.

  3. #3
    New Member User Gallery
    Join Date
    May 2007
    Posts
    16

    Default

    Thank you!

    That's already some information I can use. I will look into it and post again in case
    I need some further assistance.

    May the force be with you

  4. #4
    New Member User Gallery
    Join Date
    May 2007
    Posts
    16

    Default

    Already got some first questions:
    I am trying the SetTransform command and am I right to assume that this transforms only the mesh, right?
    not the camera? Is there even a camera object in zbrush?
    So this means that when I rotate the model using setTransform this is not the same as circling around the model
    since the lighting setup will be the same for all viewpoints, right? What if I want the light to be recalculated
    do I need to transform the lights position then?

    And how do I transform all subtools of a mesh? is that even possible? or do I have to transform each subtool
    individually?

    SetTransform doesn't work properly it turns my mesh upside down on some angles? So what is the best
    way to get a transformation that works for all possible angles?
    Last edited by Syphorlate; 08-08-12 at 09:03 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •