adds skybox

This commit is contained in:
buttle 2021-10-06 12:53:50 +02:00
parent 0bda706671
commit 9a1c0af61d
2 changed files with 8 additions and 2 deletions

View File

@ -91,6 +91,12 @@ class Render3D extends AbstractBlockLayout
} }
$width = $block->dataValue('width'); $width = $block->dataValue('width');
$height = $width; $height = $width;
$skybox = null;
foreach($urls as $url) {
if (strpos($url, "sky-box-image")) {
$skybox = $url;
}
}
return $view->partial('common/block-layout/render-3d', [ return $view->partial('common/block-layout/render-3d', [
'model_type' => $model_type, 'model_type' => $model_type,
'title' => $block->dataValue('title'), 'title' => $block->dataValue('title'),
@ -99,7 +105,7 @@ class Render3D extends AbstractBlockLayout
'item_url' => $attachments[0]->item()->url(), 'item_url' => $attachments[0]->item()->url(),
'renderSourceLink' => $block->dataValue('renderSourceLink'), 'renderSourceLink' => $block->dataValue('renderSourceLink'),
'addPreLoadImage' => 1, 'addPreLoadImage' => 1,
'skybox' => 0, 'skybox' => $skybox,
'urls' => $urls, 'urls' => $urls,
'id' => 'v3d-' . ++$id, 'id' => 'v3d-' . ++$id,
'mediaTypes' => $media_types, 'mediaTypes' => $media_types,

View File

@ -41,7 +41,7 @@ model-viewer {
camera-controls="" camera-controls=""
background-color="#455A64" background-color="#455A64"
<?php if ($skybox) { ?> <?php if ($skybox) { ?>
skybox-image="{{ object['skybox'] }}" skybox-image="<?= $skybox ?>"
<?php } ?> <?php } ?>
> >
<?php if($addPreLoadImage) { ?> <?php if($addPreLoadImage) { ?>