Barri-CUDA
From Jacket Wiki
Team Barri-CUDA is a Senior Capstone Project team from the College of Computing at Georgia Tech and has been tasked with enhancing Jacket's Graphics Library. This page is where the team will document its work.
Contents |
The Team
- Stephen Smith
- Chris Logan
- Nicholas Bundy
- Wade Baxter
Installation Instructions
Simply extract the folder from the archive and add it to your MATLAB path. This can easily be done by using the File --> Set Path menu option. To ensure that it overrides everything that it needs to, it is helpful to place it at the top of the path list.
Note: In Jacket 1.4, certain actions can cause the Path order to reset itself. To prevent this, call ginfo before setting the path.
Known Bugs
- gtitle has crash bugs and can cause instability
- gplots are not always aligned properly in certain subplot configurations
- gplot3 does not have proper fragment shader support
API
In many places, the functions are similar to their MATLAB equivalent. Exceptions are noted.
Detailed API information can also be found in the 'help' documentation, which can be accessed by typing
help <function name>
at the MATLAB command prompt, similar to UNIX man pages.
AxisLabel
Generates labels appropriate for use with axes
Syntax
[X Y Z range] = AxisLabel(argument)
Parameters
- argument - A set of data (vector or matrix)
Return Values
- X - a set of labels for the x axis
- Y - a set of labels for the y axis
- Z - a set of labels for the z axis
- range - the bounds of the z axis
Remarks
The primary use for this function is to generate the parameters to pass to the buildXDAxis functions
gsurf
Parameters
- mxn array of singles, doubles, gsingles or gdoubles.
Return Value
None
Remarks
This renders a 3D surface plot of the input data.
gplot
Parameters
- nxm array or series of nxm array of singles, doubles, gsingles or gdoubles.
Return Value
None
Remarks
For a single input of nxm, gplot will plot the data columnwise with the row number over the value.
gplot3
Parameters
- 3 mx1 arrays of x y and z coordinates
- A series of points
Return Value
None
Remarks
- If given 3 arrays of coordinates, it joins the three arrays into a set of points and plots them
- If given a series of points it will plot them
build3DAxis
Parameters
- X - a set of labels for the x axis
- Y - a set of labels for the y axis
- Z - a set of labels for the z axis
- range - the bounds of the z axis
Note that the values for this function can easily be obtained by calling AxisLabel on the data you wish to plot.
Return Value
- cl - an integer referencing the call list that draws the axis
- range - the value passed into range
Remarks
This function takes in a set of labels and returns a reference to an OpenGL call list that contains instructions for drawing a 3D axis. This can be activated by passing this number to glCallLists
build2DAxis
Parameters
- X - a set of labels for the x axis
- Y - a set of labels for the y axis (use what is provided by AxisLabel)
- Z - a set of labels for the z axis
- range - the bounds of the z axis
Note that the values for this function can easily be obtained by calling AxisLabel on the data you wish to plot.
Return Value
- cl - an integer referencing the call list that draws the axis
Remarks
This function takes in a set of labels and returns a reference to an OpenGL call list that contains instructions for drawing a 2D axis. This can be activated by passing this number to glCallLists
gsubplot
gsubplot divides the current figure into nxm separate plot and selcted the lth plot as the active one.
Parameters
- m - number of rows
- n - number of columns
- l - the number of the active pane
Return Value
None
Remarks
None
drawLeftAlignedString
Draws a left aligned string at the specified coordinates
Parameters
- x - Coordinate pair of position coordinates
- str - String to draw
Return value
None
Remarks
None
drawRightAlignedString
Draws a right aligned string at the specified coordinates
Parameters
- x - Coordinate pair of position coordinates
- str - String to draw
Return value
None
Remarks
None
drawHorizCenteredString
Draws a center aligned string, such that the middle of the string passes through the x coordinate, at the specified coordinates
Parameters
- x - Coordinate pair of position coordinates
- str - String to draw
Return value
None
Remarks
None
ghold
Locks or unlocks the active subplot from receiving additional data
Parameters
- in - Toggle for hold. The string 'on' turns hold on and the string 'off' turns hold off
Return Value
None
Remarks
None
gtitle
Sets the title string of the current subplot
Parameters
- str - Title string
Return Values
None
Remarks
None
gcolormap
Define the color of the surface
Syntax
gcolormap(map) cm = gcolormap(str)
Paramaters
- map - a 64x3 matrix specifiying the colormap
- str - Select from a list of the predefined color maps
- autumn
- lines
- hot
- cool
- spring
- summer
- winter
- gray
- bone
- copper
- pink
Return Values
- cm - the matrix representing the selected colormap
gdraw
Opens a window and draws the current scene.
Parameters
None
Return Values
None
Remarks
Under typical usage, it is not necessary to call this. gsurf, gplot and such all do this automatically. However, those adding new graphs types will find this helpful