On Thu, Dec 5, 2013 at 10:43 AM, Christian Walde
<[email protected]> wrote:
>
> Wasn't subscribed before, so i cannot answer directly, anyhow:
>
> Chris, thanks a lot for condensing that code into a more readable and
> efficient form, that is highly appreciated, and i guess will mean i have to
> start the branch earlier that cleans the perl scripts up.
>
> There are only a small few changes i'll need to make, since this code is
> meant to go into an OpenGL tutorial; meaning i'd like to keep things as
> simple, non-magical and consistent as possible, meaning for the case of PDL:
>
> - no NiceSlice in the basic form
> - use of method calls whenever at all possible
> - only fall back to functions when method calls are not feasible

Hi Christian-

A quick review shows the all the PDL::NiceSlice stuff works for
slice() method calls.  You'll need to use dice_axis() for the
edge vector calculations, i.e.:

  $xyz->(:,$tri((0))) becomes $xyz->dice_axis(1,$tri((0)))

The call to indadd can be replaced by a for loop with
a body like this:

  for my $i ( 0..4 ) {
     $norm->dice_axis(1,$tri(:,($i))) += $N->slice(":,$i);
  }

which I think should work.  If not, something similar should.

> I'm planning to add a third level branch where i pull out all the stops and
> condense the tutorials into as efficient Perl with as little duplication as
> i can, but for the second level i'd just like to translate the C-ish
> constructs into "simple Perl", with the first level being a transliteration.
>
> Chris, would you like to get a commit into the git repo? If so, you can just
> send me a pull request to https://github.com/wchristian/ogldev/tree/perl .

Sure, that could help collaboration down the line.

> (No need to do any of the aforementioned changes, i'm happy to do them
> myself after cherry-picking your commit. (Though i wouldn't say no if you
> did. :) ))

Regarding PDL support via the list, my question about how
to fix the threading problem resulted in the addition of new
and improved error messages that would have allowed me
to zero in on the correct construct much sooner.  This fix
would not have happened without the list dialog.  :-)

Cheers,
Chris

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to