// Project screen coordinates to object coordinates. func Unproject(wx, wy, wz float64, model, proj []float64, view []int32) (objx, objy, objz float64) { var ox, oy, oz C.GLdouble C.gluUnProject( C.GLdouble(wx), C.GLdouble(wy), C.GLdouble(wz), (*C.GLdouble)(&model[0]), (*C.GLdouble)(&proj[0]), (*C.GLint)(&view[0]), &ox, &oy, &oz, ) return float64(ox), float64(oy), float64(oz) }
func UnProject(winX, winY, winZ float64, model, proj *[16]float64, view *[4]int32) (float64, float64, float64) { var ox, oy, oz C.GLdouble m := (*C.GLdouble)(unsafe.Pointer(model)) p := (*C.GLdouble)(unsafe.Pointer(proj)) v := (*C.GLint)(unsafe.Pointer(view)) C.gluUnProject( C.GLdouble(winX), C.GLdouble(winY), C.GLdouble(winZ), m, p, v, &ox, &oy, &oz, ) return float64(ox), float64(oy), float64(oz) }