Skip to content
Advertisement

Tag: three.js

only part of gltf model appearing using three.js

I have been trying to add this gltf model ( https://poly.google.com/view/28RBIWE8jzc ) using threeJS’. The code below is the only way that I have been able to see anything and I only see a small part of the object. If anyone knows what needs to be changed I would appreciate some help. Answer The baseball asset is quite large so

Three.js – Model cannot receive any shadow

I’m currently new and learning about three.js. And i’m using react-three-fiber to make it happen with React, but i stumbled upon a problem. The model however, cannot receive any shadow from another model. I’ve tried to use obj.castShadow = true and obj.receiveShadow = true to one of the receiving shadow model object on the parent and the children as well

Raycaster do not stays in center when i am updating camera

guys i have a problem with Raycasting and i couldn’t find solution so far. What i am trying to archieve is that, i want Raycaster to stay always in center, like when i move my camera and look other direction i want Raycaster to stay in center and update please help me. I am using FirstPersonControls, This is the code

How to create WebGL 2 renderer in iOS?

I am trying to create a THREE.WebGLRenderer, but it seems that on iOS, it will only create a WebGL 1. Here is my code for creating the renderer and printing the capability: Is there a way to create WebGL2 renderer on iOS? Answer Browsers on iOS all use WebKit which does not yet support WebGL 2.

Javascript / Three.js is not working in https

I recently switched my http site to https. Since I made this change, one of my projects no longer works. In this random generator, the background using the Three.js library does not appear when the url is in https But in http , it works beautiful and well. Does anyone know any solution to this problem? Thank you for your

How to scale a three.js sprite?

I am trying to display a sprite in three on javascript and make it bigger. I tried the following: and but the sprite was very very tiny in the middle of the browser window. I saw no error on the console. What am I doing wrong? Answer Sprite.size does not exist. Try to modify Sprite.scale instead. Check out the following

Three.js + OrbitControls – Uncaught TypeError: Cannot read property ‘addEventListener’ of undefined

I am tryint to use OrbitControls in THREE.js. If I removed the line let cameraControl = new OrbitControls(camera) from below, there will be no error. But now, I have “Uncaught TypeError: Cannot read property ‘addEventListener’ of undefined” I tried to change OrbitControls(camera) to THREE.OrbitControls(camera), and then I had “Uncaught TypeError: THREE.OrbitControls is not a constructor”. I tried to import OrbitControls.js

Advertisement