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
8e5d3092
Commit
8e5d3092
authored
3 months ago
by
Percen
Browse files
Options
Download
Email Patches
Plain Diff
Update public/index.html
parent
f7cc887d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/index.html
+45
-1
public/index.html
with
45 additions
and
1 deletion
+45
-1
public/index.html
+
45
-
1
View file @
8e5d3092
...
...
@@ -569,6 +569,50 @@
}
}
function
calculateBoundingBox
(
object
)
{
const
box
=
new
THREE
.
Box3
().
setFromObject
(
object
);
const
size
=
new
THREE
.
Vector3
();
box
.
getSize
(
size
);
return
size
;
}
function
calculateMaxScale
(
object
)
{
const
boundingBox
=
calculateBoundingBox
(
object
);
const
viewportWidth
=
window
.
innerWidth
;
const
viewportHeight
=
window
.
innerHeight
;
// Berechne den Skalierungsfaktor für Breite und Höhe
const
scaleWidth
=
viewportWidth
/
boundingBox
.
x
;
const
scaleHeight
=
viewportHeight
/
boundingBox
.
y
;
// Wähle den kleineren Faktor, um sicherzustellen, dass das Objekt nicht aus dem Bildschirm herausragt
return
Math
.
min
(
scaleWidth
,
scaleHeight
);
}
function
openScaleMenu
()
{
if
(
!
selectedPlacedModel
)
{
showInfoDialog
(
"
Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es bearbeiten.
"
);
return
;
}
// Berechne die maximale Skalierung
const
maxScale
=
calculateMaxScale
(
selectedPlacedModel
);
// Aktuelle Skalierung des Modells bestimmen
const
currentScale
=
selectedPlacedModel
.
scale
.
x
;
const
dynamicMenu
=
document
.
getElementById
(
"
dynamic-menu
"
);
dynamicMenu
.
style
.
display
=
"
flex
"
;
dynamicMenu
.
innerHTML
=
`
<h3>Skalierung anpassen</h3>
<label>Größe: <span id="scale-value">
${
currentScale
.
toFixed
(
2
)}
</span><input type="range" min="0.01" max="
${
maxScale
}
" step="0.01" value="
${
currentScale
}
" onchange="updateScale(this.value)"></label>
<button onclick="closeDynamicMenu()">Zurück</button>
`
;
}
/**
*
function openScaleMenu() {
if (!selectedPlacedModel) {
showInfoDialog("Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es bearbeiten.");
...
...
@@ -585,7 +629,7 @@
<label>Größe: <span id="scale-value">${currentScale.toFixed(2)}</span><input type="range" min="0.01" max="3" step="0.01" value="${currentScale}" onchange="updateScale(this.value)"></label>
<button onclick="closeDynamicMenu()">Zurück</button>
`;
}
}
*/
function
updateScale
(
value
)
{
if
(
selectedPlacedModel
)
{
...
...
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