.. title: CG Class 9, Thurs 2019-09-19
.. slug: class09
.. date: 2019-09-19
.. tags: class
.. category: 
.. link: 
.. description: 
.. type: text
.. has_math: true

.. sectnum::
.. contents:: Table of contents


Today's iclicker questions
--------------------------

#. What does this line do::
     
      gl.bindBuffer( gl.ARRAY_BUFFER, vBuffer );

   A. Create this buffer.
   #. Enable this buffer so that the shaders will use it.
   #. Get the address of variable vBuffer.
   #. Prevent this buffer from being modified.
   #. Specify that this buffer will be the object of future buffer operations.


#. What does this line do::
     
      var vBuffer = gl.createBuffer();

   A. Create this buffer.
   #. Enable this buffer so that the shaders will use it.
   #. Get the address of variable vBuffer.
   #. Prevent this buffer from being modified.
   #. Specify that this buffer will be the object of future buffer operations.

#. How does gl.drawArrays know when the vertices it's drawing in 3D?

   A. It's specified as one of the arguments in gl.drawArrays.
   #. It's specified as one of the arguments in gl.bufferData.
   #. It's specified as one of the arguments in gl.vertexAttribPointer.
   #. It's specified as one of the arguments in gl.getAttribLocation.
   #. It's specified as one of the arguments in gl.enableVertexAttribArray.

#. How does gl.drawArrays know when the color values are floats instead of ints?

   A. It's specified as one of the arguments in gl.drawArrays.
   #. It's specified as one of the arguments in gl.bufferData.
   #. It's specified as one of the arguments in gl.vertexAttribPointer.
   #. It's specified as one of the arguments in gl.getAttribLocation.
   #. It's specified as one of the arguments in gl.enableVertexAttribArray.

#. How does gl.drawArrays know how many triangles are in a triangle strip?

   A. It's specified as one of the arguments in gl.drawArrays.
   #. It's specified as one of the arguments in gl.bufferData.
   #. It's specified as one of the arguments in gl.vertexAttribPointer.
   #. It's specified as one of the arguments in gl.getAttribLocation.
   #. It's specified as one of the arguments in gl.enableVertexAttribArray.


#. Normalize this vector: (8,-6,0).

   A. (3, 4, 5).
   #. (3/5, -4/5, 0).
   #. (4/5, -3/5, 0).
   #. (4/5, 3/5, 0).
   #. (8, -6, 10).
   
#. Find a normal vector to the plane through the points (1,0,0), (1,1,0), (1,0,1).

   A. (0, -1, 0)
   #. (0, 1, 0)
   #. (1, 0, 0)
   #. (1, 1, 0)
   #. (3, 2, 2)

#. Which of these curved surface equation types makes it easy to generate points on the surface?

   A. explicit
   #. explicit and implicit
   #. explicit and parametric
   #. implicit
   #. parametric
      
#. Which of these curved surface equation types makes it easy to test whether a point is on the surface?

   A. explicit
   #. explicit and implicit
   #. explicit and parametric
   #. implicit
   #. parametric

#. What type of equation is this:   :math:`x^2+y^2+z^2=1` 

   A. explicit
   #. explicit and implicit
   #. explicit and parametric
   #. implicit
   #. parametric



      
   
Homogeneous coordinates
-----------------------

`My take on homogeneous coordinates <https://wrf.ecse.rpi.edu/pmwiki/Main/HomogeneousCoords>`_.
IMNSHO (In My Not So Humble Opinion) it's better than the book.


      

Textbook slides: Chapter 5
--------------------------

The big topic for Chapter 5 is homogeneous coordinates.   They allow all the common transformations - translation, rotation, scaling, projection - to be expressed as a multiplication by a 4x4 matrix.

#. `5_1 Representation <https://wrf.ecse.rpi.edu/Teaching/graphics/SEVENTH_EDITION/PPT/WEEK05/Angel_UNM_14_5_1.ppt>`_  - I'll do this really quickly.


Textbook  programs
-----------------------

`My local web copy <https://wrf.ecse.rpi.edu/Teaching/graphics/SEVENTH_EDITION/CODE/>`_ .

`My copy on RCS <http://homepages.rpi.edu/~frankwr/ECSE-4750/CODE/>`_.

#. Chapter 4:

   #. color interpolation
   #. element arrays
   #. etc

   We'll skip quaternions until we see 3D rotations.


SIGGRAPH 2017 videos
---------------------

SIGGRAPH is the world's leading CG conference.   I'll show various videos from it.

#. SIGGRAPH 2017 `Computer Animation Festival Trailer <https://www.youtube.com/watch?v=5MgAsb-aKBo>`_.

#. `SIGGRAPH 2017 VR Village Trailer <https://www.youtube.com/watch?v=QKWgXHM6yMo>`_.

#. `The Sketchy Database: Learning to Retrieve Badly Drawn Bunnies - SIGGRAPH 2016 <https://www.youtube.com/watch?v=TnU3VzXxEh4>`_.

#. `Samsung Official Ostrich Commercial || Gear VR Advertisement <https://www.youtube.com/watch?v=vEEVu4w5LTE>`_.  
   


Nice WebGL site
---------------

http://webglfundamentals.org/webgl/lessons/


