Hi everyone.
I’m making a portfolio site for a 3D artist and I need to create a 3D model viewport.
For this I use the GLTF format model.
For now I can load the model and rotate it using the OrbitController.
But I still have 2 problems:
- I can’t use HDR image for background. I’ve tried to make it by this guide (11 How to make 360 HDRI background three.js - YouTube), but it doesn’t work.
Here’s my code: (all libraries )
LOADING_MANAGER = new THREE.LoadingManager();
RGBE_LOADER = new THREE.RGBELoader(LOADING_MANAGER);
RGBE_LOADER.load('./media/hdr/quarry_01_1k.hdr', function(hdr){
hdr.mapping = THREE.EquirectangularReflectionMapping;
SCENE.background = hdr;
SCENE.environment = hdr;
});
I add all libraries in html code, for example:
<script src='https://unpkg.com/three@0.99.0/build/three.js'></script>
<script src='https://unpkg.com/three@0.99.0/build/three.min.js'></script>
<script src='https://unpkg.com/three@0.99.0/examples/js/loaders/GLTFLoader.js'></script>
<script src='https://unpkg.com/three@0.99.0/examples/js/loaders/RGBELoader.js'></script>
<script src='https://unpkg.com/three@0.99.0/examples/js/controls/OrbitControls.js'></script>
- When I scrolling, camera in viewport moving away from model and scrolling website at the same time.
I want the camera to move only when the mouse is in the viewport area. And the website only scrolled when the mouse was out of the viewport.
Can I check this somehow?