Sujet : Re: Unit fractions...
De : chris.m.thomasson.1 (at) *nospam* gmail.com (Chris M. Thomasson)
Groupes : sci.mathDate : 29. Aug 2024, 02:26:52
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vaoiot$3li19$8@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 8/28/2024 6:09 PM, Chris M. Thomasson wrote:
On 8/28/2024 6:02 PM, Chris M. Thomasson wrote:
Just a little plot I did for Moebius and WM using unit fractions on any line in n-ary space. 3d here...
>
https://i.ibb.co/9n71tZf/ct-pov.png
>
https://i.ibb.co/0hXnPpf/ct-pov.png
>
_______________________
void
ct_unit_fractions(
ct::pov::pov_file& scene,
vector_field& field,
glm::vec3 p0,
glm::vec3 p1,
unsigned long n
) {
glm::vec3 pdif = p1 - p0;
glm::vec3 pperp = { pdif.y, pdif.x, pdif.z };
It still works with:
glm::vec3 pperp = { -pdif.y, pdif.x, pdif.z };
;^)
scene.dump_cylinder(p0, p1, .01, { 1, 0, 0 });
for (unsigned long i = 1; i < n + 1; ++i)
{
float normal = 1.f / i;
glm::vec3 c0 = p0 + pdif * normal;
glm::vec3 c0_perp0 = c0 + pperp * normal;
glm::vec3 c0_perp1 = c0 - pperp * normal;
scene.dump_sphere(c0, .02, { normal, 1 - normal, 1 });
scene.dump_cylinder(c0, c0_perp0, .01, { 1, 1, 0 });
scene.dump_cylinder(c0, c0_perp1, .01, { 1, 0, 1 });
}
}
_______________________