# Thread: Mosaic Sphere. How? I hate to eyeball stuff =)

1. jeric, it will only be out of my system when there is a spot where i input the number of sides and boom, there i have it anyway it was nice exercise, i guess, and ty for all the contributions, as usual the community jumps the wagon =)

As for the mirror ball, check zarti's post (i won't discuss it further)

As for the city of Rio de Janeiro sidewalks, "we" took them there =)
(Our streets are mostly)

Cheers

2. zarti's method seems prone to error. 'Cuz I'm lazy.

What would be fun would be if we could manage to do this with dynamics: sortof 'roll a sphere around in a pile of mirrors' sort of thing.

3. This isn't all that hard from a basic math standpoint. There are a few variables that you need to fix beforehand.

Choose the number of divisions (D)
Choose the angle for the sides in the Trapezoid (A < 90)

This just becomes an iterative loop as the output (L) of one loop becomes the input (B) for the next loop.

L = B / (2 * cos(A) + 1)

The angle change caused by L for each step is
Theta = asin(L / R)
As you go through the steps, you can build the X,Y coordinates for the points starting with step 0 where X = R, Y = 0

just sum up the Theta value and calculate X,Y using

That will create the spline that you can lathe 360 degrees to make a 3D hemisphere. Then mirror to create a full sphere.

here is an example for point coordinates with the following choices
Number of Divisions = 100
Angle A for the trapezoid = 89

