Class: RBGLox::MeshQuad

Inherits:
Mesh show all
Defined in:
lib/rbglox/meshquad.rb

Overview

Quad Mesh Class

Instance Attribute Summary

Attributes inherited from Resource

#id

Instance Method Summary collapse

Methods inherited from Mesh

#draw, #free, #reload

Methods inherited from Resource

#free, #reload

Constructor Details

#initialize(x = 1.0, y = 1.0) ⇒ MeshQuad

Constructor



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rbglox/meshquad.rb', line 4

def initialize(x=1.0, y=1.0)
verts = [
    -x, -y, 0.0,
     x, -y, 0.0,
     x,  y, 0.0,
    -x,  y, 0.0 ]

  texs = [
    0.0, 0.0,
    1.0, 0.0,
    1.0, 1.0,
    0.0, 1.0 ]
  
  norms = [
    0.0, 0.0, 1.0,
    0.0, 0.0, 1.0,
    0.0, 0.0, 1.0,
    0.0, 0.0, 1.0 ]

tris = [
	3, 2, 1,
	3, 1, 0 ]

  super verts, texs, norms, tris
end