Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5e677fcb authored by Villard PierreFrederic's avatar Villard PierreFrederic
Browse files

exo3

parent 5e872aac
No related branches found
No related tags found
No related merge requests found
Pipeline #920963 passed
......@@ -12,21 +12,30 @@ import { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import {dat} from './lib/dat.gui.min.js';
var camera, scene, renderer;
var camera, renderer;
var windowScale;
window.scene = new THREE.Scene();
import {Coordinates} from './lib/Coordinates.js';
function someObject(material) {
var geometry = new THREE.Geometry();
var geometry = new THREE.BufferGeometry();
// Student: some data below must be fixed
// for both triangles to appear !
geometry.vertices.push( new THREE.Vector3( 3, 3, 0 ) );
geometry.vertices.push( new THREE.Vector3( 7, 3, 0 ) );
geometry.vertices.push( new THREE.Vector3( 7, 7, 0 ) );
geometry.vertices.push( new THREE.Vector3( 3, 7, 0 ) );
const vertices = new Float32Array( [
3, 3, 0,
7, 3, 0,
7, 7, 0,
7, 7, 0,
3, 7, 0,
3, 3, 0
] );
geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.faces.push( new THREE.Face3( 0, 1, 2 ) );
geometry.faces.push( new THREE.Face3( 2, 0, 3 ) );
var mesh = new THREE.Mesh( geometry, material );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment