Tag Info

New answers tagged

0

Lets say player is at origin, and you have (any convex shape should work) your inner-most hexagon defined as array vec2 shape[6]. The simplest algorithm would be: int windingsNo; //=some value const int vertexCount = 6; vec2 shape[vertexCount]; float scale = 1.f; for(int w = 0; w < windingsNo; w++) { for(int v = 0; v < vertexCount; v++) { ...


0

how do I translate ObjA's location into ObjB's local space? Get A's coordinates as a vector from the centre of B: Acb= (0.593,0,0) - (0,0,0) = (0.593,0,0) Make a (non-unit) quaternion from Object A's coordinates wrt B: Acq = w: 0, x: 0.593, y: 0, z: 0 Rotate it according to the inverse of B's orientation (Bq): Bq^-1 * Acq * Bq = (w: 1, x: 0, y: ...


3

I can give one small piece of advice. Don't do this in your render loop: viewMat = getUniformLocation(sp, "viewMat"); modelMat = getUniformLocation(sp, "modelMat"); projMat = getUniformLocation(sp, "projMat"); maxIterLoc = getUniformLocation(sp, "maxIterations"); centerLoc = getUniformLocation(sp, "center"); scaleLoc = getUniformLocation(sp, "scale"); ...



Top 50 recent answers are included