SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
WebGL & Three.js
How to use 3D in the browser
What is Three.js?
Three.js is a popular abstraction layer on top
of WebGL, which hides many of the headaches
of using WebGL in a browser.
It wraps many GL objects in a Javascript
object for easy manipulation
It also has a fallback renderer for Canvas or
SVG for backwards compatibility
Basic Parts of a 3D Scene
1. Camera - the viewpoint of the user
2. Lights - the scene needs to be lit to be
visible
3. Objects - 3D meshes
4. Materials - Applied to the surface of a 3D
mesh to fill it in
Camera
// create a WebGL renderer, camera
// and a scene
var renderer = new THREE.WebGLRenderer();
var camera =
new THREE.PerspectiveCamera(
VIEW_ANGLE, ASPECT, NEAR,FAR);
var scene = new THREE.Scene();
Mesh
// create a new mesh with sphere geometry
var sphere = new THREE.Mesh(
new THREE.SphereGeometry(
radius, segments, rings),
sphereMaterial);
// add the sphere to the scene
scene.add(sphere);
Material
// create the sphere's material
var sphereMaterial =
new THREE.MeshLambertMaterial(
{
color: 0xCC0000
});
Lights
// create a point light
var ptLight= new THREE.PointLight(0xFFFFFF);
// set its position
pointLight.position.x = 10;
pointLight.position.y = 50;
pointLight.position.z = 130;
// add to the scene
scene.add(pointLight);
Render Loop
// draw!
renderer.render(scene, camera);
// performance tip - let the browser call your
// render loop as part of it’s refresh cycle
window.requestAnimationFrame =
function() {
renderer.render(scene, camera);
}
Just Skimming The Surface!
WebGL supports almost anything your graphics
card / browser can provide!
See tons of examples at:
http://threejs.org/
https://developer.mozilla.
org/ms/demos/tag/tech:webgl
http://www.chromeexperiments.com/webgl/

Weitere Àhnliche Inhalte

Was ist angesagt?

Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptAdieu
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practicesIwan van der Kleijn
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-FrameDaosheng Mu
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
React state
React  stateReact  state
React stateDucat
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentationæŽȘ éčć‘
 
Intro to React
Intro to ReactIntro to React
Intro to ReactJustin Reock
 
Getting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) AngularGetting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) AngularGustavo Costa
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
openFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆII
openFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆIIopenFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆII
openFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆIIAtsushi Tadokoro
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Aaron Gustafson
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
React Hooks
React HooksReact Hooks
React HooksJoao Marins
 
Service workers
Service workersService workers
Service workersjungkees
 
Dart and Flutter Basics.pptx
Dart and Flutter Basics.pptxDart and Flutter Basics.pptx
Dart and Flutter Basics.pptxDSCVSSUT
 
Media Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGL
Media Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGLMedia Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGL
Media Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGLAtsushi Tadokoro
 

Was ist angesagt? (20)

Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practices
 
Ngrx
NgrxNgrx
Ngrx
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-Frame
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
React state
React  stateReact  state
React state
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Getting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) AngularGetting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) Angular
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
openFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆII
openFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆIIopenFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆII
openFrameworks ć‹•ăă‚’ç”Ÿăżă ă™æ§˜ă€…ăȘă‚ąăƒ«ă‚ŽăƒȘă‚șム - ć€šæ‘©çŸŽăƒĄăƒ‡ă‚Łă‚ąă‚ąăƒŒăƒˆII
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
React Hooks
React HooksReact Hooks
React Hooks
 
Javascript essentials
Javascript essentialsJavascript essentials
Javascript essentials
 
Service workers
Service workersService workers
Service workers
 
Dart and Flutter Basics.pptx
Dart and Flutter Basics.pptxDart and Flutter Basics.pptx
Dart and Flutter Basics.pptx
 
Media Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGL
Media Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGLMedia Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGL
Media Art II 2013 珏7曞 : openFrameworks 3Dă‚°ăƒ©ăƒ•ă‚Łă‚Żă‚č、OpenGL
 

Andere mochten auch

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 PSTechSerbia
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRCodemotion
 
Three.js äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘ
Three.js  äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘThree.js  äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘ
Three.js äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘæ™ș遠 成
 
HTML5 y WebGL
HTML5 y WebGLHTML5 y WebGL
HTML5 y WebGLRaul Jimenez
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.jsJosh Staples
 
A-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersA-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersKevin Ngo
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap MotionLee Trout
 
Build the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-FrameBuild the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-FrameMozilla VR
 
老成äč‹CreateJS與Flash
老成äč‹CreateJS與Flash老成äč‹CreateJS與Flash
老成äč‹CreateJS與Flashæ™ș遠 成
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVRDaosheng Mu
 
WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016Carsten Sandtner
 
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 secondsGeilDanke
 
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!FITC
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive WebTony Parisi
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually AnyoneTony Parisi
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonTony Parisi
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Tony Parisi
 
Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Tony Parisi
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next GenerationTony Parisi
 

Andere mochten auch (20)

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
 
The next frontier: WebGL and WebVR
The next frontier: WebGL and WebVRThe next frontier: WebGL and WebVR
The next frontier: WebGL and WebVR
 
Three.js äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘ
Three.js  äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘThree.js  äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘ
Three.js äž€ć ŽćŸž2DèźŠæˆ3D的憒éšȘ
 
HTML5 y WebGL
HTML5 y WebGLHTML5 y WebGL
HTML5 y WebGL
 
Integrating Angular js & three.js
Integrating Angular js & three.jsIntegrating Angular js & three.js
Integrating Angular js & three.js
 
A-Frame: VR for Web Developers
A-Frame: VR for Web DevelopersA-Frame: VR for Web Developers
A-Frame: VR for Web Developers
 
Introduction to three.js & Leap Motion
Introduction to three.js & Leap MotionIntroduction to three.js & Leap Motion
Introduction to three.js & Leap Motion
 
Build the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-FrameBuild the Virtual Reality Web with A-Frame
Build the Virtual Reality Web with A-Frame
 
老成äč‹CreateJS與Flash
老成äč‹CreateJS與Flash老成äč‹CreateJS與Flash
老成äč‹CreateJS與Flash
 
Introduction to WebGL and WebVR
Introduction to WebGL and WebVRIntroduction to WebGL and WebVR
Introduction to WebGL and WebVR
 
WebVR
WebVRWebVR
WebVR
 
WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016WebVR - MobileTechCon Berlin 2016
WebVR - MobileTechCon Berlin 2016
 
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
 
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS – Together At Last!
 
Foundations of the Immersive Web
Foundations of the Immersive WebFoundations of the Immersive Web
Foundations of the Immersive Web
 
Virtually Anyone
Virtually AnyoneVirtually Anyone
Virtually Anyone
 
WebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was WonWebGL, HTML5 and How the Mobile Web Was Won
WebGL, HTML5 and How the Mobile Web Was Won
 
Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5Hacking Reality: Browser-Based VR with HTML5
Hacking Reality: Browser-Based VR with HTML5
 
Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17Powering the VR/AR Ecosystem 2017-01-17
Powering the VR/AR Ecosystem 2017-01-17
 
WebGL: The Next Generation
WebGL:  The Next GenerationWebGL:  The Next Generation
WebGL: The Next Generation
 

Ähnlich wie Intro to Three.js

WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash CourseTony Parisi
 
WebGL - 3D programming
WebGL - 3D programmingWebGL - 3D programming
WebGL - 3D programmingMinh Ng
 
140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js
140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js
140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.jsangelliya00
 
Begin three.js.key
Begin three.js.keyBegin three.js.key
Begin three.js.keyYi-Fan Liao
 
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
 
WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO TimeTony Parisi
 
Migrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityMigrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityDenis Radin
 
ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...
ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...
ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...Ontico
 
Augmented reality in web rtc browser
Augmented reality in web rtc browserAugmented reality in web rtc browser
Augmented reality in web rtc browserALTANAI BISHT
 
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devicesUsing babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devicesDavid Catuhe
 
RĂ©aliser un jeu cross plateformes avec WebGL et babylon.js
RĂ©aliser un jeu cross plateformes avec WebGL et babylon.jsRĂ©aliser un jeu cross plateformes avec WebGL et babylon.js
RĂ©aliser un jeu cross plateformes avec WebGL et babylon.jsdavrous
 
Getting Started with WebGL
Getting Started with WebGLGetting Started with WebGL
Getting Started with WebGLChihoon Byun
 
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...Denis Radin
 
Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGLTony Parisi
 
Artists Only
Artists OnlyArtists Only
Artists OnlyTony Parisi
 
COMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptxCOMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptxEgerton University
 
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 usagePrabindh Sundareson
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScriptersgerbille
 
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 2014Verold
 
WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013Tony Parisi
 

Ähnlich wie Intro to Three.js (20)

WebGL Crash Course
WebGL Crash CourseWebGL Crash Course
WebGL Crash Course
 
WebGL - 3D programming
WebGL - 3D programmingWebGL - 3D programming
WebGL - 3D programming
 
140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js
140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js
140716 : ćŒæ„­ć‰ç«Żèšæœƒćˆ†äș« - webgl 與 three.js
 
Begin three.js.key
Begin three.js.keyBegin three.js.key
Begin three.js.key
 
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 ]
 
WebGL - It's GO Time
WebGL - It's GO TimeWebGL - It's GO Time
WebGL - It's GO Time
 
Migrating your Web app to Virtual Reality
Migrating your Web app to Virtual RealityMigrating your Web app to Virtual Reality
Migrating your Web app to Virtual Reality
 
ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...
ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...
ĐŸĐŸŃ€Ń‚ĐžŃ€ŃƒĐ”ĐŒ ŃŃƒŃ‰Đ”ŃŃ‚ĐČŃƒŃŽŃ‰Đ”Đ” Web-ĐżŃ€ĐžĐ»ĐŸĐ¶Đ”ĐœĐžĐ” ĐČ ĐČĐžŃ€Ń‚ŃƒĐ°Đ»ŃŒĐœŃƒŃŽ Ń€Đ”Đ°Đ»ŃŒĐœĐŸŃŃ‚ŃŒ / Đ”Đ”ĐœĐžŃ Đ Đ°ĐŽĐžĐœ ...
 
Augmented reality in web rtc browser
Augmented reality in web rtc browserAugmented reality in web rtc browser
Augmented reality in web rtc browser
 
Using babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devicesUsing babylon js to create apps & games for all web gl devices
Using babylon js to create apps & games for all web gl devices
 
RĂ©aliser un jeu cross plateformes avec WebGL et babylon.js
RĂ©aliser un jeu cross plateformes avec WebGL et babylon.jsRĂ©aliser un jeu cross plateformes avec WebGL et babylon.js
RĂ©aliser un jeu cross plateformes avec WebGL et babylon.js
 
Getting Started with WebGL
Getting Started with WebGLGetting Started with WebGL
Getting Started with WebGL
 
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
HTML GL - 60 FPS and amazing effects by rendering HTML/CSS in WebGL, framewor...
 
Developing Web Graphics with WebGL
Developing Web Graphics with WebGLDeveloping Web Graphics with WebGL
Developing Web Graphics with WebGL
 
Artists Only
Artists OnlyArtists Only
Artists Only
 
COMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptxCOMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptx
 
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
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 
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
 
WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013WebGL For Game Development Spring 2013
WebGL For Game Development Spring 2013
 

Mehr von Kentucky JavaScript Users Group (9)

Serverless GraphQL with AWS AppSync & AWS Amplify
Serverless GraphQL with AWS AppSync & AWS AmplifyServerless GraphQL with AWS AppSync & AWS Amplify
Serverless GraphQL with AWS AppSync & AWS Amplify
 
CQRS and Event Sourcing
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
 
A Rubyist Tries AngularJS
A Rubyist Tries AngularJSA Rubyist Tries AngularJS
A Rubyist Tries AngularJS
 
PhoneGap - JavaScript for Mobile Apps
PhoneGap - JavaScript for Mobile AppsPhoneGap - JavaScript for Mobile Apps
PhoneGap - JavaScript for Mobile Apps
 
An Intro to AngularJS
An Intro to AngularJSAn Intro to AngularJS
An Intro to AngularJS
 
Node and SocketIO
Node and SocketIONode and SocketIO
Node and SocketIO
 
Node.js Introduction
Node.js IntroductionNode.js Introduction
Node.js Introduction
 
Underscore and Backbone Models
Underscore and Backbone ModelsUnderscore and Backbone Models
Underscore and Backbone Models
 
JavaScript State of the Union - Jan 2013
JavaScript State of the Union - Jan 2013JavaScript State of the Union - Jan 2013
JavaScript State of the Union - Jan 2013
 

KĂŒrzlich hochgeladen

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

KĂŒrzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Intro to Three.js

  • 1. WebGL & Three.js How to use 3D in the browser
  • 2. What is Three.js? Three.js is a popular abstraction layer on top of WebGL, which hides many of the headaches of using WebGL in a browser. It wraps many GL objects in a Javascript object for easy manipulation It also has a fallback renderer for Canvas or SVG for backwards compatibility
  • 3. Basic Parts of a 3D Scene 1. Camera - the viewpoint of the user 2. Lights - the scene needs to be lit to be visible 3. Objects - 3D meshes 4. Materials - Applied to the surface of a 3D mesh to fill it in
  • 4. Camera // create a WebGL renderer, camera // and a scene var renderer = new THREE.WebGLRenderer(); var camera = new THREE.PerspectiveCamera( VIEW_ANGLE, ASPECT, NEAR,FAR); var scene = new THREE.Scene();
  • 5. Mesh // create a new mesh with sphere geometry var sphere = new THREE.Mesh( new THREE.SphereGeometry( radius, segments, rings), sphereMaterial); // add the sphere to the scene scene.add(sphere);
  • 6. Material // create the sphere's material var sphereMaterial = new THREE.MeshLambertMaterial( { color: 0xCC0000 });
  • 7. Lights // create a point light var ptLight= new THREE.PointLight(0xFFFFFF); // set its position pointLight.position.x = 10; pointLight.position.y = 50; pointLight.position.z = 130; // add to the scene scene.add(pointLight);
  • 8. Render Loop // draw! renderer.render(scene, camera); // performance tip - let the browser call your // render loop as part of it’s refresh cycle window.requestAnimationFrame = function() { renderer.render(scene, camera); }
  • 9. Just Skimming The Surface! WebGL supports almost anything your graphics card / browser can provide! See tons of examples at: http://threejs.org/ https://developer.mozilla. org/ms/demos/tag/tech:webgl http://www.chromeexperiments.com/webgl/