Im still stuck on the checkerboard shader. How do I directly compute which color to select?
This is an important part of the problem, and you have to figure it out on your own. But here is a hint to get you started: Think of a 2D checkerboard. Pretend that the lower left square is light, and call that square 0,0. The rest of the squares are numbered according to their location on the board: 0,0 0,1 0,2 are the first three squares in the first row, 0,0 1,0 2,0 are the first three squares in the first column. Given that sort of parameterization of the checkerboard, you can determine the color of a square given its coordinates: 0,0 is light; 0,1 is dark; 0,2 is light; etc. Solve the 2D problem first, by finding a function that decides whether x,y is light or dark. Then extend your function to work for x,y,z in 3D.
Related Questions
- I am waiting on other socket or keyboard input in addition to a message from a PLC. Can I use select() directly on PLCIO file descriptors?
- I am creating a Visio 2010 Cross-Functional Flowchart. How can I select an individual band to specify its color fill?
- Im still stuck on the checkerboard shader. How do I directly compute which color to select?