mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
lighting and correct rotation ZY swap
This commit is contained in:
1 parent
333c310d5b
commit
c6f8c1e6a5
4 files changed
+25
-7
No files matched your search
@@ -86,7 +86,7 @@ public class MonoGltf
|
||||
|
||||
if (transform.TryGet<FQuat>("Rotation", out var rotation))
|
||||
{
|
||||
parent.WithLocalRotation(rotation);
|
||||
parent.WithLocalRotation(SwapYZ(rotation));
|
||||
}
|
||||
|
||||
if (transform.TryGet<FVector>("Translation", out var translation))
|
||||
@@ -279,6 +279,11 @@ public class MonoGltf
|
||||
return res;
|
||||
}
|
||||
|
||||
public static Quaternion SwapYZ(Quaternion q)
|
||||
{
|
||||
return Quaternion.Normalize(new Quaternion(q.X, q.Z, q.Y, -q.W));
|
||||
}
|
||||
|
||||
public static FVector SwapYZAndNormalize(FVector vec)
|
||||
{
|
||||
var res = SwapYZ(vec);
|
||||
|
||||
@@ -9,7 +9,7 @@ const THETA_OFFSET = degToRad(-152);
|
||||
const LIGHT_DISTANCE = 13;
|
||||
const LIGHT_HEIGHT_0 = 4;
|
||||
const LIGHT_HEIGHT_1 = 2;
|
||||
const INTENSITY_0 = 3.5;
|
||||
const INTENSITY_0 = 2.5;
|
||||
const INTENSITY_1 = 1.5;
|
||||
const HEMISPHERE_INTENSITY = 2;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useTankGunModel } from "../../hooks/useTankGunModel";
|
||||
import { useTankHullModel } from "../../hooks/useTankHullModel";
|
||||
import { useTankTurretModel } from "../../hooks/useTankTurretModel";
|
||||
import { TankopediaLighting } from "../TankopediaLighting";
|
||||
import { SceneProps } from "../TankopediaSceneProps";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
interface TankopediaSandboxProps {
|
||||
@@ -51,11 +52,7 @@ function Content({ parameters }: TankopediaSandboxProps) {
|
||||
</group>
|
||||
|
||||
<TankopediaLighting />
|
||||
|
||||
<mesh receiveShadow rotation={[-Math.PI / 2, 0, 0]}>
|
||||
<planeGeometry args={[2 ** 9, 2 ** 9]} />
|
||||
<meshStandardMaterial color="black" />
|
||||
</mesh>
|
||||
<SceneProps />
|
||||
|
||||
<OrbitControls />
|
||||
</>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
const SIZE = 2 ** 6;
|
||||
|
||||
export function SceneProps() {
|
||||
return (
|
||||
<mesh rotation={[-Math.PI / 2, 0, 0]} receiveShadow renderOrder={-1}>
|
||||
<planeGeometry args={[SIZE, SIZE]} />
|
||||
<meshStandardMaterial
|
||||
transparent
|
||||
opacity={0.5}
|
||||
color="black"
|
||||
roughness={1}
|
||||
metalness={0}
|
||||
/>
|
||||
</mesh>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user