Home › Forums › General Questions › Annotation issue with Ocean Rendering
Tagged: annotations, Ocean
- This topic has 8 replies, 2 voices, and was last updated 9 months, 2 weeks ago by ps.
-
AuthorPosts
-
2024-01-30 at 2:06 pm #70030psParticipant
Hi,
I am using the Verge3D webgl_shaders_ocean example in a V3D App template to render ocean. Also I have some objects floating on the ocean and used annotations on them to identify it.
There are issues with annotations when combined with ocean rendering, as it is not properly getting displayed in their respective positions. Upon adding the ocean, the annotations are not in their fixed positions and keeps moving based on camera movement.I have used the following code to render ocean
Link: https://github.com/Soft8Soft/verge3d-code-examples/blob/master/webgl_shaders_ocean.htmlconst waterGeometry = new v3d.PlaneGeometry(10000, 10000); water = new Water( waterGeometry, { textureWidth: 512, textureHeight: 512, waterNormals: new v3d.TextureLoader().load('textures/waternormals.jpg', function(texture) { texture.wrapS = texture.wrapT = v3d.RepeatWrapping; }), sunDirection: new v3d.Vector3(), sunColor: 0xffffff, waterColor: 0x001e0f, distortionScale: 3.7, fog: scene.fog !== undefined } ); water.rotation.x = - Math.PI / 2; scene.add(water);
Also I have noticed that if the line water.rotation.x = – Math.PI / 2; is removed the annotations are properly displayed. But it makes the ocean vertical. Also refer the attached puzzle image for annotations.
Thanks
Attachments:
You must be logged in to view attached files.2024-01-30 at 7:29 pm #70036kdvParticipantinstead of
water.rotation.x = -Math.PI / 2;
try
waterGeometry.rotateX(-Math.PI / 2);
use it as the second line, right afterconst waterGeometry
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-01-31 at 8:28 am #70043psParticipantHi @kdv
Thanks for your reply.I tried adding the code in the next line after
const waterGeometry
waterGeometry.rotateX(-Math.PI / 2);
But after adding, the reflections in the water appears to be stretched and the annotations are still not in their designated positions and moving along with the camera. Please refer to the attached image.
Attachments:
You must be logged in to view attached files.2024-01-31 at 1:34 pm #70045kdvParticipantCould you recreate the issue in a little less complicated app and share this app here?
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-01-31 at 4:48 pm #70049psParticipantPlease download the verge3d project from the link below
Link: https://drive.google.com/file/d/1kpF6P07HHwm2Dp2EnZH7Ftx0q6s5g2-3/view?usp=sharing
Refer the screenshot attached. Thanks.
Attachments:
You must be logged in to view attached files.2024-01-31 at 6:33 pm #70054kdvParticipantConsider using an alternative annotation system. It’s not so difficult given you already have CSS styles.
https://v3d.net/smdhttps://drive.google.com/file/d/1fHAfPulsViVnu4xiPI63V_8IeHJ_3rP4/view?usp=sharing
Something definitly wrong with the Annotation class in
v3d.js
. It can take a lot of time to figure outPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-02-01 at 2:12 pm #70087psParticipantHi @kdv, Thank you very much for your help. I am able to create annotations properly.
How can I add a v3d-annotation-dialog when the user clicks an annotation, to add a description. Also by this approach can we hide (fade) the annotations when it is obscured by some geometry. Please let me know.
Thanks.
2024-02-01 at 5:19 pm #70093kdvParticipantHow can I add a v3d-annotation-dialog when the user clicks an annotation
With the help of HTML puzzles (or JS code) and CSS rules. Read a little more about HTML and CSS.
Also by this approach can we hide (fade) the annotations when it is obscured by some geometry
It’s possible with using ray-casting.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-02-02 at 8:05 am #70096psParticipantThanks for your suggestions. I will try it.
-
AuthorPosts
- You must be logged in to reply to this topic.