Hey Karsten and the rest of the world,
I have noticed a few issues with your proposal.
* you make use of a self-written function "inner_prod". There is of course
nothing wrong with that. I only want to draw your attention to the presence
of the function Numeric.innerproduct (for reference see a couple of example
usages in visualkmeans.py). The Numeric package is a library written in C and
provides Python bindings. This implementation is fairly efficient, thus my
recommendation. But: development for Numeric has ceased and it's use is
deprecated today in favor of its successor NumPy. We might one day make the
switch to using NumPy but this is not of utmost importance as of today.
* Generally we want a simpler panning mechanism than what you thought of. The
idea was just to pan in the plane perpendicular to the viewing direction.
When I looked at your coded it occurred to me that this really should not be
too difficult to implement. Basically it should suffice to (push another
matrix, (maybe load identity - but probably not,) and then) do the
translation in x-y-direction as dictated by the user's mouse movements (and
pop matrix afterwards).
One point that I did not think through entirely is when to do this
manipulation - at the beginning or at the end of the matrix stack? Could
maybe work best by accumulating it into this .pan matrix that you are
calculating in your code proposal.
* Another thing would be the following. If you have patches please use the
sourceforge service to file them (for there is also a limit of 40KB on the
size of mails on this list). If you go to the project sourceforge pages you
will find a link labeled "Patches" in the menu where you can submit patches
to the code. Here it would be sensible to commit real patches (like diffs) as
opposed to replicating the whole non-changed code so that it is easier to
spot the differences.
As a consequence I can not try out your code right now, as I am missing part
of the clusterdisplay.py file. Please either resend to me privately or use
the patch-submission service (you might think about patching the new revision
that I sent you).
One complication with the Patches-service at SF is at the moment that it is
not clear to exactly which revision a patch might apply as we don't make use
of the SF-CVS in favor of our own private SVN-server to which you
unfortunately don't have access (and it is not clear whether I can get you
access there - though I will check). I need to change this situation. I will
try and replicate the history of the SVN-server we are currently using into
my own private one where it would be easy to grant you or other developers
the necessary access rights until we make the transition to the hopefully
soon fully functional SVN-service at SF.
Kind regards, Jonas.
|