Home › Forums › Programming › Overlay webGL – pointer-events
- This topic has 13 replies, 2 voices, and was last updated 4 years, 2 months ago by web.
-
AuthorPosts
-
2020-10-05 at 11:34 am #33819webCustomer
I struggle a bit with an idea I had. I would like to overlay webGL content over prerendered images.
Therefor I try to sync verge with a 360 imagerotator. This is working so far, but now I struggle with the mouse events. At first I had the “pointer-events” disabled for the v3d-container. The imagerotator plugin then switches the images dynamically like in this example:
https://dreidesign.com/wordpress04/wp-content/uploads/otto-wulf/bf3/
In verge I have the camera animated to the exact position like for the renderer images. So whenever you drag in the imagerotator plugin the correct frame is set.Problem now is, that I would like to have hover and click events from the webGL. But because I disabled the pointer-events this doesnt work.
I now struggle a bit what would be the best way connect the parts:
First I thought of using the on drag event and set the camera animation to the specific frame and I could easily tell the imagerotator plugin to display a specific frame. But I dont know how to use the drag event to get usable coordiantes to work with. Also the drag event doesnt work for the background.So maybe a better approach would be to use the standard camera controls, but I dont want to “really” control the camera. But set a specific animation frame.
Hope you know what I mean.
2020-10-05 at 11:38 am #33820Yuri KovelenovStaffBut set a specific animation frame.
A possible approach can be animating your static camera in 3ds Max, and then using the puzzle set animation frame to set the required view in sync with the imagerotator.
2020-10-05 at 1:26 pm #33825webCustomerI did that. So that isn’t a problem. But because the webGL is overlaying the imagerotator container, I can just choose to use mouse events for v3d or the imagerotator not both. And this is the problem I currently have.
When I set the pointer-events for v3d container to “none”, I can have a perfect sync with the “set animation frame” but I loose the possibility to have hover and click events in the v3d.
2020-10-05 at 2:34 pm #33826Yuri KovelenovStaff2020-10-05 at 3:13 pm #33833webCustomerI think we not talking about the same.
I’ve prepared an example, hope its understandable:
The first url is like it should be. The webGL overlays the imagerotator and the webGL container is set to “pointer-events:none”. Rotating works like it should be:
https://dreidesign.com/dev/But I also would like to have the webGL clickable/hoverable. Therefor I would need to set the pointer-events back to normal. But then I loose the events of the imagerotator. See my second example:
https://dreidesign.com/dev/index02.htmlSo at the moment my approach would be. Disable all kind of camera controls in v3d. And have the v3d background ignore any pointer events so that they are passed to the imagerotator.
2020-10-06 at 6:32 am #33854Yuri KovelenovStaffSo at the moment my approach would be. Disable all kind of camera controls in v3d. And have the v3d background ignore any pointer events so that they are passed to the imagerotator.
this seems to be a logic approach. But it does not work?
2020-10-06 at 7:35 am #33871webCustomerI dont know how I can ignore pointer events for just the v3d background. I can only disable pointer events for the whole v3d container.
2020-10-06 at 7:47 am #33874Yuri KovelenovStaff2020-10-06 at 7:51 am #33875webCustomerYeah I set the background as transparent. When there is no way to pass pointer events to the 3d canvas and the underlying html element, I need to find another approach.
2020-10-06 at 11:45 am #33897webCustomerWould it be possible to let the camera rotate/orbit in predefined angles? Or can you remap the orbiting to set animation frames instead of navigating the camera?
2020-10-06 at 12:02 pm #33900Yuri KovelenovStaffOr can you remap the orbiting to set animation frames instead of navigating the camera?
yep this is possible. see my suggestion above.
See also this tutorial: https://www.youtube.com/watch?v=py0LGEsGxIU&t=753s
2020-10-06 at 1:26 pm #33911webCustomerI just see how to set animated frame by scrolling. Not by dragging like orbit controls.
2020-10-06 at 2:00 pm #33913Yuri KovelenovStaff2020-10-06 at 2:13 pm #33915webCustomerSorry, dont get it. I dont need scrolling and I already know how to setAnimatedFrames. I think its to advanced stuff, which would need some serious reworks. Will try to get this solved on my own.
-
AuthorPosts
- You must be logged in to reply to this topic.