Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GeoVistoogsi
AR
Commits
adba503e
Commit
adba503e
authored
3 months ago
by
Percen
Browse files
Options
Download
Email Patches
Plain Diff
Update public/index.html
parent
0b0a7af5
master
21caog1bif-master-patch-76399
21caog1bif-master-patch-83779
21caog1bif-master-patch-96693
1 merge request
!78
Update public/index.html
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+2
-34
public/index.html
with
2 additions
and
34 deletions
+2
-34
public/index.html
+
2
-
34
View file @
adba503e
...
...
@@ -18,20 +18,6 @@
background-size
:
cover
;
background-position
:
center
;
}
button
{
position
:
fixed
;
top
:
10%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
padding
:
15px
;
font-size
:
18px
;
background-color
:
rgba
(
255
,
255
,
255
,
0.7
);
border
:
none
;
cursor
:
pointer
;
}
button
:hover
{
background-color
:
rgba
(
255
,
255
,
255
,
1
);
}
</style>
<script
src=
"https://unpkg.com/three@0.126.0/build/three.js"
></script>
<script
src=
"https://unpkg.com/three@0.126.0/examples/js/loaders/GLTFLoader.js"
></script>
...
...
@@ -40,7 +26,6 @@
<script>
let
selectedModel
=
'
robot
'
;
// Standardauswahl
let
models
=
{};
let
currentModel
=
null
;
// Variable für das aktuell angezeigte Modell
let
reticle
;
async
function
activateXR
()
{
...
...
@@ -84,6 +69,8 @@
session
.
requestAnimationFrame
(
onXRFrame
);
// AR-Rendering
function
onXRFrame
(
time
,
frame
)
{
session
.
requestAnimationFrame
(
onXRFrame
);
...
...
@@ -105,15 +92,6 @@
reticle
.
visible
=
true
;
reticle
.
position
.
set
(
hitPose
.
transform
.
position
.
x
,
hitPose
.
transform
.
position
.
y
,
hitPose
.
transform
.
position
.
z
);
reticle
.
updateMatrixWorld
(
true
);
// Aktuelles Modell anzeigen
if
(
currentModel
!==
models
[
selectedModel
])
{
if
(
currentModel
)
{
scene
.
remove
(
currentModel
);
// Entferne das alte Modell
}
currentModel
=
models
[
selectedModel
];
scene
.
add
(
currentModel
);
// Füge das neue Modell hinzu
}
}
renderer
.
render
(
scene
,
camera
);
...
...
@@ -121,11 +99,6 @@
}
}
// Modellwechsel-Funktion
function
toggleModel
()
{
selectedModel
=
(
selectedModel
===
'
robot
'
)
?
'
flower
'
:
'
robot
'
;
}
// AR starten
if
(
navigator
.
xr
)
{
const
startButton
=
document
.
createElement
(
'
button
'
);
...
...
@@ -136,11 +109,6 @@
startButton
.
remove
();
activateXR
();
};
const
toggleButton
=
document
.
createElement
(
'
button
'
);
toggleButton
.
textContent
=
'
Wechseln zwischen Robot und Sonnenblume
'
;
toggleButton
.
onclick
=
toggleModel
;
document
.
body
.
appendChild
(
toggleButton
);
}
else
{
alert
(
'
WebXR wird nicht unterstützt.
'
);
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets