Synopsis:
Drawing polylines with invisible segments?
What influences the number of DOM elements that will cause a perceivable delay
in
rendering (Moz)?
Hello,
I am building a svg/JS application that visualizes calculations on a sphere
geometry. As
illustration 1 shows, a coordinate grid is drawn all across the sphere. The
viewport
demonstrates how the sphere would look like if you sat on the inside(!) of the
sphere,
positioning the observer's eye in the sphere center.
The lines that build the coordinate grid are polylines, and remain without arc
or bezier
smoothing in order to keep things simple right now (and also because I still
haven't
figured out the scientifically right way to curve them).
The application features an interface where the user may state a certain
viewing angle and
field of view (fov) to visulize the sphere. That means, changes to the
interface ("viewing
coordinates") will pan and roll the sphere, as well as zoom in and out of it.
The drawing of the grid is done by drawing a polyline in n steps from the
"north pole" to
the "south pole" of the sphere for every big circle (red). All this is done by
JavaScript
algorithms that perform coordinate transformations on the sphere, but that
shouldn't
bother here. Basically, the algorithm will return x and y coordinates for the
svg viewport
for every single crossing point of the grid lines. But, as there is no such
thing as an actual
3d-concept, the viewport will also contain those lines that are supposed to be
"behind" the
user. (Remember, we are looking to it from the inside!)
Problem:
The lines that are behind the user are drawn as well, like the one crossing the
upper right
in figure 1. I c a n figure out which polyline points are outside the black
circular
viewport, and of course I could eliminate those by a simple if-clause. That is
no solution
though, as the lines may "come back" on the other side of the sphere. Example:
the third
blue line from the "north pole" of the sphere (look at the upper right corner)
would look
like a potato wedge if the points outside the black circular viewport would be
omitted.
Hence, the segments outside the black viewport must be conserved geometry-wise,
but
not rendered in a viewable way.
Question:
Is there a way to draw only the polyline segments that are inside the black
circle?
I can imagine that drawing a single polyline between two crossings would do the
trick, but
that would increase the number of DOM elements in a strong way. Since I have
been
experiencing trouble with FF 2.0.0.7 (Mac) when drawing major amounts of SVG
DOM
elements I would like to refrain from doing this. (Your opinion?)
Thank you for going through this mind-tickle with me and providing any ideas ...
Regards,
dT
Illustration:
1: http://mprobst.de/ng/illu1.png
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/