How to add grids in Forge Viewer and select the model

A grid function needs to be added to the recent project. Refer to the grid effect done by others as follows:

when the mouse hovers over a circle or a straight line, a label prompts

:

demothree.jsthis.viewer.impl.scenehtmlcanvas



Custom objects that pass through three.js must implement Viewer Tool, and Ray Casting:
https://codeshelper.com/a/11.

. For

Ray Casting and pop-up windows, please refer to this example:
https://forge.autodesk.com/bl.

.

and the general idea of this function is:

  1. add Raycaster to the handleMouseMove function
  2. when the mouse hovers and the rays intersect your grid, create a div to display your grid information and add it to viewer container and add it to
  3. hide grid information when the mouse hovers but the ray does not intersect any grid

I hope the above will help!


can I add a three-dimensional grid to the design software before uploading the model for conversion?

Menu