1. #1
    New Member Follow User Gallery
    Join Date
    Apr 2017
    Posts
    3

    Default Question: 'Transform' in ZBrush

    Hello, ZBC community,
    I'm newbie in ZB (both ZBrush and ZScript), though I had several experiences in the computer graphics & programming.
    At this moment, I am exploring ZScript programming to support 3D modeler.

    What I want to do in the end is reproducing the 3D transformation (translation, rotation and scale) in ZBrush from another tool, but I'm stucking in the Transform in ZBrush. I have no idea what exactly doing inside of ZBrush in the sense of "3D", not "2.5D".
    It has two aspects, rotation and translation. I will explain the detail of my problem below.


    1. Rotation

    Even though I can access 3 rotation values from ZScript by MTransformGet, but I cannot reproduce the *exactly same* image from ZBrush. I implemented both GL and DX orthographic rendering programs and apply them in various ways, and found a simple rule in two-axes (ZX, no Y rotation) cases. However, I'm struggling with finding universal 3-axes cases with many trials, but I cannot success yet.

    Someone may want to mention on "gimbal lock", but I guess it is not a really gimbal lock problem, because there is no axes degeneration. Rather, I strongly assume that ZB has two principles, because the rotation view are quite different when cos(rotY) > 0 and cos(rotY) <= 0.

    Is there anybody tried to find this kind of universal rule before?


    2. weirdness in 'translation' (named "Move" in ZBrush)
    Another weird thing is Z-translation (to the depth direction). Even though ZScript API provides getter/setter to Move-Z value, but it does not affect at all in my test. That means, I can only 'scale' 3D object ("Tool" in ZBrush) in my viewport ("Document" in ZBrush) to look closer even in the perspective mode? Or, is it possible in some tricky way?

    Is there anybody tried this kind of operation before?

    Well, I guess that ZBrush is basically started from 2.5D, so the ZB developers did not want to adjust translation Z value in the 3D coordinate.


    Thank you for your reading.

  2. #2
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    Hi and welcome to ZBC,

    1) ZScript uses an adapted method of rotation which is described here:
    http://www.zbrushcentral.com/showthr...l=1#post148242

    2) The Z-translate value is auto-adjusted by ZBrush to zero for a 3D model in Edit mode. I believe this is because of the way the sculpting brushes work. So it's possible to set the Z depth when Edit is off but it will revert to 0 the moment Edit is turned on. (This is essentially a legacy feature - in early versions of ZBrush it was possible to adjust Z depth while in Edit mode.)

    ZBrush does not have a camera as such. Instead the model is distorted in the document to simulate a camera view.

    HTH,

  3. #3
    New Member Follow User Gallery
    Join Date
    Apr 2017
    Posts
    3

    Default

    Thank you for your fast response, marcus_civis.
    Although it's an interesting information, what I want to do is converting the static rotation parameters from GL/DX to ZBrush.

    I already found (I guess ) the ZX-axes conversion between GL/DX to ZBrush.
    The problem is Y-rotation value. If it is valid, the overall rotation goes crazy...

    The following two images are the comparison between my GL renderer and ZBrush. [GL] [ZB]
    To generate these images, I incrementally change the Y rotation value from 0 to 75.
    In C++ GL renderer, I just used glmeulerAngleXYZ.

    So, my question is, how can I convert ZBrush rotation value to generate the same view in the GL/DX renderer (or vice versa?)

  4. #4
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    You may find this post (and parts of the thread) useful. Otherwise I can't give you any more help. You're limited to what's possible with zscript and there's no direct equivalent to setting Euler angles.

  5. #5
    New Member Follow User Gallery
    Join Date
    Apr 2017
    Posts
    3

    Default

    Thank you, marcus_civis, I got some idea from the thread you recommended,
    and I success to convert from GL/DX to ZB at last !!!

    My implementation looks quite messy and tricky, so I am now refactoring it ...
    After I cleaned the code, I would like to post my result

  6. #6
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    That's great. Yes, do post the result, thank you.

Tags for this Thread

Posting Permissions

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