We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Unexpected behavior of Verge3D Annotations

Home Forums Programming Unexpected behavior of Verge3D Annotations

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14727
    nick
    Participant

    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

    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?

    Chief 3D Verger | LinkedIn | Twitter

    #14784
    nick
    Participant

    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

    Hi Nick,

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

    Chief 3D Verger | LinkedIn | Twitter

    #15934
    Anonymous
    Inactive

    Wow, great project. I would like to ask you, Nick, if you could help me with something. I imported already the ocean code into verge3d and removed the default sphere out of it. Now I try to figure out how can I load my own objects into this scene. I use loading scene interface but the objects are not rendered in the water. In your project, you import world, sky and all environment after the boat is loaded, I can reproduce that but I like to do in other way. Would you like to give me some hints? do I need f.e. gltfload.js and where do I put my assets (objects to laod) list in the scripts…I am very confused, because there is no little example in the forum how to implement such a things…I just need some kick in the right direction…Thanks :)

    #15936
    nick
    Participant

    Hello Abin,

    First of all, thanks for the compliment.
    Secondly, do you use the puzzles or do you write all your JS yourself?
    I’d like to see your project file to find out how to help you.

    Do you have the code anywhere online? if not, i believe you can upload it on the forum.

    (I’ll probably replay in a couple of day because of the weekend)
    Kind regards,

    Nick

    #15940
    Anonymous
    Inactive

    oh thank you, Nick! I try to work with verge puzzles. I am not programmer.
    A least I can modify codes(limited). I just try to find a pipeline to implement codes from outside to verge. Take a look on my try
    I use here the puzzle to load specific assets into the ocean. Thank you!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.