Unexpected behavior of Verge3D Annotations

Home Forums Programming Unexpected behavior of Verge3D Annotations

This topic contains 3 replies, has 2 voices, and was last updated by Yuri Kovelenov Yuri Kovelenov 1 week, 1 day ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14727
    Avatar
    nick
    Newbie

    Hi,

    I’ve been experimenting with some Verge3D projects, in this project I’ve been working with the Verge3D Annotations. The Annotations work fine, but when combined with a 3rd party library the Annotations show unexpected behavior.

    The project can be seen here link just click on the Start button below the boat.
    (This is work in progress, subject to change.)

    When it is done loading you can see the annotations are placed at the correct predefined positions. But when you enable the water (button looking like a drop of water, at the bottom left of the screen) the annotations positions in world space get mirrored. The code for the water is taken from the examples repository. (Example: shaders/Ocean)

    I think I might have found the part of the library that messes with the annotations, but i can’t figure out how to fix it.
    It’s in line 207 of the attached file:
    scope.onBeforeRender = function(renderer, scene, camera) {...}

    I would greatly appreciate any help.

    Kind regards,

    Nick

    #14731
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi Nick,

    I guess you’re talking about this file http://demo2019.qmaze.nl/Scripts/Custom/Water.js

    The code is quite low-level and its difficult to say what’s wrong with it. I think this code flips the camera to render water reflections and this flips the annotations. May be you could go further and isolate the exact line(s) causing this?

    Founder & CEO at Soft8Soft
    LinkedIn | FB | Twitter | VK | 新浪微博

    #14784
    Avatar
    nick
    Newbie

    Hi Yuri,

    Thanks for your response.
    Weird that the post didn’t include the file that i attached, but you’ve found it nonetheless.

    Could you give me any suggestions on how i can inverse the world position of an annotation?
    All the annotations are children of objects in the scene, so they are positioned at the origin point of their parent.
    So i somehow need to get the world position out of the Matrix4 and then set the matrixworld.position to the inverse of the original value.
    I’ve experimented on how to do this, but i can’t figure it out.

    Kind regards,

    Nick

    #14789
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi Nick,

    Is it possible to just flip the scene back once reflections are rendered so that annotations restore their original positions?

    Founder & CEO at Soft8Soft
    LinkedIn | FB | Twitter | VK | 新浪微博

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.