SlideShare uma empresa Scribd logo
1 de 22
Introduction to three.js
https://github.com/Toronto-WebGL-Meetup/Talk_10-December-2015
About Me
● Gareth Marland (@garethmarland)
● British
● By day, Autodesk Revit Server
● By night, Dotstorming and Boardthing
Moving from 2D to 3D
● Traditional 2D web development is like creating
a shareable document
● 3D web development is like creating a
shareable movie scene
Creating your scene
● The light source
● The camera
● The renderer
Lights, Camera, Action!
example1.html
The light source
● Ambient Light
– Applies a light globally. To every object in the scene
● Point Light
– Shines light in all directions and lights up anything that
is in range
● Directional Light
– The most commonly used lighting
– Works like a spotlight, in a position and shines in a
direction
Light source examples
● Ambient Light
var ambLight = new THREE.AmbientLight(0x404040);
scene.add(ambLight);
● Point Light
var pointLight = new THREE.PointLight(0x0033ff, 3, 150);
pointLight.position.set(70, 5, 70);
scene.add(pointLight);
● Directional Light
var dirLight = new THREE.DirectionalLight(0xffffff, 1);
dirLight.position.set(100, 100, 50);
scene.add(dirLight);
The camera
● Orthographic Camera
– Does not take a objects distance from the camera into
account when drawing
– Created with top, bottom, left, right, near and far
● Perspective Camera
– The most commonly used
– Takes an objects distance from he camera into account
– Created with fov, aspect ratio, near and far
The camera
The renderer
● Draws the scene
● Can be set up to loop in order to animate
● Needs to be attached to an HTML element
var renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(containerWidth, containerHeight);
document.getElementById(“container”).appendChild(renderer.domElement);
var renderScene = function () {
requestAnimationFrame( renderScene );
renderer.render(scene, camera);
};
renderScene()
Putting it together
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, containerWidth/containerHeight, 0.1, far);
scene.add(camera);
var pointLight = new THREE.PointLight(0xffffff, 1);
pointLight.position.set(0,5,5);
scene.add(pointLight);
var renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(containerWidth, containerHeight);
document.getElementById(“container”).appendChild(renderer.domElement);
var renderScene = function () {
requestAnimationFrame( renderScene );
renderer.render(scene, camera);
};
renderScene();
Creating an object
● Define the geometry
– Use a predefined three.js object
– Define your own vertices
– Use a modelling tool
● Define the material
– Basic
– Lambert
– Phong
– Custom
●
Create the mesh
●
Add it to the scene
example2.html
Animating an object
● Should be updated within the rendering method
● The rendering only needs to be called when a
change needs to be made
var render = function () {
var that = this;
var updateScene = function() {
// Do your updates to the object here
}
var renderScene = function () {
requestAnimationFrame( renderScene );
updateScene();
renderer.render(scene, camera);
};
renderScene();
}
example3.html
Selecting objects
● Selecting needs to work differently in 3D
● We using something called “raycasting”
● It's basically shooting lazers in space and
seeing what we hit!
Selecting objects example
var mousePosition = new THREE.Vector2();
mousePosition.x = 2 * (mouseEvent.x / renderer.domElement.clientWidth) - 1;
mousePosition.y = 1 - 2 * (mouseEvent.y / renderer.domElement.clientHeight );
var raycaster = new THREE.Raycaster();
raycaster.setFromCamera(mousePosition, camera);
var intersected = raycaster.intersectObject(scene, true);
example4.html
Controlling the camera
● Bind the camera to a mouse event
● Include a library such as OrbitControls.js
example5.html
Advantages of the medium
● Can be opened in a browser
● Can be mixed and matched with other web
based technologies
– Websockets
– HTML Canvas
● Fairly easy to understand
fin

Mais conteúdo relacionado

Mais procurados

