Tagged: container, Cursor, eventlistener, events, mousemove
- This topic has 4 replies, 2 voices, and was last updated 1 year, 7 months ago by Webenart.
-
AuthorPosts
-
2023-04-28 at 5:22 pm #63325WebenartCustomer
hi,
i set that puzzle for the mouse to follow the cursor, it works, but it does only inside the v3d-container, i need the mouse event to happen on the whole browser,. not just on the verge3d container.
i tried:
“document”,
“window”.
and “body”it supposes to work with document option, also tried the “in parent doc” but no difference. it works only when the cursor is inside the v3d-container.
I implement the verge3d project by adding to the container i need the id “v3d-container” on a wordpress website . No iframe, no index file etc.
regards
Webenart | Creative Websites
webenart.com2023-04-28 at 8:33 pm #63326kdvParticipantit works, but it does only inside the v3d-container
that’s because only
v3d-container
has an event listener to read the screen coordinates.
read hear https://www.soft8soft.com/topic/move-head-animation-by-moving-the-mouse-2/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.
2023-04-28 at 9:11 pm #63327WebenartCustomerHi,
So i tried it,
const xNorm = event.offsetX / event.target.clientWidth;
const yNorm = event.offsetY / event.target.clientHeight;
VARS.pGlob.screenCoords.x = xNorm * 2 – 1;
VARS.pGlob.screenCoords.y = -yNorm * 2 + 1;indeed i get movement outside of v3d-container, that’s a good start, but when the mouse got from the v3d-container to the parent container the movement of the 3d object it is way larger than inside the container, and its sudden, it is noticable that you are getting out of the container with the cursor, bcs the object “jumps” to a different location, like the center changes.
I tried a few different parent containers for the possibility there is an issue with the one i chose, still the same.
regards
Webenart | Creative Websites
webenart.com2023-04-28 at 9:20 pm #63328kdvParticipantWell, now that’s your quest. You need to figure out how to block the event listener in
v3d-container
and read the screen coordinates from the parent window only…the object “jumps” to a different location, like the center changes.
that’s because the center is really changed…
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.
2023-04-28 at 9:40 pm #63329WebenartCustomerUnfortunately i have not the skills to do that, thanks for the help anyway :)
Webenart | Creative Websites
webenart.com -
AuthorPosts
- You must be logged in to reply to this topic.