HTML Code:
```<pre>
B		L		Theta		Sum Theta	X		Y
0.628318531	0.607126881	3.480721367	0		10		0
0.607126881	0.586649973	3.363187749	3.480721367	9.981552833	0.607126881
0.586649973	0.566863702	3.249631718	6.843909116	9.928744766	1.191649012
0.566863702	0.547744773	3.139917796	10.09354083	9.845229435	1.752557383
0.547744773	0.529270679	3.033915209	13.23345863	9.734453884	2.289193655
0.529270679	0.511419671	2.931497708	16.26737384	9.599649575	2.801201177
0.511419671	0.494170734	2.832543407	19.19887155	9.443828472	3.28848047
0.494170734	0.477503561	2.736934629	22.03141495	9.269783205	3.751149068
0.477503561	0.461398532	2.644557749	24.76834958	9.08009047	4.189505586
0.461398532	0.445836686	2.555303054	27.41290733	8.877116909	4.603997761
0.445836686	0.430799703	2.469064597	29.96821039	8.663026872	4.995194232
0.430799703	0.416269881	2.385740073	32.43727498	8.439791534	5.36375977
0.416269881	0.402230114	2.305230678	34.82301506	8.209198938	5.710433678
0.402230114	0.388663874	2.227440997	37.12824573	7.972864618	6.036011082
0.388663874	0.37555519	2.152278875	39.35568673	7.732242508	6.341326817
0.37555519	0.362888631	2.07965531	41.50796561	7.488635921	6.627241662
0.362888631	0.350649283	2.009484337	43.58762092	7.243208408	6.894630661
0.350649283	0.338822739	1.941682925	45.59710525	6.996994368	7.144373297
0.338822739	0.327395075	1.876170874	47.53878818	6.750909298	7.377345299
0.327395075	0.316352838	1.812870717	49.41495905	6.505759609	7.594411887
0.316352838	0.305683029	1.751707622	51.22782977	6.262251966	7.796422277
0.305683029	0.295373087	1.692609308	52.97953739	6.021002094	7.98420527
0.295373087	0.285410874	1.635505946	54.6721467	5.782543065	8.158565787
0.285410874	0.275784662	1.580330087	56.30765265	5.547333035	8.320282219
0.275784662	0.266483118	1.527016567	57.88798273	5.315762439	8.470104467
0.266483118	0.257495293	1.475502439	59.4149993	5.088160671	8.60875258
0.257495293	0.248810606	1.42572689	60.89050174	4.864802241	8.736915883
0.248810606	0.240418831	1.377631172	62.31622863	4.645912455	8.855252535
0.240418831	0.232310091	1.331158528	63.6938598	4.431672618	8.964389428
0.232310091	0.224474839	1.286254125	65.02501833	4.222224802	9.064922378
0.224474839	0.216903851	1.242864989	66.31127245	4.017676201	9.157416554
0.216903851	0.209588213	1.20093994	67.55413744	3.818103095	9.242407087
0.209588213	0.202519314	1.160429531	68.75507738	3.623554451	9.320399838
0.202519314	0.195688832	1.121285992	69.91550691	3.434055192	9.391872281
0.195688832	0.189088726	1.083463165	71.0367929	3.249609157	9.457274466
0.189088726	0.182711225	1.046916459	72.12025607	3.070201766	9.517030058
0.182711225	0.176548821	1.011602789	73.16717253	2.895802432	9.571537404
0.176548821	0.17059426	0.977480529	74.17877532	2.726366729	9.621170639
0.17059426	0.164840532	0.944509458	75.15625585	2.561838332	9.666280792
0.164840532	0.159280864	0.912650718	76.10076531	2.402150765	9.707196902
0.159280864	0.153908709	0.881866764	77.01341602	2.247228957	9.744227112
0.153908709	0.148717744	0.85212132	77.89528279	2.09699064	9.777659754
0.148717744	0.143701858	0.823379335	78.74740411	1.951347581	9.807764405
0.143701858	0.138855145	0.795606943	79.57078344	1.810206696	9.834792917
0.138855145	0.1341719	0.768771425	80.36639039	1.673471017	9.858980412
0.1341719	0.129646609	0.742841163	81.13516181	1.541040567	9.880546238
0.129646609	0.125273945	0.717785611	81.87800297	1.41281312	9.899694899
0.125273945	0.121048761	0.693575251	82.59578858	1.288684871	9.916616928
0.121048761	0.116966082	0.670181566	83.28936384	1.168551034	9.931489741
0.116966082	0.113021101	0.647576998	83.9595454	1.052306352	9.944478435
0.113021101	0.109209176	0.625734923	84.6071224	0.93984555	9.955736555
0.109209176	0.105525817	0.604629615	85.23285732	0.831063724	9.96540682
0.105525817	0.101966689	0.584236215	85.83748694	0.725856681	9.973621814
0.101966689	0.098527601	0.564530705	86.42172315	0.624121226	9.980504631
0.098527601	0.095204506	0.545489877	86.98625386	0.525755414	9.986169498
0.095204506	0.09199349	0.527091307	87.53174373	0.430658753	9.990722348
0.09199349	0.088890774	0.509313327	88.05883504	0.338732388	9.994261372
0.088890774	0.085892705	0.492135002	88.56814837	0.249879243	9.996877531
0.085892705	0.082995754	0.475536102	89.06028337	0.164004139	9.998655042
0.082995754	0.08019651	0.459497081	89.53581947	0.081013899	9.999671832
0.08019651	0.077491677	0.44399905	89.99531655	0.000817416	9.999999967
</pre>```

4. Did some more checking and this does indeed seem to work properly. It looks better and better as you add more points to make up the line. In this example I only had 11 points from the equator to the pole and they get less square as one nears the pole. Checking with excel showed that 32 or more points showed a much better holding of nearly square for each latitude polygon.

5. Originally Posted by Cryonic
Checking with excel showed that 32 or more points showed a much better holding of nearly square for each latitude polygon.
???? So, you posted the wrong image?? 'Cuz those high-latitude polys aren't square at all.

6. Originally Posted by jeric_synergy
???? So, you posted the wrong image?? 'Cuz those high-latitude polys aren't square at all.
Uh, read what I said again. I specifically noted that the image was of an 11 point line which wasn't enough to make it square.

7. Oh, ok. Post a successful one.

I wonder what the largest fraction of the diameter square mirror will create a satisfying disco ball, with all squares being equal in size?

