CPSC362A
Video Game Development

Activity 3

Draw a Star with Vertex Arrays

Use a vertex array to draw a five-pointed star.

Details

  1. create an array that contains the x and y coordinates of all the star’s vertices.

  2. create an array that contains the indices of all the star’s vertices.

  3. use a single call to glDrawElements to draw the star.

Example