100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary Complete beginners guide to Three.js

Rating
-
Sold
-
Pages
11
Uploaded on
26-12-2024
Written in
2024/2025

In this guide you'll learn the complete basics to T and learn how to create your own stunning 3D graphics in a web based environment

Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
December 26, 2024
Number of pages
11
Written in
2024/2025
Type
Summary

Subjects

Content preview

PROJECTION MAPPING

THREE.JS


WHAT IS IT?
- A high-level JavaScript library for creating and displaying 3D graphics in web
browsers
- Simplifies 3D graphics creation and animation (models, particle systems, lights,
cameras) without low-level WebGL code knowledge
-




1) Scene: Bevat alles wat bekenen wordt
 Onder de scene is alles een parent sibling relatie
o Voordeel: Goed voor organisatie, overerving van transformaties
2) Camera: Bepaalt wat bekeken wordt door een user in die tijd
3) Renderer: neemt informatie van de scene en camera en geeft een foto of
reeks fotos door aan de gebruiker
 Voor animaties of interactiviteit wordt de renderer meerdere keren
geroepen (= 60 fps of meer), vandaar de loop bij de renderer

, BASICS

IMPORT THREE.JS
import * as THREE from 'three';




INITIALIZE THE SCENE
const scene = new THREE.Scene()




ADD OBJECTS TO THE SCENE
const cubeGeometry = new THREE.BoxGeometry(1,1,1)
const cubeMaterial = new THREE.MeshBasicMaterial({color: "red"})

const cubeMesh = new THREE.Mesh(
cubeGeometry,
cubeMaterial
)
scene.add(cubeMesh)




INITIALIZE THE CAMERA
const camera = new THREE.PerspectiveCamera(
35,
window.innerWidth / window.innerHeight,
0.1,
35)
camera.position.z = 5




INITALIZE THE RENDERER
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Starter</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<canvas class="threejs"></canvas>
<script type="module" src="./script.js"></script>
</body>
</html>




const canvas = document.querySelector('canvas.threejs')
const renderer = new THREE.WebGLRenderer({
canvas: canvas
})
renderer.setSize(window.innerWidth, window.innerHeight)
renderer.render(scene, camera)
$7.78
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
woutnba

Get to know the seller

Seller avatar
woutnba Odisee Hogeschool
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
1 year
Number of followers
0
Documents
13
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions