Home › Forums › Programming › Unexpected behavior of Verge3D Annotations
- This topic has 6 replies, 3 voices, and was last updated 5 years, 5 months ago by Anonymous.
-
AuthorPosts
-
2019-05-14 at 11:12 am #14727nickParticipant
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
2019-05-14 at 1:10 pm #14731Yuri KovelenovStaffHi 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?
2019-05-15 at 9:43 am #14784nickParticipantHi 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
2019-05-15 at 9:54 am #14789Yuri KovelenovStaff2019-06-28 at 2:03 pm #15934AnonymousInactiveWow, 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 :)
2019-06-28 at 2:30 pm #15936nickParticipantHello 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
2019-06-29 at 7:13 am #15940AnonymousInactiveoh 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! -
AuthorPosts
- You must be logged in to reply to this topic.