Author Topic: Reference grid (GLSL Hacker v0.6.3.19+)  (Read 2740 times)



0 Members and 1 Guest are viewing this topic.

JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1349
    • View Profile
    • Geeks3D.com
Reference grid (GLSL Hacker v0.6.3.19+)
« on: May 09, 2014, 02:29:33 PM »
A new object  is available since version  v0.6.3.19+: a reference grid:



A demo is available in the code sample pack: moon3d/gl-320-reference-grid/

Here is the way to create a ref grid:

Code: [Select]
grid = gh_utils.grid_create()
gh_utils.grid_set_geometry_params(grid, 10, 10, 20, 20)
gh_utils.grid_set_lines_color(grid, 0.7, 0.7, 0.7, 1.0)
gh_utils.grid_set_main_lines_color(grid, 1.0, 1.0, 0.0, 1.0)
gh_utils.grid_set_main_x_axis_color(grid, 1.0, 0.0, 0.0, 1.0)
gh_utils.grid_set_main_z_axis_color(grid, 0.0, 0.0, 1.0, 1.0)
local display_main_lines = 1
local display_lines = 1
gh_utils.grid_set_display_lines_options(grid, display_main_lines, display_lines)


The rendering:
Code: [Select]
gh_gpu_program.bind(simple_color_prog)
gh_object.render(grid)