// grid.h: definitions for grid data structure // 15-869, assignment 2: View Transformation // // some terminology comes from the paper: // Head-Tracked Stereoscopic Display Using Image Warping // Leonard McMillan and Gary Bishop // Stereoscopic Displays and Virtual Reality Systems II // SPIE Proceedings 2409, Feb. 1995. // // Paul Heckbert 28 Sept 1999 #ifndef GRID_H #define GRID_H struct Point3 { float x, y, z; Point3() {}; Point3(float x_, float y_, float z_) {x = x_; y = y_; z = z_;}; }; // generic 3-D point // IMPORTANT: // for more notes on coordinate systems, read all comments in // transform_points() and extract_camera() in ivgrid.cxx struct Gpoint { // data stored at grid point float gz; // depth in grid space // McMillan calls this delta unsigned char r, g, b; // color }; struct Grid_data { // grid of depth and color info int nx, ny; // number of rows and columns Gpoint **grid; // two dimensional array of zrgb points // index it like this: grid[gy][gx], // where 0<=gx