Open brainjam opened 5 years ago
Thanks for reporting this!
I've also encountered this behavior, and you motivated me to look into it a bit more tonight. I don't entirely understand what's going on, but here's some info for you.
The gridlines use the same sample points as the underlying surface. This has two advantages: (1) fewer calculations and (2) gridlines will lie nicely on the surface mesh face. But using the same samples does mean that not all samples are evenly spaced. For example, if the surface uses 20 samples in the U direction, and you ask for 8 gridlines, they cannot be equally spaced.
But... I would have thought that with 128 samples, 64 would give equal spacing, but it doesn't. So like I said, I don't entirely understand the issue at the moment.
Mitigating the issue: This unequal spacing is much more noticeable when the number of gridlines is comparable to the number of samples. If you increase the number of U or V samples in your example, the issue becomes less noticeable. But that also makes animations run slower...
Yes, makes sense. The gap in spacing at 'zero longitude' may be a simple roundoff error or the like. And as you mentioned, the way you're doing it will leave gaps unless #gridlines is a divisor of #samples. One possible way of attacking this is to render the gridlines in the surface shader, as opposed to using 'real' lines. Btw, I stumbled on your project by accident (I think you had an ad in math.stackexchange). I was trying to portray a certain 3D object in Geogebra, but your site looks like it's easier and more performant for that sort of thing. I'll let you know how it goes. (this is my first github issue, so I'm not sure whether comments like this belong in a bug report or elsewhere)
One possible way of attacking this is to render the gridlines in the surface shader, as opposed to using 'real' lines
That's a neat idea. I know very little about shaders and more low-level 3d rendering; learning more about that has been on my wish list for a while, though. I believe that the library I'm using for graphics (https://github.com/unconed/mathbox) does offer a lot of support for customizations like that, though.
this is my first github issue, so I'm not sure whether comments like this belong in a bug report or elsewhere
That varies somewhat from project to project on Github. You're very welcome to post bug reports or questions here, though! Please don't hesitate to ask for improvements or new features, though I won't always be able to accommodate...For example, fixing this gridline issue seems a bit difficult, and for now I'm probably more likely to spend time improving derivative syntax, mobile experience, and making implicit surfaces more stable.
I've been working on stuff related to lines of curvature on ellipsoids (https://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid#The_triaxial_coordinate_system). Here is my first construction: https://www.math3d.org/GqCJdoOp This was way more enjoyable than doing it in Geogebra. Interesting that the only way to "save" one's work is to use the share feature. At least there's that!
@brainjam That's a really example! Hmmm, maybe I should add more greek letters to the autoCommands
list. Right now pi theta phi
are the only sequences that are automatically converted to greek letters. (You can still get others, they just need a slash, \beta
for beta.)
Interesting that the only way to "save" one's work is to use the share feature. At least there's that!
True. Maybe it would be worthwhile to have a proper login system so graphs could be displayed to the user.
One last scene: https://www.math3d.org/CL2wpVib. Ellipsoid with lines of curvature, and their stereographic projection onto the XY plane. Big blue dot is an umbilic. This was great to use, but I need to now move on to custom code because I need elliptic functions for the next step.
In the current math3d.org, look at the scene https://www.math3d.org/TVDcptzK . It is a variable segment of a sphere, with 64 lines of longitude. It looks like there is an irregularity in the spacing of the lines of latitude right where the middle line of latitude is. In actuality, there can be multiple irregularities, depending on the number of lines of latitude.