Results 1 to 3 of 3

Thread: miQ_INST_LOCAL_TO_GLOBAL

  1. #1
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default miQ_INST_LOCAL_TO_GLOBAL

    I need to get transform matrix from light.
    But miQ_INST_LOCAL_TO_GLOBAL return very strange value.

    Code:
    cur_light = iter->get_light_tag(iter->get_current());
    mi_query(miQ_INST_LOCAL_TO_GLOBAL, 0, cur_light, &T);
    Result for scale 2:
    Code:
    2.000000, 0.000000, 0.000000, 0.000000
    0.000000, 0.994881, 0.994881, 0.000000
    0.000000, 0.000000, 0.000000, 0.016266
    61.477825, 0.000000, 0.000000, 0.000000
    mi_db_access() works fine, but looks like too slow.
    Code:
    miInstance *inst;
    inst = (miInstance *)mi_db_access(cur_light);
    //use inst->local_to_global;
    mi_db_unpin(cur_light);
    Correct result:
    Code:
    2.000000, 0.000000, 0.000000, 0.000000
    0.000000, 2.000000, 0.000000, 0.000000
    0.000000, 0.000000, 2.000000, 0.000000
    0.000000, 0.000000, 0.000000, 1.000000
    What wfrong with my code with miQ_INST_LOCAL_TO_GLOBAL?
    Pavel Ledin

  2. #2

    Default

    Pavel, the query function returns the leaf transform, i.e. all intermediate transforms multiplied. Are you looking for the
    transform just to the parent space of a specific light ? This would require mi_db_access on the DAG light instance.

    gunter

    Quote Originally Posted by Puppet View Post
    I need to get transform matrix from light.
    But miQ_INST_LOCAL_TO_GLOBAL return very strange value.

    Code:
    cur_light = iter->get_light_tag(iter->get_current());
    mi_query(miQ_INST_LOCAL_TO_GLOBAL, 0, cur_light, &T);
    Result for scale 2:
    Code:
    2.000000, 0.000000, 0.000000, 0.000000
    0.000000, 0.994881, 0.994881, 0.000000
    0.000000, 0.000000, 0.000000, 0.016266
    61.477825, 0.000000, 0.000000, 0.000000
    mi_db_access() works fine, but looks like too slow.
    Code:
    miInstance *inst;
    inst = (miInstance *)mi_db_access(cur_light);
    //use inst->local_to_global;
    mi_db_unpin(cur_light);
    Correct result:
    Code:
    2.000000, 0.000000, 0.000000, 0.000000
    0.000000, 2.000000, 0.000000, 0.000000
    0.000000, 0.000000, 2.000000, 0.000000
    0.000000, 0.000000, 0.000000, 1.000000
    What wfrong with my code with miQ_INST_LOCAL_TO_GLOBAL?

  3. #3
    Join Date
    Dec 2004
    Location
    Moscow, Russia
    Posts
    682

    Default

    Gunter, thanks you for reply.
    But my light(in current scene) in the root of the scene.
    Actually I need just scale for compute area light size. I suppose it's just matrix from mi file (from light instance node).
    .
    Pavel Ledin

Posting Permissions

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