Game
- Added more ball in scene - Modify Lambert texture to Physical - Implement RectAreaLight in scene
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/07 16:07:51 by hubourge #+# #+# */
|
||||
/* Updated: 2024/08/07 16:12:33 by hubourge ### ########.fr */
|
||||
/* Updated: 2024/08/08 15:37:06 by hubourge ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -20,7 +20,7 @@ let BoxThickness = 0.1;
|
||||
function createBox(scene, x, y, z)
|
||||
{
|
||||
const geometryBox = new THREE.BoxGeometry(BoxWidth, BoxHeight, BoxThickness);
|
||||
const materialBox = new THREE.MeshLambertMaterial({
|
||||
const materialBox = new THREE.MeshPhysicalMaterial({
|
||||
color: 0xff0000,
|
||||
});
|
||||
const box = new THREE.Mesh(geometryBox, materialBox);
|
||||
@ -31,4 +31,15 @@ function createBox(scene, x, y, z)
|
||||
return box;
|
||||
}
|
||||
|
||||
function createBall(scene, x, y, z, geometryBall, materialBall) {
|
||||
const ball = new THREE.Mesh(geometryBall, materialBall);
|
||||
ball.position.x = x;
|
||||
ball.position.y = y;
|
||||
ball.position.z = z;
|
||||
ball.castShadow = true;
|
||||
scene.add(ball);
|
||||
return ball;
|
||||
}
|
||||
|
||||
export { createBall };
|
||||
export { createBox };
|
Reference in New Issue
Block a user