8. Originally Posted by jeric_synergy
Well, boys, that was fun.

Now that you got that out of your system, , a related puzzle:

RW disco balls probably use the same size mirror over the whole surface. How would one construct a sphere efficiently covered with squares of n size?

Let's make it real rectangular solids of a given thickness. Mirrors should remain flat (planar) and square. Whether to include 'grout' is up to you--- that is: the mirrors can be 'stuck' to an underlying sphere, or the gaps between can be filled with 'virtual grout'.

Perhaps a convenient way to specify the size of the squares would be in degrees of latitude. The longitude would vary of course.

(BTW, reading an article on "Rio", apparently Blue Sky wrote an elaborate shader just to do this, to depict a specific sidewalk in the real Rio de Janeirro. They prefer procedurals(!!!) at Blue Sky to image maps.)
Well you could write a lscript to do it, and call it MirrorBallClone.

9. ahaha swampy nice one. To be honest those mirrorballs look more like a mosaic than what i have called.

Cyonic, I had been very busy with visits in my house and only now i have the time to wrap my head around the post you made. Thank you for it. *Replicating*

Cheers

10. Originally Posted by XswampyX
Well you could write a lscript to do it, and call it MirrorBallClone.

As usual,Swampy is full of win.

Well done, sir, well done. (Not to mention they look cool-- your reflection maps are always tasty.)

Could you expound on the theory of the math behind this??

11. My quick addition. Nothing fancy, just spacing equally sized squares over the surface of the ball.

12. No problem.... Thanks!

It's set up so you input the number of mirrors around the X axis and the scale of the sphere.

let's say 10 mirrors around the equator and a scale factor of 1. Scale=radius

Move the background layer to position x=0,y=0,z=-scale and copy it into the clip board.

Paste the clipboard into a new layer. Then rotate around the Y-axis by 360/number of Mirrors.
=(360/10)
= 36deg... do this for all 10 mirrors. That's your center row done.

You now need to work out the mirror spacing on the center row.

so ... mirrorSpacing=((PI*(scale*2))/(numberOfMirrors));
= the circumference of the middle row / number of mirrors
= 6.28318530 / 10
= 0.628318530 between mirrors

Now for the row above.....

No fancy maths.. I just plotted a point at x=0,y=0,z=-scale and rotated it around the y-axis by (360/number of mirrors).
= 360/10
= 36

I then read back in this new points Z location to get the radius of the new row and then deleted the point.

Point pos Z = -0.809017

Next is how many mirrors will fit in this row?

so ... Maxmirrors in row = ((PI*(radius*2))/(mirrorSpacing));
= the circumference of the new row / spacing of mirrors in the CENTER row.
= 3.141592 / 0.628318530
= 5.00000

Now 5.0000 is a whole number but it might come out at 7.8 or 4.5. You need the whole mirror count only. Otherwise your mirrors will all be spaced the same! You need to set this spacing per row BUT it has to be greater than the center row.

So I used the ceil function to get only the whole mirror count.

Paste the clipboard into the new layer. Then rotate around the Y-axis by 360/number of whole mirrors.
=(360/5)
= 72deg... do this for all 5 mirrors. That's your new row done.

rinse and repeat.

You only need the top half, as you can the mirror it, and the number of rows you have to create is the number of mirrors in the center row/4, as you only travel up 1/4 of the sphere.

Cheers!

Here it is, if you want to try it out. Any suggestions?

13. It's working here, ty for the lsc and the extended explanation swampy, very kind of you.

Thats actually a lot of math to me and I'm trying to figure it out, along with the Scale input, or maybe I'm just tired, i'll see in the morning

Cheers

14. Originally Posted by cagey5
My quick addition. Nothing fancy, just spacing equally sized squares over the surface of the ball.
Process??

15. Very simple. I just made a tesselated sphere with a division of 8 (small) and 10 (large). I then placed the squares using 'nut' plugin.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•