文档详情

Doing Physics in 3D.pdf

发布:2016-03-20约7.23万字共30页下载文档
文本预览下载声明
Chapter 15 Doing Physics in 3D So far in this book you have built simulations in two dimensions. But in the real world there are three dimensions: what does it take to extend the hard work you’ve already done into the 3D realm? In this penultimate chapter we introduce you to the exciting world of 3D physics-based animation. Topics covered in this chapter include the following: • 3D physics and math: This section discusses how to extend our existing code framework to create 3D simulations. In the process we’ll explore some additional math concepts that will help to handle both translational and rotational motion in 3D, which will be used in the examples later in the chapter. • 3D rendering: Introducing WebGL and three.js: This section discusses 3D rendering and the WebGL API, and it introduces the three.js JavaScript library, which simplifies the process of creating 3D simulations with WebGL. • Simulating particle motion in 3D: This section gives examples of using the three.js library to create physics simulations of particle motion in 3D. The methods used here will then be applied in developing an accurate solar system simulation in Chapter 16. • Simulating rigid body motion in 3D: Taking a rotating cube as an example, this section shows how to simulate rigid body motion in 3D. In Chapter 16 we will build upon this example to create a flight simulator. Please note that the focus in this chapter will be very much on doing physics in 3D, rather than on 3D programming in general. Thus, although we’ll inevitably have to discuss some aspects of 3D coding using JavaScript libraries, this chapter is not about the latest cutting-edge 3D technology. 3D physics and math Before we can create simulations in 3D, we need to generalize some of the math and physics concepts we have been u
显示全部
相似文档