Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Learning Three.js: The JavaScript 3D Library for WebGL - Second Edition
  • Toc
  • feedback
Learning Three.js: The JavaScript 3D Library for WebGL - Second Edition

Learning Three.js: The JavaScript 3D Library for WebGL - Second Edition

By : Jos Dirksen
4.4 (14)
close
Learning Three.js: The JavaScript 3D Library for WebGL - Second Edition

Learning Three.js: The JavaScript 3D Library for WebGL - Second Edition

4.4 (14)
By: Jos Dirksen

Overview of this book

If you know JavaScript and want to start creating 3D graphics that run in any browser, this book is a great choice for you. You don't need to know anything about math or WebGL; all that you need is general knowledge of JavaScript and HTML.
Table of Contents (14 chapters)
close
8
8. Creating and Loading Advanced Meshes and Geometries
13
Index

The basic geometries provided by Three.js

In Three.js, we have a couple of geometries that result in a two-dimensional mesh and a larger number of geometries that create a three-dimensional mesh. In this section, we'll first look at the 2D geometries: THREE.CircleGeometry, THREE.RingGeometry, THREE.PlaneGeometry, and THREE.ShapeGeometry. After that, we'll explore all the basic 3D geometries that are available.

Two-dimensional geometries

Two-dimensional objects look like flat objects and, as the name implies, only have two dimensions. The first two-dimensional geometry on the list is THREE.PlaneGeometry.

THREE.PlaneGeometry

A PlaneGeometry object can be used to create a very simple two-dimensional rectangle. For an example of this geometry, look at the 01-basic-2d-geometries-plane.html example in the sources for this chapter. A rectangle created using PlaneGeometry is shown in the following screenshot:

THREE.PlaneGeometry

Creating this geometry is very simple, as follows:

new THREE.PlaneGeometry(width...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete