# Smooth grid lines and implicit surfaces

Take for instance the computer rendering of this implicit surface:

http://xahlee.info/surface/cayley_cubic/cayley_cubic.html

The image shows a grid on the surface. How do I calculate the connection points of this grid? I want to create a 3D mesh representation of it in other software (a video game actually).

Thanks!

Display grid lines are almost always the isoparametric lines corresponding to some parameterization. Specifically, if the surface parameterization is $(u,v)\mapsto \mathbf S(u,v)$, then the grid lines are curves of the form $(u,v)\mapsto \mathbf S(u,v_0)$ and $(u,v)\mapsto \mathbf S(u_0,v)$, for fixed $u_0$ and $v_0$.
In your picture of the Cayley surface, it looks like it's parameterized by $x$ and $y$ (in each quadrant separately). So, for any given $x$ and $y$, you can "shoot" a ray in the vertical direction (parallel to the $z$-axis) and intersect it with the surface. This gives you a parameterization $(x,y)\mapsto \mathbf S(x,y)$. But this kind of intersection process is very slow, so, again, best to choose surfaces that have a nice simple parameterization, if you can.
• Well, you can fill space with points that lie on some $xyz$ grid. Then, for each point, you can check whether it lies inside or outside the surface. If the surface equation is $f(x,y,z)=0$, then the "inside" points are ones for which $f(x,y,z) < 0$. This is cheap, and will work OK for things like ellipsoids, if you use enough points. In some ways, this is a very rudimentary version of "marching cubes". – bubba Aug 25 '13 at 9:27