<< Chapter < Page Chapter >> Page >

I will also provide exercises for you to complete on your own at the end of most of the modules. Those exercises will concentrate on the material that youhave learned in that module and previous modules.

Viewing tip

II recommend that you open another copy of this module in a separate browser window and use the following links to easily find and view the Figuresand Listings while you are reading about them.

Figures

  • Figure 1 . Graphics illustration of four points and two lines.
  • Figure 2 . First of three views in the construction of a 3D human figure.
  • Figure 3 . Second of three views in the construction of a 3D human figure.
  • Figure 4 . Third of three views in the construction of a 3D human figure.
  • Figure 5 . Screen output from the program named PointLine02.
  • Figure 6 . Sample output from updated programming-math library.
  • Figure 7 . Graphic output from Exercise 1.
  • Figure 8 . Text output from Exercise 2.
  • Figure 9 . Text output from Exercise 3.

Listings

  • Listing 1 . The controlling class named PointLine01.
  • Listing 2 . Beginning of the class named GUI.
  • Listing 3 . Beginning of the inner class named MyCanvas.
  • Listing 4 . Define two points as two locations in space.
  • Listing 5 . Construct a line segment.
  • Listing 6 . Construct an object that represents a vertical line segment.
  • Listing 7 . Draw the two lines on the screen.
  • Listing 8 . Beginning of the class named PointLine02.
  • Listing 9 . Beginning of the class named GM2D01.
  • Listing 10 . Exercising the Point class.
  • Listing 11 . The static top-level class named Point.
  • Listing 12 . The static top-level class named Vector.
  • Listing 13 . The static top-level class named Line.
  • Listing 14 . Source code for the program named PointLine01.
  • Listing 15 . Source code for the program named PointLine02.
  • Listing 16 . Source code for the game-programming math library named GM2D01.

Preview

In this module, I will introduce you to an excellent interactive tutorial titled Vector Math for 3D Computer Graphics written by Dr. Bradley P. Kjell, (which you can also download in zip-file format from a link in the first module in this collection) . Then I will present and explain two sample programs and a sample game-programming math library intended to implement concepts from Dr.Kjell's tutorial in Java code.

Discussion and sample code

Points, lines, and vectors

Your homework assignment from the previous module was to study CHAPTER 0 -- Points and Lines and also to study CHAPTER 1 -- Vectors, Points, and Column Matrices down through the topic titled Variables as Elements in Kjell's tutorial.

You may have previously believed that you already knew all there was to know about points and lines. However, I suspect that you found explanations of some subtleissues that you never thought about before when studying those tutorials. In addition, Kjell begins the discussion of vectors and establishes the relationship between a vector and acolumn matrix in this material.

Represent a point with a column matrix

Hopefully you understand what Kjell means by a column matrix and you understand that a column matrix can be used torepresent a point in a given coordinate frame. The same point will have different representations in different coordinate frames. (You must know which coordinate frame is being used to represent a point with a column matrix.)

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Game 2302 - mathematical applications for game development. OpenStax CNX. Jan 09, 2016 Download for free at https://legacy.cnx.org/content/col11450/1.33
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?

Ask