Courses‎ > ‎Computer Graphics‎ > ‎

Konstantinovich

SUPER IMPORTANT SUMISSION GUIDELINES
  • You must include a makefile for each assignment!
    • The makefile should invoke whatever is needed to compile and/or run your program. When I type make, I expect to have your program generate an image.
  • Every assignment (unless otherwise noted) will require both a github submission and an image gallery submission. Full credit will require both.
  • All github repos should be named exactly as described.
      • When working with a partner
        • BOTH members make the repo. One will be used, the other will be empty.
        • The non-empty repo should list both partners names.
        • The empty repo README.md should link to the non-empty repo.
  • NEVER EVER EVER add image files to github
    • Adding image files will result in deductions
    • You can include a .gitignore if you want to help avoid issues!
  • Gallery submissions should be made here: http://gallery.stuycs.org
sample gitignore:

2019-02-13 Work 2

posted Feb 13, 2019, 11:48 AM by Konstantinovich Samuel   [ updated Feb 15, 2019, 12:10 PM ]

There is no spoon.

This will be due Monday, 2/25

Implement the following features but you cannot trivialize the problem by using a structure that already exists in the language you choose:
  • Create a repo: mks66-matrix
  • General Matrix stuff
    • matrix multiplication  (you may assume a 4by4 times a 4byN)
    • creation of an identity matrix
    • displaying a matrix in a reasonable manner
  • Graphics matrix stuff
    • add a point to an edge matrix
    • add an edge to an edge matrix (should call your add point routine)
    • go through an edge matrix and draw the lines stored in the matrix (should call your draw line routine)
    • output and display an image file
  • Demonstrate your multiply works using the following: (do not reset the values of A and B after each operation)
    • A = {{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}}
    • B = {{11,12,13,14},{15,16,17,18},{19,20,21,22},{23,24,25,26}}
    • mult(A,B)
    • print A
    • print B
    • mult(B,A)  
    • print A
    • print B
    • mult(IDENT,A)
    • print A
  • Upload an image to the gallery page.

READ THROUGH ALL THE SOURCE FILES. Detailed instructions are provided as comments. 


Here is an example of what would happen if you added 2 points and multiplied:
Testing add_edge. Adding (1, 2, 3), (4, 5, 6) m2 = 
1.00 4.00 
2.00 5.00 
3.00 6.00 
1.00 1.00 

Testing ident. m1 =
1.00 0.00 0.00 0.00 
0.00 1.00 0.00 0.00 
0.00 0.00 1.00 0.00 
0.00 0.00 0.00 1.00 

Testing Matrix mult. m1 * m2 =
1.00 4.00 
2.00 5.00 
3.00 6.00 
1.00 1.00 

Testing Matrix mult. m1 =
1.00 4.00 7.00 10.00 
2.00 5.00 8.00 11.00 
3.00 6.00 9.00 12.00 
1.00 1.00 1.00 1.00 

Testing Matrix mult. m1 * m2 =
40.00 76.00 
47.00 92.00 
54.00 108.00 
7.00 16.00 

2019-02-06 Work 1

posted Feb 6, 2019, 10:04 AM by Konstantinovich Samuel   [ updated Feb 13, 2019, 12:03 PM ]

Due: Monday Morning (2/11)

Make a repo github:
mks66-line

You will write your own line algorithm!
  1. First decide what you will be programming in for this assignment. You can use any language you'd like, but you must write your own line algorithm (do not use any built in function that may exist for your language of choice).
  2. Code Bresenham's line algorithm!
    • Start with octant 1.
    • Add the other octants one at a time, you'll have a much easier time debugging doing that.
      • Trust me, I've done this a few times.
  3. Test your algorithm by calling your draw_line routine multiple times.
    • Don't forget to upload an image to the gallery!
Follow these guidelines in your submission
  • Upload your code to gihub
  • Upload an image to the gallery
  • Include a makefile that will create an image using your code.
    • Your code should result in displaying an image that tests all octants, including slopes of 0, 1, -1 and undefined
    • If you cannot run the display command, then save an image and print out the name of the image being saved.
    • This image does not need to be the same as your gallery image.
If your are using my frameworks you only need to modify the following files:
  • c
    • draw_c
    • main_c
  • python
    • draw.py
    • main.py

2019-01-31 Work 0

posted Jan 31, 2019, 11:03 AM by Konstantinovich Samuel   [ updated Feb 6, 2019, 10:01 AM ]

Time for your first computer generated image:


Make a repo:
mks66-picmaker

In the language of your choice:
  • Develop your code in the appropriately named repo on github.
  • Create a program that generates a valid ppm image file, it should be at least 500x500, but also don't make it too big (remember, each pixel is stored as up to 9 bytes - 3 for each color value - so a 1000x1000 image could be 9MB large, they get big fast).
  • Convert your image to a png and upload it to the ML6 gallery website: http://gallery.stuycs.org
    • For help with converting, you should install ImageMagick
      • on ubuntu, apt-get install imagemagick will work
      • on mac: 
        • First install XQuartz form here: https://www.xquartz.org/index.html
        •  (if you have homebrew installed): brew install imagemagick --with-x11 will work ( the --with-x11 flag is very necessary, and I've already spent the hours yelling at the internet trying to figure out what was wrong.)
        • If you're more of a macports kind of person: port install imagemagick
      • on windows... installing ubuntu and running apt-get install imagemagick will work (I've been told imagemagick works on cygwin)
      • for more detailed instructions (including building and installing it on your own): http://www.imagemagick.org/script/binary-releases.php
      • You can also log into any stuy machine remotely, and run convert on them.
      • Once you've installed image magic, you can convert with the following command:
        • convert <source> <destination>
        • The destination format will be automatically set based on the file extension
        • example: convert foo.ppm foo.png


2019-01-30

posted Jan 30, 2019, 6:24 AM by Konstantinovich Samuel   [ updated Jan 30, 2019, 6:26 AM ]

1. Take out notebook
2. If you did not fill out the information gathering form, then do it. LOG OUT when done.





EXTRA:
Need to study longer? (You are doing it wrong)
Let me end with a link to a video about how to study for less time and get more out of it. Even if you only watch the first 5-10 minutes you will be much smarter.
You can watch as little or as much of this video as you want, I won't ever check... but you won't increase your GPA either.  If  this video helps you do better please let me know!
This pairs nicely with every article about sleeping more to remember things better...

1-4 of 4