Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • e47747u/webgl25
  • vincen251u/webgl25
  • villard5/webgl25
3 results
Show changes
Commits on Source (4)
...@@ -52,30 +52,30 @@ body{ ...@@ -52,30 +52,30 @@ body{
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.centre{ #webGL {
border: none; .accroche{
width: 100%; font-weight: bold;
padding: 40px; padding: 40px;
font-size: 20px; font-size: 30px;
font-weight: bold; }
color: cadetblue;
text-align: center; .projetAndOriginal {
margin-bottom: 40px; display: flex;
} justify-content: center;
.projetAndOriginal{ align-items: center;
display: flex; }
justify-content: space-around;
align-items: center; .explications{
gap: 20px; text-align: center;
width: 100%; font-size: 17px;
height: 100%; padding: 20px;
.original{ }
width: 100%;
.original img {
max-width: 100%;
height: 500px; height: 500px;
border: 1px solid red; border: 2px solid black;
background-image: url(img.jpg);
background-size: 100%;
} }
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>TP 1</title> <title>TP 1</title>
<link rel="icon" type="image/x-icon" href="/images/favicon.ico"> <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="app.css"> <link rel="stylesheet" href="app.css">
<style> <style>
body { margin: 0; } body { margin: 0; }
canvas { width: 100%; height: 100% } canvas { width: 100%; height: 100% }
...@@ -18,26 +18,31 @@ ...@@ -18,26 +18,31 @@
<h1 class="title">THREE.JS Project</h1> <h1 class="title">THREE.JS Project</h1>
<p class="subtitle">Découvrez notre petit projet en three.js !</p> <p class="subtitle">Découvrez notre petit projet en three.js !</p>
</header> </header>
<main> <!-- API importe du site de Three.js -->
<!-- Un titre centre --> <script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
<div id="webGL" class="centre">Juste un bol, des fruits, et des fleurs</div> <script type="importmap">
{
<!-- API importe du site de Three.js --> "imports": {
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script> "three": "https://threejs.org/build/three.module.js",
<script type="importmap"> "three/addons/": "https://threejs.org/examples/jsm/"
{
"imports": {
"three": "https://threejs.org/build/three.module.js",
"three/addons/": "https://threejs.org/examples/jsm/"
}
} }
</script> }
<!-- JQuery pour afficher les erreurs --> </script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Mon script avec un chemin relatif --> <main>
<div class="projetAndOriginal"> <div id="webGL" class="centre">
<div class="scene"><script type="module" src="projet.js"></script></div> <p class="accroche">Juste un bol, des fruits, et des fleurs</p>
<div class="original"></div> <p class="explications">Ceci est un projet, censé representer la scene originale présentée en photo en premier plan. Des modifications<br>ont été apportées tant bien
que mal. Ayant commencé le design des pommes avec blender, nous avons eu beaucoup de mal à les exporter en three.js. Mais nous avons fait de notre mieux et ésperont que vous apprecirez ce modeste design
</p>
<div class="projetAndOriginal">
<div class="scene">
<script type="module" src="projet.js"></script>
</div>
<div class="original">
<img src="img.jpg" alt="Image originale">
</div>
</div>
</div> </div>
</main> </main>
</body> </body>
......
...@@ -431,8 +431,8 @@ function fillScene() { ...@@ -431,8 +431,8 @@ function fillScene() {
function init() { function init() {
// For grading the window is fixed in size; here's general code: // For grading the window is fixed in size; here's general code:
var canvasWidth = window.innerWidth/2; var canvasWidth = window.innerWidth;
var canvasHeight = window.innerHeight/2; var canvasHeight = window.innerHeight;
var canvasRatio = canvasWidth / canvasHeight; var canvasRatio = canvasWidth / canvasHeight;
// RENDERER // RENDERER
......