Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.stock
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk.opengl
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.opengl
gb.gui.qt
gb.gui.qt.ext
gb.gui.qt.opengl
gb.gui.qt.webkit
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.jit
gb.libxml
gb.logging
gb.map
gb.markdown
gb.media
gb.media.form
gb.memcached
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
Glu
AUTO_LOAD_MATRIX
BeginCurve
BeginSurface
BeginTrim
Build1DMipmaps
Build2DMipmaps
ClearColor
Color
CULLING
Cylinder
DeleteNurbsRenderer
Disk
DISPLAY_MODE
EndCurve
EndSurface
EndTrim
ErrorString
FILL
FLAT
INSIDE
INVALID_ENUM
INVALID_VALUE
LINE
LookAt
NewNurbsRenderer
NewQuadric
NONE
NURBS_MODE
NurbsCurve
NurbsProperty
NurbsSurface
Ortho2D
OUT_OF_MEMORY
OUTSIDE
PARAMETRIC_TOLERANCE
PartialDisk
Perspective
PickMatrix
POINT
Project
QuadricDrawStyle
QuadricNormals
QuadricOrientation
QuadricTexture
SAMPLING_METHOD
SAMPLING_TOLERANCE
SILHOUETTE
SMOOTH
Sphere
U_STEP
UnProject
UnProject4
V_STEP
GluNurb
GluQuadric
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webkit
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.scanner
gb.sdl
gb.sdl.sound
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

Glu.NurbsProperty (gb.opengl.glu)

Static Sub NurbsProperty ( Nurb As GluNurb, Property As Integer, Value As Float )

Set a NURBS property.

Parameters

nurb

Specifies the NURBS object (created with Glu.NewNurbsRenderer).
property

Specifies the property to be set. Valid values are Glu.SAMPLING_TOLERANCE, Glu.DISPLAY_MODE, Glu.CULLING, Glu.AUTO_LOAD_MATRIX, Glu.PARAMETRIC_TOLERANCE, Glu.SAMPLING_METHOD, Glu.U_STEP, Glu.V_STEP, or Glu.NURBS_MODE.
value

Specifies the value of the indicated property. It may be a numeric value or one of Glu.OUTLINE_POLYGON, Glu.FILL, Glu.OUTLINE_PATCH, Glu.TRUE, Glu.FALSE, Glu.PATH_LENGTH, Glu.PARAMETRIC_ERROR, Glu.DOMAIN_DISTANCE, Glu.NURBS_RENDERER, or Glu.NURBS_TESSELLATOR.

Description

Glu.NurbsProperty is used to control properties stored in a NURBS object. These properties affect the way that a NURBS curve is rendered. The accepted values for property are as follows:
Glu.NURBS_MODE

value should be set to be either Glu.NURBS_RENDERER or Glu.NURBS_TESSELLATOR. When set to Glu.NURBS_RENDERER, NURBS objects are tessellated into OpenGL primitives and sent to the pipeline for rendering. When set to Glu.NURBS_TESSELLATOR, NURBS objects are tessellated into OpenGL primitives but the vertices, normals, colors, and/or textures are retrieved back through a callback interface (see Glu.NurbsCallback). This allows the user to cache the tessellated results for further processing. The initial value is Glu.NURBS_RENDERER.
Glu.SAMPLING_METHOD

Specifies how a NURBS surface should be tessellated. value may be one of Glu.PATH_LENGTH, Glu.PARAMETRIC_ERROR, Glu.DOMAIN_DISTANCE, Glu.OBJECT_PATH_LENGTH, or Glu.OBJECT_PARAMETRIC_ERROR. When set to Glu.PATH_LENGTH, the surface is rendered so that the maximum length, in pixels, of the edges of the tessellation polygons is no greater than what is specified by Glu.SAMPLING_TOLERANCE.

Glu.PARAMETRIC_ERROR specifies that the surface is rendered in such a way that the value specified by Glu.PARAMETRIC_TOLERANCE describes the maximum distance, in pixels, between the tessellation polygons and the surfaces they approximate.

Glu.DOMAIN_DISTANCE allows users to specify, in parametric coordinates, how many sample points per unit length are taken in u, v direction.

Glu.OBJECT_PATH_LENGTH is similar to Glu.PATH_LENGTH except that it is view independent; that is, the surface is rendered so that the maximum length, in object space, of edges of the tessellation polygons is no greater than what is specified by Glu.SAMPLING_TOLERANCE.

Glu.OBJECT_PARAMETRIC_ERROR is similar to Glu.PARAMETRIC_ERROR except that it is view independent; that is, the surface is rendered in such a way that the value specified by Glu.PARAMETRIC_TOLERANCE describes the maximum distance, in object space, between the tessellation polygons and the surfaces they approximate.

The initial value of Glu.SAMPLING_METHOD is Glu.PATH_LENGTH.
Glu.SAMPLING_TOLERANCE

Specifies the maximum length, in pixels or in object space length unit, to use when the sampling method is set to Glu.PATH_LENGTH or Glu.OBJECT_PATH_LENGTH. The NURBS code is conservative when rendering a curve or surface, so the actual length can be somewhat shorter. The initial value is 50.0 pixels.
Glu.PARAMETRIC_TOLERANCE

Specifies the maximum distance, in pixels or in object space length unit, to use when the sampling method is Glu.PARAMETRIC_ERROR or Glu.OBJECT_PARAMETRIC_ERROR. The initial value is 0.5.
Glu.U_STEP

Specifies the number of sample points per unit length taken along the u axis in parametric coordinates. It is needed when Glu.SAMPLING_METHOD is set to Glu.DOMAIN_DISTANCE. The initial value is 100.
Glu.V_STEP

Specifies the number of sample points per unit length taken along the v axis in parametric coordinate. It is needed when Glu.SAMPLING_METHOD is set to Glu.DOMAIN_DISTANCE. The initial value is 100.
Glu.DISPLAY_MODE

value can be set to Glu.OUTLINE_POLYGON, Glu.FILL, or Glu.OUTLINE_PATCH. When Glu.NURBS_MODE is set to be Glu.NURBS_RENDERER, value defines how a NURBS surface should be rendered. When value is set to Glu.FILL, the surface is rendered as a set of polygons. When value is set to Glu.OUTLINE_POLYGON, the NURBS library draws only the outlines of the polygons created by tessellation. When value is set to Glu.OUTLINE_PATCH just the outlines of patches and trim curves defined by the user are drawn.

When Glu.NURBS_MODE is set to be Glu.NURBS_TESSELLATOR, value defines how a NURBS surface should be tessellated. When Glu.DISPLAY_MODE is set to Glu.FILL or Glu.OUTLINE_POLYGON, the NURBS surface is tessellated into OpenGL triangle primitives that can be retrieved back through callback functions. If Glu.DISPLAY_MODE is set to Glu.OUTLINE_PATCH, only the outlines of the patches and trim curves are generated as a sequence of line strips that can be retrieved back through callback functions.

The initial value is Glu.FILL.
Glu.CULLING

value is a boolean value that, when set to Glu.TRUE, indicates that a NURBS curve should be discarded prior to tessellation if its control points lie outside the current viewport. The initial value is Glu.FALSE.
Glu.AUTO_LOAD_MATRIX

value is a boolean value. When set to Glu.TRUE, the NURBS code downloads the projection matrix, the modelview matrix, and the viewport from the GL server to compute sampling and culling matrices for each NURBS curve that is rendered. Sampling and culling matrices are required to determine the tessellation of a NURBS surface into line segments or polygons and to cull a NURBS surface if it lies outside the viewport.

If this mode is set to Glu.FALSE, then the program needs to provide a projection matrix, a modelview matrix, and a viewport for the NURBS renderer to use to construct sampling and culling matrices. This can be done with the Glu.LoadSamplingMatrices function. This mode is initially set to Glu.TRUE. Changing it from Glu.TRUE to Glu.FALSE does not affect the sampling and culling matrices until Glu.LoadSamplingMatrices is called.

Notes

If Glu.AUTO_LOAD_MATRIX is true, sampling and culling may be executed incorrectly if NURBS routines are compiled into a display list.

A property of Glu.PARAMETRIC_TOLERANCE, Glu.SAMPLING_METHOD, Glu.U_STEP, or Glu.V_STEP, or a value of Glu.PATH_LENGTH, Glu.PARAMETRIC_ERROR, Glu.DOMAIN_DISTANCE are only available if the GLU version is 1.1 or greater. They are not valid parameters in GLU 1.0.

Glu.GetString can be used to determine the GLU version.

Glu.NURBS_MODE is only available if the GLU version is 1.3 or greater.

The Glu.OBJECT_PATH_LENGTH and Glu.OBJECT_PARAMETRIC_ERROR values for the Glu.SAMPLING_METHOD property are only available if the GLU version is 1.3 or greater.

See also

Glu.GetNurbsProperty, Glu.GetString, Glu.LoadSamplingMatrices, Glu.NurbsCallback

See original documentation on OpenGL website