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) */ }
//void glNormal3dv (const float64 *v) func Normal3dv(v *[3]float64) { C.glNormal3dv((*C.GLdouble)(&v[0])) }
//void glNormal3dv (const float64 *v) func Normal3dv(v []float64) { if len(v) != 3 { panic(ErrorInputSize) } C.glNormal3dv((*C.GLdouble)(&v[0])) }