Hi Kay

e-mail me, I'll send you my 3D vector package.

On Feb 23, 12:12 pm, kfj <_...@yahoo.com> wrote:
> On 22 Feb., 21:46, Tom Sharpless <tksharpl...@gmail.com> wrote:
> > I can't recommend any such library; but I can say that you would be
> > much better off with 3D vector geometry than trying to use the
> > spherical trigonometry formulas.  For example: given the 3D vertices
> > of a spherical polygon (which are unit vectors) replace each edge by a
> > 3D plane,  represented by its normal vector (which is just the cross
> > product of 2 vertices).  Then the sign of a dot product with the
> > normal tests which side of the edge a given point is on, and you can
> > build everything else on that.  In other words, you can replace
> > spherical trig with linear algebra (but not conversely).
>
> I thought about this approach myself but still hoped I could find a
> library for spherical surfaces, just merely because the surface of the
> sphere is the very ground we stand on, literally and pano-
> metaphorically.

Yes, but spherical trigonometry is a nightmare.

The fact that the panosphere happens to be a 2-D surface is not really
relevant to most of the uses to which we put it, because mostly we are
concerned about directions in space, not points on a surface.  Any 3-
vector will do for specifying a direction; when you need to map it to
the sphere, just normalize the vector.

>
> > The great weakness of trigonometry is that the error, and even
> > computability, of the functions varies with direction; but linear
> > algebra works almost independently of direction, and its few
> > singularities are far easier to detect and avoid.  That is why
> > engineers pretty much stopped using trig (for geometrical work) as
> > soon as they had mechanical calculators.
>
> I agree. It is rather cumbersome and unobvious, and I've found it
> really hard to get my head around all the maths involved just to be
> able to half-ways cope with hugin's lon/lat model and the transforms.
> I sometimes dream of keeping all image data as clouds of vectors in 3D
> space...
>
Best to keep image data in 2D arrays, and use the panosphere only as
the reference surface for coordinate mappings.

> > I put together a small C++ library of 3D vector functions that I use
> > all the time for panosphere calculations,  you are welcome to use it
> > if you want to.
>
> Thank you for the offer. Would you be so kind to point me to this
> library so I can have a look? It might come in handy. On the other
> hand, are you aware of GGL, which is now Boost.Geometry?
>
> http://geometrylibrary.geodan.nl/
>
> It does geometry and we already have Boost dependencies in hugin, so
> we might as well use it - it's not yet full part of Boost but Boost-
> approved, and it treats geometry in a dimension-agnostic way - just
> not on curved surfaces. Coding with it is a bit awkward to debug -
> like, I reckon, a lot of 'generic' C++ code - I had a case where a
> single bug in my program triggered about a hundred screens full of
> error messages - but if it works it seems to work just fine, like
> vigra. The generic idea is admittedly intriguing.

I dislike 'generic programming', for the reason you mention: it makes
many bugs into obscure compiler errors, that are much harder to
diagnose than bugs in 'real' code (this is just a toolset problem, of
course, someday compilers may offer better diagnostics for deep
template errors).  Plus it can generate code that is essentially
impossible to debug in the usual way, simply because it runs mortally
slow, when a lot of temporary objects get instantiated and deleted in
inner loops (without debug checks, the slowdown is far less
noticeable).  I really think this is more of a solution in search of a
problem than a practical advancement in programming technology.  But
Vigra does work....

Regards, Tom

>
> Kay

-- 
You received this message because you are subscribed to the Google Groups 
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to