[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 

Mais procurados (20)

Angular Directives
Angular DirectivesAngular Directives
Angular Directives
 
쉽게 풀어보는 WebGL
쉽게 풀어보는 WebGL쉽게 풀어보는 WebGL
쉽게 풀어보는 WebGL
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-Frame
 
WEB DEVELOPMENT USING REACT JS
 WEB DEVELOPMENT USING REACT JS WEB DEVELOPMENT USING REACT JS
WEB DEVELOPMENT USING REACT JS
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
SVG - Scalable Vector Graphics
SVG - Scalable Vector GraphicsSVG - Scalable Vector Graphics
SVG - Scalable Vector Graphics
 
Introduction to react and redux
Introduction to react and reduxIntroduction to react and redux
Introduction to react and redux
 
Reactjs workshop (1)
Reactjs workshop (1)Reactjs workshop (1)
Reactjs workshop (1)
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
Umg ,이벤트 바인딩, Invaidation Box
Umg ,이벤트 바인딩, Invaidation BoxUmg ,이벤트 바인딩, Invaidation Box
Umg ,이벤트 바인딩, Invaidation Box
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
React js
React jsReact js
React js
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
React-JS Component Life-cycle Methods
React-JS Component Life-cycle MethodsReact-JS Component Life-cycle Methods
React-JS Component Life-cycle Methods
 
Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)Getting Started with HTML5 in Tech Com (STC 2012)
Getting Started with HTML5 in Tech Com (STC 2012)
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Vue入門
Vue入門Vue入門
Vue入門
 
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 

Destaque

Processing.js vs. three.js
Processing.js vs. three.jsProcessing.js vs. three.js
Processing.js vs. three.js
Victor Porof
 
Websockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalableWebsockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalable
Gareth Marland
 

Destaque (17)

How We Build Confidence with Continuous Integration and Automated Testing
How We Build Confidence with Continuous Integration and Automated TestingHow We Build Confidence with Continuous Integration and Automated Testing
How We Build Confidence with Continuous Integration and Automated Testing
 
Verkkojournalismi ja data (9.3.2012)
Verkkojournalismi ja data (9.3.2012)Verkkojournalismi ja data (9.3.2012)
Verkkojournalismi ja data (9.3.2012)
 
GFX part 8 - Three.js introduction and usage
GFX part 8 - Three.js introduction and usageGFX part 8 - Three.js introduction and usage
GFX part 8 - Three.js introduction and usage
 
Creating Applications with WebGL and Three.js
Creating Applications with WebGL and Three.jsCreating Applications with WebGL and Three.js
Creating Applications with WebGL and Three.js
 
Firefox WebGL developer tools
Firefox WebGL developer toolsFirefox WebGL developer tools
Firefox WebGL developer tools
 
WebGL and three.js - Web 3D Graphics
WebGL and three.js - Web 3D Graphics WebGL and three.js - Web 3D Graphics
WebGL and three.js - Web 3D Graphics
 
An Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsAn Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 seconds
 
Processing.js vs. three.js
Processing.js vs. three.jsProcessing.js vs. three.js
Processing.js vs. three.js
 
Technology, Innovation - A Perspective
Technology, Innovation - A PerspectiveTechnology, Innovation - A Perspective
Technology, Innovation - A Perspective
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.js
 
three.js WebGL library presentation
three.js WebGL library presentationthree.js WebGL library presentation
three.js WebGL library presentation
 
Introduction to WebGL and Three.js
Introduction to WebGL and Three.jsIntroduction to WebGL and Three.js
Introduction to WebGL and Three.js
 
HTML5 game dev with three.js - HexGL
HTML5 game dev with three.js - HexGLHTML5 game dev with three.js - HexGL
HTML5 game dev with three.js - HexGL
 
WebGL and Three.js
WebGL and Three.jsWebGL and Three.js
WebGL and Three.js
 
Websockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalableWebsockets in Node.js - Making them reliable and scalable
Websockets in Node.js - Making them reliable and scalable
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap Motion
 
ENEI16 - WebGL with Three.js
ENEI16 - WebGL with Three.jsENEI16 - WebGL with Three.js
ENEI16 - WebGL with Three.js
 

Semelhante a Introduction to threejs

3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
JavaScript Meetup HCMC
 
Introduction to open gl in android droidcon - slides
Introduction to open gl in android   droidcon - slidesIntroduction to open gl in android   droidcon - slides
Introduction to open gl in android droidcon - slides
tamillarasan
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
gerbille
 

Semelhante a Introduction to threejs (20)

Tools for developing Android Games
 Tools for developing Android Games Tools for developing Android Games
Tools for developing Android Games
 
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
3D Web Programming [Thanh Loc Vo , CTO Epsilon Mobile ]
 
Augmented reality in web rtc browser
Augmented reality in web rtc browserAugmented reality in web rtc browser
Augmented reality in web rtc browser
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
Introduction to open gl in android droidcon - slides
Introduction to open gl in android   droidcon - slidesIntroduction to open gl in android   droidcon - slides
Introduction to open gl in android droidcon - slides
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 
Sceneform SDK на практиці - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019Sceneform SDK на практиці - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019
 
