Hi,
I have searched the net and yet despite the many examples I can’t seem to apply it to my project.
https://r105.threejsfundamentals.org/threejs/lessons/threejs-align-html-elements-to-3d
Can you help me find answer? How to insert scene into div block on the html page?
I created tag canvas and placed in this tag my script, but my code like a example was creating new scene on the full height and width of screen below my div.
Страница
<!-- Подключаем библиотеки JS -->
<script src="js/three.min.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/OBJLoader.js"></script>
<script src="js/stats.min.js"></script>
</head>
<body>
<heade…
Could you tell me how to integrate my scene three.js with a green to die for in my “app” div so that all this ugly color fills my page? Here below is my codesandbox :
Thanks a lot
tfoller
December 10, 2021, 10:23am
2
It’s not really a THREE problem, it’s a HTML problem.
As a quick solution replace this line 48 in “index.js”
document.body.appendChild(renderer.domElement);
with this:
const stl = renderer.domElement.style;
stl.position = "absolute";
stl.top = "0px";
stl.left = "0px";
stl.zIndex = "-1";
1 Like