#!/usr/bin/perl -w

use Gimp;
use Gimp::Fu;
use PDL;
use PDL::Graphics::TriD;
use strict;
use warnings;

podregister {
    my $w = $drawable->width;
    my $h = $drawable->height;

    my $regn = $drawable->pixel_rgn (0, 0, $w, $h, 0, 0);
    my $surf = $regn->get_rect (0, 0, $w, $h);
    $surf=$surf->slice("(0)");

    imag3d [ $polar ? 'POLAR2D' : 'SURF2D', $surf ],
           { 'Lines' => $lines, 'Smooth' => $smooth };

    ();
};

exit main;
__END__

=head1 NAME

view3d - View grayscale drawable in 3D

=head1 SYNOPSIS

<Image>/View/3D Surface...

=head1 DESCRIPTION

This script uses PDL::Graphics:TriD to view a grayscale drawable in
3D. You can choose a Cartesian (default) or Polar projection, toggle
the drawing of lines, and toggle normal smoothing.

=head1 PARAMETERS

        [ PF_BOOL, 'polar', 'Radial view', 0],
        [ PF_BOOL, 'lines', 'Draw grid lines', 0],
        [ PF_BOOL, 'smooth', 'Smooth surface normals', 1]

=head1 RETURN VALUES

=head1 IMAGE TYPES

RGB*,GRAY*

=head1 AUTHOR

Tom Rathborne

=head1 DATE

1999-03-11

=head1 LICENSE

Released under the GNU Public License v2.
