Difference between revisions of "Advanced C++ Programming Tutorial 2"

From Chilipedia
Jump to: navigation, search
(Video Timestamp Index)
(Video Timestamp Index)
Line 18: Line 18:
 
[https://youtu.be/8_U_pake6J0 Tutorial 2.1]
 
[https://youtu.be/8_U_pake6J0 Tutorial 2.1]
 
* What are transformations? [https://youtu.be/8_U_pake6J0?t=0m26s 0:26]
 
* What are transformations? [https://youtu.be/8_U_pake6J0?t=0m26s 0:26]
 +
* Storing vertices and drawing polygons/polylines [https://youtu.be/8_U_pake6J0?t=1m00s 1:00]
 +
* Implementing <code>Graphics::DrawPolyline()</code> [https://youtu.be/8_U_pake6J0?t=2m30s 2:30]
 +
* Introducing a <code>Star</code> polygon generator class [https://youtu.be/8_U_pake6J0?t=3m40s 3:40]
  
 
[https://youtu.be/ARCytFIwis8 Tutorial 2.2]
 
[https://youtu.be/ARCytFIwis8 Tutorial 2.2]

Revision as of 07:22, 29 March 2020

In this tutorial we learn how to transform our shit. Move it around, make it bigger (no pills or pumps required), flip it and reverse it. And later on we make a camera system to scroll our shit in the world. You're gonna like it.

Topics

Part 1

  • Polyline drawing
  • Vertices
  • Trivial line clipping
  • Translation
  • Flipping across an axis
  • Screen coordinate transformation
  • Scaling

Part 2

  • Camera scrolling
  • Concatenating (combining) transforms
  • Drawable packet design

Video Timestamp Index

Tutorial 2.1

  • What are transformations? 0:26
  • Storing vertices and drawing polygons/polylines 1:00
  • Implementing Graphics::DrawPolyline() 2:30
  • Introducing a Star polygon generator class 3:40

Tutorial 2.2

  • WORK-IN-PROGRESS

Links

Homework

  1. Create random starfield in large rectangular region with randomized positions, sizes, and shapes. Stars should not overlap.
  2. Implement scrolling via mouse dragging.
  3. Process vertices in-place (don't use a buffered polyline copy).
  4. Only draw models that appear in the viewport.
  5. Animate the scale (size) and color of stars so that they pulsate.

The Homework solution is here.

See also