NAME

OpenGL::Sandbox::V1::Quadric

VERSION

version 0.02

SYNOPSIS

default_quadric->normals(GLU_SMOOTH)->texture(1)->sphere(100, 42, 42);

DESCRIPTION

GLU Quadrics are a funny name for a small object that holds a few rendering parameters for another few geometry-plotting functions. They provide a quick/convenient way to render some simple solids without messing with a bunch of trigonometry and loops.

CONFIGURATION

Each of these is write-only. They return the object for convenient chaining.

draw_style

$q->draw_style($x)  # GLU_FILL, GLU_LINE, GLU_SILHOUETTE, GL_POINT

You can also use aliases of:

draw_fill
draw_line
draw_silhouette
draw_point

normals

$q->normals($x)  # GLU_NONE, GLU_FLAT, GLU_SMOOTH

You can also use aliases of:

no_normals, or normals(0)
flat_normals
smooth_normals

orientation

$q->orientation($x)   # GLU_OUTSIDE, GLU_INSIDE

You can also use aliases of

inside
outside

texture

$q->texture($bool)    # GL_TRUE, GL_FALSE

GEOMETRY PLOTTING

sphere

$q->sphere($radius, $slices, $stacks);

Plot a sphere around the origin with specified dimensions.

cylinder

$q->cyliner($base, $top, $height, $slices, $stacks);

Plot a cylinder along the Z axis with the specified dimensions.

disk

$q->disk($inner, $outer, $slices, $stacks);

"disk" is slightly misleading; it is a cylinder with a hole through the center. A solid disk would actually be generated with the "cylinder" method.

partial_disk

$q->partial_disk($inner, $outer, $slices, $loops, $start, $sweep);

Plot a wedge of a disk around the Z axis.

AUTHOR

Michael Conrad <mike@nrdvana.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Michael Conrad.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.