Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
HFT-informatics-weekend
AR - Urban Planner
Commits
2761c9ae
Commit
2761c9ae
authored
Oct 11, 2025
by
Stoll
Browse files
Added ambient light
parent
e3227928
Changes
2
Hide whitespace changes
Inline
Side-by-side
webxr-cube/src/components/XRRenderer.tsx
View file @
2761c9ae
...
@@ -42,7 +42,7 @@ export const XRRenderer: React.FC = () => {
...
@@ -42,7 +42,7 @@ export const XRRenderer: React.FC = () => {
mountRef
.
current
.
appendChild
(
button
);
mountRef
.
current
.
appendChild
(
button
);
// --- Lighting ---
// --- Lighting ---
const
light
=
new
THREE
.
Hemisphere
Light
(
0xffffff
,
0
xbbbbff
,
1
);
const
light
=
new
THREE
.
Ambient
Light
(
0xffffff
,
0
.5
);
scene
.
add
(
light
);
scene
.
add
(
light
);
// --- Block manager ---
// --- Block manager ---
...
...
webxr-cube/src/model/GLTFModel.ts
View file @
2761c9ae
import
*
as
THREE
from
"
three
"
;
import
*
as
THREE
from
"
three
"
;
import
type
{
IRenderable
}
from
"
./IRenderable
"
;
import
type
{
IRenderable
}
from
"
./IRenderable
"
;
import
{
GLTFLoader
}
from
"
three/examples/jsm/loaders/GLTFLoader
"
;
import
{
GLTFLoader
}
from
"
three/examples/jsm/loaders/GLTFLoader
"
;
import
{
Texture
}
from
"
three
"
;
export
class
GLTFModel
implements
IRenderable
{
export
class
GLTFModel
implements
IRenderable
{
mesh
:
THREE
.
Object3D
;
mesh
:
THREE
.
Object3D
;
...
@@ -24,6 +25,11 @@ export class GLTFModel implements IRenderable {
...
@@ -24,6 +25,11 @@ export class GLTFModel implements IRenderable {
throw
new
Error
(
`GLB file not found:
${
url
}
`
);
throw
new
Error
(
`GLB file not found:
${
url
}
`
);
}
}
const
textureLoader
=
new
THREE
.
TextureLoader
();
const
texture
:
Texture
=
textureLoader
.
load
(
"
/Textures/variation-a.png
"
);
texture
.
colorSpace
=
THREE
.
SRGBColorSpace
;
const
loader
=
new
GLTFLoader
();
const
loader
=
new
GLTFLoader
();
loader
.
load
(
loader
.
load
(
url
,
url
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment