Help rendering cubes

Hey, so I have this cell generator function and I can’t seem to figure out how to make it so that if the coord is (0,0) the cell will be in the top left hand corner. Currently, (0,0) is the bottom left. This code originally came from this OpenGL tutorial.

func newCell(x, y int) *Cell {
    points := make([]float32, len(square), len(square))
    copy(points, square)

    for i := 0; i < len(points); i++ {
	    var position float32
	    var size float32
	    switch i % 3 {
	    case 0:
		    size = 2.0 / float32(columns)
		    position = float32(x) * size
	    case 1:
		    size = 2.0 / float32(rows)
		    position = float32(y) * size
	    default:
		    continue
	    }

	    if points[i] < 0 {
		    points[i] = position - 1
	    } else {
		    points[i] = position + size - 1
	    }
    }

    return &Cell{
	    obj: makeVao(points),

	    x:     x,
	    y:     y,
	    state: false,
    }
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.