mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: start of new lighting
This commit is contained in:
1 parent
f3762e356f
commit
94cbd95509
7 files changed
+40
-238
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import { Vector3 } from 'three';
|
||||
import { awaitableModelDefinitions } from '../../../core/awaitables/modelDefinitions';
|
||||
import { jsxTree } from '../../../core/blitzkit/jsxTree';
|
||||
import { useModel } from '../../../hooks/useModel';
|
||||
@@ -32,17 +31,6 @@ export function Model() {
|
||||
const gunTurretModel = gunTankModel.turrets[gun.turret.id];
|
||||
const gunModel = gunTurretModel.guns[gun.gun.id];
|
||||
|
||||
const turretDelta = new Vector3(
|
||||
tankModel.turret_origin.x - turretTankModel.turret_origin.x,
|
||||
tankModel.turret_origin.y - turretTankModel.turret_origin.y,
|
||||
tankModel.turret_origin.z - turretTankModel.turret_origin.z,
|
||||
);
|
||||
const gunDelta = new Vector3(
|
||||
turretModel.gun_origin.x - gunTurretModel.gun_origin.x,
|
||||
turretModel.gun_origin.z - gunTurretModel.gun_origin.z,
|
||||
turretModel.gun_origin.y - gunTurretModel.gun_origin.y,
|
||||
);
|
||||
|
||||
return (
|
||||
<group rotation={[-Math.PI / 2, 0, 0]}>
|
||||
{hullNodes.map((node) => {
|
||||
@@ -55,7 +43,7 @@ export function Model() {
|
||||
|
||||
return jsxTree(node, {
|
||||
mesh(_, props, key) {
|
||||
return <mesh {...props} key={key} />;
|
||||
return <mesh {...props} key={key} castShadow receiveShadow />;
|
||||
},
|
||||
});
|
||||
})}
|
||||
@@ -86,7 +74,7 @@ export function Model() {
|
||||
|
||||
return jsxTree(node, {
|
||||
mesh(_, props, key) {
|
||||
return <mesh {...props} key={key} />;
|
||||
return <mesh {...props} key={key} castShadow receiveShadow />;
|
||||
},
|
||||
});
|
||||
})}
|
||||
@@ -126,7 +114,7 @@ export function Model() {
|
||||
|
||||
return jsxTree(node, {
|
||||
mesh(_, props, key) {
|
||||
return <mesh {...props} key={key} />;
|
||||
return <mesh {...props} key={key} castShadow receiveShadow />;
|
||||
},
|
||||
});
|
||||
})}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Environment, OrbitControls } from '@react-three/drei';
|
||||
import { OrbitControls } from '@react-three/drei';
|
||||
import { Canvas } from '@react-three/fiber';
|
||||
import { Suspense } from 'react';
|
||||
import { Model } from './components/Model';
|
||||
@@ -6,16 +6,16 @@ import { Model } from './components/Model';
|
||||
export function MixerScene() {
|
||||
return (
|
||||
<Canvas
|
||||
shadows
|
||||
camera={{
|
||||
fov: 65,
|
||||
fov: 45,
|
||||
position: [5, 5, -5],
|
||||
}}
|
||||
>
|
||||
<OrbitControls />
|
||||
|
||||
<Environment preset="lobby" />
|
||||
{/* <ambientLight intensity={6} />
|
||||
<pointLight position={[10, 10, 10]} /> */}
|
||||
<directionalLight position={[10, 10, 10]} intensity={5} castShadow />
|
||||
<directionalLight position={[-10, -10, -10]} intensity={3} castShadow />
|
||||
|
||||
<Suspense fallback={null}>
|
||||
<Model />
|
||||
|
||||
Reference in new issue
Block a user