Ejemplo n.º 1
0
func put(n string, x, y, w, h uint) {
	//
	if str.Empty(n) {
		return
	}
	str.RemSpaces(&n)
	filename := n + suffix
	if scr.UnderX() {
		errh.Hint("bitte etwas Geduld ...")
	}
	buf := scr.P6Encode(x, y, w, h)
	if scr.UnderX() {
		errh.DelHint()
	}
	file := pseq.New(buf)
	file.Name(filename)
	file.Clr()
	file.Put(buf)
	file.Terminate()
	if !toPrint {
		exec.Command("pnmtopng", filename+suffix, ">", n, ".png").Run()
		ker.Msleep(100)
		exec.Command("rm", filename)
	}
}
Ejemplo n.º 2
0
func Write0() {
	//
	if !initialized {
		initialize()
	}
	if !scr.UnderX() {
		ker.Stop(pack, 1)
	}
	C.glMatrixMode(C.GL_MODELVIEW)
	C.glLoadIdentity()
	for i := 0; i < 3; i++ {
		matrix[i][0] = C.GLdouble(right[i])
		matrix[i][1] = C.GLdouble(top[i])
		matrix[i][2] = C.GLdouble(-front[i])
	}
	C.glMultMatrixd(&matrix[0][0])
	C.glTranslated(C.GLdouble(-eye[0]), C.GLdouble(-eye[1]), C.GLdouble(-eye[2]))
	C.glClear(C.GL_COLOR_BUFFER_BIT + C.GL_DEPTH_BUFFER_BIT)
	for n := uint(0); n < MaxL; n++ {
		if lightInitialized[n] {
			ActualizeLight(n)
		}
	}
	C.glBegin(POINTS)
	nn = 0
}
Ejemplo n.º 3
0
func scale(x, y float64) (int, int) {
	//
	rx, ry := int(math.Trunc(mX*(x-x0))+0.5), int(math.Trunc(mY*(y-y0))+0.5)
	ry = int(scr.NY()) - ry
	if scr.UnderX() {
		if minInt <= rx && rx < maxInt && minInt <= ry && ry < maxInt {
			return rx, ry
		}
	} else if x0 <= x && x < x0+width && y0 <= y && y < y0+height {
		return rx, ry
	}
	return maxInt, maxInt
}