Sceneform SDK на практиці - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019Sceneform SDK на практиці - UA Mobile 2019
Sceneform SDK на практиці - UA Mobile 2019
 
FLAR Workflow
FLAR WorkflowFLAR Workflow
FLAR Workflow
 
Threejs使ってみた
Threejs使ってみたThreejs使ってみた
Threejs使ってみた
 
Threejs使ってみた
Threejs使ってみたThreejs使ってみた
Threejs使ってみた
 
Getting Started in VR with JS
Getting Started in VR with JSGetting Started in VR with JS
Getting Started in VR with JS
 
Leaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGLLeaving Flatland: getting started with WebGL
Leaving Flatland: getting started with WebGL
 
Advanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics APIAdvanced Game Development with the Mobile 3D Graphics API
Advanced Game Development with the Mobile 3D Graphics API
 
GL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdfGL Shading Language Document by OpenGL.pdf
GL Shading Language Document by OpenGL.pdf
 
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
 
Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector Graphics
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGL
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

Introduction to threejs

  • 2. About Me ● Gareth Marland (@garethmarland) ● British ● By day, Autodesk Revit Server ● By night, Dotstorming and Boardthing
  • 3. Moving from 2D to 3D ● Traditional 2D web development is like creating a shareable document ● 3D web development is like creating a shareable movie scene
  • 4. Creating your scene ● The light source ● The camera ● The renderer Lights, Camera, Action!
  • 6. The light source ● Ambient Light – Applies a light globally. To every object in the scene ● Point Light – Shines light in all directions and lights up anything that is in range ● Directional Light – The most commonly used lighting – Works like a spotlight, in a position and shines in a direction
  • 7. Light source examples ● Ambient Light var ambLight = new THREE.AmbientLight(0x404040); scene.add(ambLight); ● Point Light var pointLight = new THREE.PointLight(0x0033ff, 3, 150); pointLight.position.set(70, 5, 70); scene.add(pointLight); ● Directional Light var dirLight = new THREE.DirectionalLight(0xffffff, 1); dirLight.position.set(100, 100, 50); scene.add(dirLight);
  • 8. The camera ● Orthographic Camera – Does not take a objects distance from the camera into account when drawing – Created with top, bottom, left, right, near and far ● Perspective Camera – The most commonly used – Takes an objects distance from he camera into account – Created with fov, aspect ratio, near and far
  • 10. The renderer ● Draws the scene ● Can be set up to loop in order to animate ● Needs to be attached to an HTML element var renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setSize(containerWidth, containerHeight); document.getElementById(“container”).appendChild(renderer.domElement); var renderScene = function () { requestAnimationFrame( renderScene ); renderer.render(scene, camera); }; renderScene()
  • 11. Putting it together var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(75, containerWidth/containerHeight, 0.1, far); scene.add(camera); var pointLight = new THREE.PointLight(0xffffff, 1); pointLight.position.set(0,5,5); scene.add(pointLight); var renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setSize(containerWidth, containerHeight); document.getElementById(“container”).appendChild(renderer.domElement); var renderScene = function () { requestAnimationFrame( renderScene ); renderer.render(scene, camera); }; renderScene();
  • 12. Creating an object ● Define the geometry – Use a predefined three.js object – Define your own vertices – Use a modelling tool ● Define the material – Basic – Lambert – Phong – Custom ● Create the mesh ● Add it to the scene
  • 14. Animating an object ● Should be updated within the rendering method ● The rendering only needs to be called when a change needs to be made var render = function () { var that = this; var updateScene = function() { // Do your updates to the object here } var renderScene = function () { requestAnimationFrame( renderScene ); updateScene(); renderer.render(scene, camera); }; renderScene(); }
  • 16. Selecting objects ● Selecting needs to work differently in 3D ● We using something called “raycasting” ● It's basically shooting lazers in space and seeing what we hit!
  • 17. Selecting objects example var mousePosition = new THREE.Vector2(); mousePosition.x = 2 * (mouseEvent.x / renderer.domElement.clientWidth) - 1; mousePosition.y = 1 - 2 * (mouseEvent.y / renderer.domElement.clientHeight ); var raycaster = new THREE.Raycaster(); raycaster.setFromCamera(mousePosition, camera); var intersected = raycaster.intersectObject(scene, true);
  • 19. Controlling the camera ● Bind the camera to a mouse event ● Include a library such as OrbitControls.js
  • 21. Advantages of the medium ● Can be opened in a browser ● Can be mixed and matched with other web based technologies – Websockets – HTML Canvas ● Fairly easy to understand
  • 22. fin