示例#1
0
文件: imp.go 项目: CaptainSoOmA/Uni
func Write(f Figure, a uint, V, N []*vect.Imp, c col.Colour) {
	//
	switch f {
	case UNDEF:
		nn = 0 // forces glEnd / glBegin
		println("gl.Write UNDEF")
		return
	case LIGHT:
		lightVis = true
		if a >= MaxL {
			ker.Stop(pack, 2)
		}
		InitLight(a, V[0], N[0], c)
		nn = 0
		println("gl.Write LIGHT")
		return
	}
	if f != fig || a != nn || nn == 0 {
		fig = f
		nn = a
		C.glEnd()
		C.glBegin(C.GLenum(f))
	}
	C.glColor3ub(C.GLubyte(c.R), C.GLubyte(c.G), C.GLubyte(c.B))
	for i := uint(0); i < a; i++ {
		println("gl.Write", i)
		vector2yyy(V[i])
		C.glVertex3dv(&yyy[0])
		vector2yyy(N[i])
		C.glNormal3dv(&yyy[0])
	}
	/*
	   tmp:= vect.New ()
	   C.glEnd ()
	   for i:= uint(0); i < a; i++ {
	     C.glBegin (LINES)
	     C.glColor3ub (C.GLubyte(0), C.GLubyte(255), C.GLubyte(0))
	     vector2yyy (V[i]); C.glVertex3dv (&yyy[0])
	     tmp.Copy (V[i])
	     tmp.Inc (N[i])
	     vector2yyy (tmp); C.glVertex3dv (&yyy[0])
	     C.glEnd ()
	   }
	   nn = 0
	   C.glBegin (POINTS)
	*/
}
示例#2
0
文件: vertex.go 项目: Nvveen/gl
//void glVertex3dv (const float64 *v)
func Vertex3dv(v []float64) {
	if len(v) != 3 {
		panic(ErrorInputSize)
	}
	C.glVertex3dv((*C.GLdouble)(&v[0]))
}
示例#3
0
文件: vertex.go 项目: jasonrpowers/gl
//void glVertex3dv (const float64 *v)
func Vertex3dv(v *[3]float64) {
	C.glVertex3dv((*C.GLdouble)(&v[0]))
}