Skip to content
This repository has been archived by the owner on Feb 18, 2018. It is now read-only.

Surfaces

Sdanisch edited this page Aug 18, 2014 · 3 revisions

Surface plotting, look into examples for usage examples. Signature:

glplot{T <: AbstractArray}(attributevalue::Matrix{T}, attribute= :z; primitive=SURFACE(), xrange::Range=0:1, yrange::Range=0:1, color=Vec4(1), rest...)

With this API, you can upload attributes to VRAM, either as matrix or a Vector(1,2,3,4), with the cardinality depending on the attribute. The default defines a grid with xrangeyrangeMatrix[n], and projects a 2D geometry onto the z-values on every grid point. This will look something like this, for a quad as a 2D geometry:

+---+---+---+
| * | * | * |
+---+---+---+

Whereas the stars are the zvalues defined by the Matrix and the plusses are defined by the 2D geometry, with zvalues interpolated from the surrounding zvalues. You can upload different attributes, different 2D geometries, and your own meshes, which will be instanced for every value in the matrix. If you upload more then one Matrix, different scalings are allowed. This works quite easily, as OpenGL always does texture lookup in the range of 0-1. The lookup coordinates are calculated from the main matrix, which is the "attributevalue" matrix.

Clone this wiki locally