Skip to main content
Engineering LibreTexts

9: Programming Languages

  • Page ID
    14085
  • This appendix contains brief introductions to three programming languages that are used in the textbook: Java, C, and JavaScript. You should be very familiar with at least one of the three languages before reading this textbook. The three languages have something in common, so that knowing one will make it easier to learn the others. You should also be at least somewhat familiar with classes, objects, and object-oriented programming.

    The appendix is meant to help you get started with the languages that you don’t already know. Only some basic information about each language is given—but hopefully enough to let you understand examples in the book and to write some programs that use the graphics techniques that are covered. You should at least be able to work with the sample programs that accompany this textbook.

    Java is obligatory only for Section 2.5. For the material on OpenGL 1.1 in Chapter 3 and Chapter 4, either Java or C can be used, but you will need to be at least somewhat familiar with C to follow the discussion. The shader programming language that is used with WebGL is based on C, so some knowledge of C will also be useful there. JavaScript is essential for WebGL programming (Chapter 6 and Chapter 7), and for programming with three.js (Chapter 5). It is also used for HTML canvas graphics in Section 2.6.