Hi, I wanted to try building a little cube building demo in Verge3D. Basically super simple version of Minecraft where you only can add blocks on top of other blocks.
I have come up with a way to detect the face I hover over with my mouse cursor and moving a “selection icon” over that face with the correct rotation. However, it seems quite slow and unreliable.
I use raycasting from the camera to the mouse position. Then I identify the normal of the intersected face and the corresponding object position. After that I move the indicator to the center of the cube and rotate it in the corresponding direction. See image or project files for details.
Project file: https://www.dropbox.com/t/A5jyDeGtcCb1RbS9
Does anyone have a suggestion for a better approach?
Attachments:
You must be
logged in to view attached files.