filbs111 / 3sphere-explorer

visualising a 3-sphere from the inside in webgl
5 stars 0 forks source link

draw more more shapes, cells #4

Closed filbs111 closed 7 years ago

filbs111 commented 8 years ago

in addition to 3 existing "axis" lines of x=w=0, y=w=0, z=w=0, draw other 3 axes holding 2 co-ords=0 these together form a 16-cell which IIRC is dual of:
hypercube (projected). should also draw this can then join vertices by further lines to create a 24-cell

using series of boxes with a draw call each is probably not efficient. to do long objects presumably is more sensible to actually generate 4-vector vertex data before passing into shader (rather than projecting it in the shader as now).

5, 120, 600 cell to come later. TODO see how to share vertices (eg a 120 cell is presumably like 24-cell "times" a 5 cell - would be nice to show this relation, and minimise the total number of vertices shown (guess might be able to use 600 vertices and show/hide links between them to show every primitive)

filbs111 commented 7 years ago

the 16 cell's edges are the 6 "axis" lines shown by the boxes currently. should maybe make a custom axis object in lieu of boxes - fewer gl render calls that way too. would also be nice to show dual of 24-cell at same time as 24 cell.

filbs111 commented 7 years ago

distance between 5-cell cells: can see that if have a cell at 0,0,0,1, then the other 4 will be in the directon of the points of a tetrahedron centred at 0,0,0,1. say these directions (in local 3-space) are (1,1,1), (1,-1,-1), (-1,1,-1),(-1,-1,1). then we can say the 4-vector points, by symmetry are (a,a,a,b) etc. noticing that the dot products of the centre point with other points, and paris of other points, are the same (1) dotp = b_b-a_a=b = b and since the length of all points is 1 (2) 3_a_a + b*b =1

simultaneous equations and completing the square -> 2 solutions. trivially b=1, or, the answer we're after, b=-1/4.

filbs111 commented 7 years ago

added 120-cell, 600-cell, and the utah teapot skipped working out exact model scale for cells here, and didn't bother ensuring shown 600-cell is dual of the shown 120-cell, but don't care about this at the mo.