Adding 3D models in webgl_geometry_minecraft_ao.html example code

Hello all,

I want to add 3D model like buildings and streetlights into an example " "
I could go through the code and somehow make the whole land flat. Now I want to add a 3D model but am not sure which part of code I should add (Sorry I am not a programmer, I am mechanical engineer trying some cool stuffs). Can someone please explain me the procedure to do the same.

I want to add a 3D model and give a external website link to that (For eg:- there will be a building with Bosch company and someone can simply click on the building and redirected to bosch website).

Thank you in advance.

For loading models take a look at glTF loader example (source code; glTF is the recommended model type for three.js, but you can use other loaders as well.)

For click behaviour (going to website after clicking on model), you can use either raycasting (source code), or maybe mix of DOM and WebGL using CSS2DRenderer (source code). Three doesn’t have any built-in click events, so the easiest way to do it would be to use native onMouseDown event and determine which model was hovered when mouse was clicked.