}else{Vector3position;intxPos=c.idx%c.dim;intyPos=c.idx/c.dim;position.x=c.x-0.5f;// left sideposition.x+=(1f/(c.dim*2f));// first positionposition.x+=xPos*(1f/c.dim);position.y=(-1f)*c.y+0.5f;// top sideposition.y-=(1f/(c.dim*2f));// first positionposition.y-=yPos*(1f/c.dim);position.z=(-0.1f)*(c.z+layer);returnposition;}
To get the camera to the correct position looking in the right direction when we hit N: