Win32 API 日本語リファレンス
ホームGraphics.OpenGL › gluUnProject

gluUnProject

関数
ウィンドウ座標をオブジェクト座標へ逆投影変換する。
DLLGLU32.dll呼出規約winapi

シグネチャ

// GLU32.dll
#include <windows.h>

INT gluUnProject(
    DOUBLE winx,
    DOUBLE winy,
    DOUBLE winz,
    const DOUBLE* modelMatrix,
    const DOUBLE* projMatrix,
    const INT* viewport,
    DOUBLE* objx,
    DOUBLE* objy,
    DOUBLE* objz
);

パラメーター

名前方向説明
winxDOUBLEin逆投影するウィンドウ座標のx成分。
winyDOUBLEin逆投影するウィンドウ座標のy成分。
winzDOUBLEin逆投影するウィンドウ深度値(0〜1)。
modelMatrixDOUBLE*in現在のモデルビュー行列(列優先16要素)へのポインタ。
projMatrixDOUBLE*in現在の射影行列(列優先16要素)へのポインタ。
viewportINT*in現在のビューポート(x,y,w,h)を格納したINT配列。
objxDOUBLE*inout算出されたオブジェクト座標xを受け取る出力先ポインタ。
objyDOUBLE*inout算出されたオブジェクト座標yを受け取る出力先ポインタ。
objzDOUBLE*inout算出されたオブジェクト座標zを受け取る出力先ポインタ。

戻り値の型: INT

各言語での呼び出し定義

// GLU32.dll
#include <windows.h>

INT gluUnProject(
    DOUBLE winx,
    DOUBLE winy,
    DOUBLE winz,
    const DOUBLE* modelMatrix,
    const DOUBLE* projMatrix,
    const INT* viewport,
    DOUBLE* objx,
    DOUBLE* objy,
    DOUBLE* objz
);
[DllImport("GLU32.dll", ExactSpelling = true)]
static extern int gluUnProject(
    double winx,   // DOUBLE
    double winy,   // DOUBLE
    double winz,   // DOUBLE
    ref double modelMatrix,   // DOUBLE*
    ref double projMatrix,   // DOUBLE*
    ref int viewport,   // INT*
    ref double objx,   // DOUBLE* in/out
    ref double objy,   // DOUBLE* in/out
    ref double objz   // DOUBLE* in/out
);
<DllImport("GLU32.dll", ExactSpelling:=True)>
Public Shared Function gluUnProject(
    winx As Double,   ' DOUBLE
    winy As Double,   ' DOUBLE
    winz As Double,   ' DOUBLE
    ByRef modelMatrix As Double,   ' DOUBLE*
    ByRef projMatrix As Double,   ' DOUBLE*
    ByRef viewport As Integer,   ' INT*
    ByRef objx As Double,   ' DOUBLE* in/out
    ByRef objy As Double,   ' DOUBLE* in/out
    ByRef objz As Double   ' DOUBLE* in/out
) As Integer
End Function
' winx : DOUBLE
' winy : DOUBLE
' winz : DOUBLE
' modelMatrix : DOUBLE*
' projMatrix : DOUBLE*
' viewport : INT*
' objx : DOUBLE* in/out
' objy : DOUBLE* in/out
' objz : DOUBLE* in/out
Declare PtrSafe Function gluUnProject Lib "glu32" ( _
    ByVal winx As Double, _
    ByVal winy As Double, _
    ByVal winz As Double, _
    ByRef modelMatrix As Double, _
    ByRef projMatrix As Double, _
    ByRef viewport As Long, _
    ByRef objx As Double, _
    ByRef objy As Double, _
    ByRef objz As Double) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

gluUnProject = ctypes.windll.glu32.gluUnProject
gluUnProject.restype = ctypes.c_int
gluUnProject.argtypes = [
    ctypes.c_double,  # winx : DOUBLE
    ctypes.c_double,  # winy : DOUBLE
    ctypes.c_double,  # winz : DOUBLE
    ctypes.POINTER(ctypes.c_double),  # modelMatrix : DOUBLE*
    ctypes.POINTER(ctypes.c_double),  # projMatrix : DOUBLE*
    ctypes.POINTER(ctypes.c_int),  # viewport : INT*
    ctypes.POINTER(ctypes.c_double),  # objx : DOUBLE* in/out
    ctypes.POINTER(ctypes.c_double),  # objy : DOUBLE* in/out
    ctypes.POINTER(ctypes.c_double),  # objz : DOUBLE* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('GLU32.dll')
gluUnProject = Fiddle::Function.new(
  lib['gluUnProject'],
  [
    Fiddle::TYPE_DOUBLE,  # winx : DOUBLE
    Fiddle::TYPE_DOUBLE,  # winy : DOUBLE
    Fiddle::TYPE_DOUBLE,  # winz : DOUBLE
    Fiddle::TYPE_VOIDP,  # modelMatrix : DOUBLE*
    Fiddle::TYPE_VOIDP,  # projMatrix : DOUBLE*
    Fiddle::TYPE_VOIDP,  # viewport : INT*
    Fiddle::TYPE_VOIDP,  # objx : DOUBLE* in/out
    Fiddle::TYPE_VOIDP,  # objy : DOUBLE* in/out
    Fiddle::TYPE_VOIDP,  # objz : DOUBLE* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "glu32")]
extern "system" {
    fn gluUnProject(
        winx: f64,  // DOUBLE
        winy: f64,  // DOUBLE
        winz: f64,  // DOUBLE
        modelMatrix: *const f64,  // DOUBLE*
        projMatrix: *const f64,  // DOUBLE*
        viewport: *const i32,  // INT*
        objx: *mut f64,  // DOUBLE* in/out
        objy: *mut f64,  // DOUBLE* in/out
        objz: *mut f64  // DOUBLE* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("GLU32.dll")]
public static extern int gluUnProject(double winx, double winy, double winz, ref double modelMatrix, ref double projMatrix, ref int viewport, ref double objx, ref double objy, ref double objz);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GLU32_gluUnProject' -Namespace Win32 -PassThru
# $api::gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
#uselib "GLU32.dll"
#func global gluUnProject "gluUnProject" double, double, double, sptr, sptr, sptr, sptr, sptr, sptr
; gluUnProject winx, winy, winz, varptr(modelMatrix), varptr(projMatrix), varptr(viewport), varptr(objx), varptr(objy), varptr(objz)   ; 戻り値は stat
; winx : DOUBLE -> "double"
; winy : DOUBLE -> "double"
; winz : DOUBLE -> "double"
; modelMatrix : DOUBLE* -> "sptr"
; projMatrix : DOUBLE* -> "sptr"
; viewport : INT* -> "sptr"
; objx : DOUBLE* in/out -> "sptr"
; objy : DOUBLE* in/out -> "sptr"
; objz : DOUBLE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "GLU32.dll"
#cfunc global gluUnProject "gluUnProject" double, double, double, var, var, var, var, var, var
; res = gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
; winx : DOUBLE -> "double"
; winy : DOUBLE -> "double"
; winz : DOUBLE -> "double"
; modelMatrix : DOUBLE* -> "var"
; projMatrix : DOUBLE* -> "var"
; viewport : INT* -> "var"
; objx : DOUBLE* in/out -> "var"
; objy : DOUBLE* in/out -> "var"
; objz : DOUBLE* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT gluUnProject(DOUBLE winx, DOUBLE winy, DOUBLE winz, DOUBLE* modelMatrix, DOUBLE* projMatrix, INT* viewport, DOUBLE* objx, DOUBLE* objy, DOUBLE* objz)
#uselib "GLU32.dll"
#cfunc global gluUnProject "gluUnProject" double, double, double, var, var, var, var, var, var
; res = gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
; winx : DOUBLE -> "double"
; winy : DOUBLE -> "double"
; winz : DOUBLE -> "double"
; modelMatrix : DOUBLE* -> "var"
; projMatrix : DOUBLE* -> "var"
; viewport : INT* -> "var"
; objx : DOUBLE* in/out -> "var"
; objy : DOUBLE* in/out -> "var"
; objz : DOUBLE* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	glu32 = windows.NewLazySystemDLL("GLU32.dll")
	procgluUnProject = glu32.NewProc("gluUnProject")
)

// winx (DOUBLE), winy (DOUBLE), winz (DOUBLE), modelMatrix (DOUBLE*), projMatrix (DOUBLE*), viewport (INT*), objx (DOUBLE* in/out), objy (DOUBLE* in/out), objz (DOUBLE* in/out)
r1, _, err := procgluUnProject.Call(
	uintptr(math.Float64bits(winx)),
	uintptr(math.Float64bits(winy)),
	uintptr(math.Float64bits(winz)),
	uintptr(modelMatrix),
	uintptr(projMatrix),
	uintptr(viewport),
	uintptr(objx),
	uintptr(objy),
	uintptr(objz),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。
function gluUnProject(
  winx: Double;   // DOUBLE
  winy: Double;   // DOUBLE
  winz: Double;   // DOUBLE
  modelMatrix: Pointer;   // DOUBLE*
  projMatrix: Pointer;   // DOUBLE*
  viewport: Pointer;   // INT*
  objx: Pointer;   // DOUBLE* in/out
  objy: Pointer;   // DOUBLE* in/out
  objz: Pointer   // DOUBLE* in/out
): Integer; stdcall;
  external 'GLU32.dll' name 'gluUnProject';
result := DllCall("GLU32\gluUnProject"
    , "Double", winx   ; DOUBLE
    , "Double", winy   ; DOUBLE
    , "Double", winz   ; DOUBLE
    , "Ptr", modelMatrix   ; DOUBLE*
    , "Ptr", projMatrix   ; DOUBLE*
    , "Ptr", viewport   ; INT*
    , "Ptr", objx   ; DOUBLE* in/out
    , "Ptr", objy   ; DOUBLE* in/out
    , "Ptr", objz   ; DOUBLE* in/out
    , "Int")   ; return: INT
●gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz) = DLL("GLU32.dll", "int gluUnProject(double, double, double, void*, void*, void*, void*, void*, void*)")
# 呼び出し: gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
# winx : DOUBLE -> "double"
# winy : DOUBLE -> "double"
# winz : DOUBLE -> "double"
# modelMatrix : DOUBLE* -> "void*"
# projMatrix : DOUBLE* -> "void*"
# viewport : INT* -> "void*"
# objx : DOUBLE* in/out -> "void*"
# objy : DOUBLE* in/out -> "void*"
# objz : DOUBLE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "glu32" fn gluUnProject(
    winx: f64, // DOUBLE
    winy: f64, // DOUBLE
    winz: f64, // DOUBLE
    modelMatrix: [*c]f64, // DOUBLE*
    projMatrix: [*c]f64, // DOUBLE*
    viewport: [*c]i32, // INT*
    objx: [*c]f64, // DOUBLE* in/out
    objy: [*c]f64, // DOUBLE* in/out
    objz: [*c]f64 // DOUBLE* in/out
) callconv(std.os.windows.WINAPI) i32;
proc gluUnProject(
    winx: float64,  # DOUBLE
    winy: float64,  # DOUBLE
    winz: float64,  # DOUBLE
    modelMatrix: ptr float64,  # DOUBLE*
    projMatrix: ptr float64,  # DOUBLE*
    viewport: ptr int32,  # INT*
    objx: ptr float64,  # DOUBLE* in/out
    objy: ptr float64,  # DOUBLE* in/out
    objz: ptr float64  # DOUBLE* in/out
): int32 {.importc: "gluUnProject", stdcall, dynlib: "GLU32.dll".}
pragma(lib, "glu32");
extern(Windows)
int gluUnProject(
    double winx,   // DOUBLE
    double winy,   // DOUBLE
    double winz,   // DOUBLE
    double* modelMatrix,   // DOUBLE*
    double* projMatrix,   // DOUBLE*
    int* viewport,   // INT*
    double* objx,   // DOUBLE* in/out
    double* objy,   // DOUBLE* in/out
    double* objz   // DOUBLE* in/out
);
ccall((:gluUnProject, "GLU32.dll"), stdcall, Int32,
      (Float64, Float64, Float64, Ptr{Float64}, Ptr{Float64}, Ptr{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}),
      winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
# winx : DOUBLE -> Float64
# winy : DOUBLE -> Float64
# winz : DOUBLE -> Float64
# modelMatrix : DOUBLE* -> Ptr{Float64}
# projMatrix : DOUBLE* -> Ptr{Float64}
# viewport : INT* -> Ptr{Int32}
# objx : DOUBLE* in/out -> Ptr{Float64}
# objy : DOUBLE* in/out -> Ptr{Float64}
# objz : DOUBLE* in/out -> Ptr{Float64}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t gluUnProject(
    double winx,
    double winy,
    double winz,
    double* modelMatrix,
    double* projMatrix,
    int32_t* viewport,
    double* objx,
    double* objy,
    double* objz);
]]
local glu32 = ffi.load("glu32")
-- glu32.gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
-- winx : DOUBLE
-- winy : DOUBLE
-- winz : DOUBLE
-- modelMatrix : DOUBLE*
-- projMatrix : DOUBLE*
-- viewport : INT*
-- objx : DOUBLE* in/out
-- objy : DOUBLE* in/out
-- objz : DOUBLE* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('GLU32.dll');
const gluUnProject = lib.func('__stdcall', 'gluUnProject', 'int32_t', ['double', 'double', 'double', 'double *', 'double *', 'int32_t *', 'double *', 'double *', 'double *']);
// gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
// winx : DOUBLE -> 'double'
// winy : DOUBLE -> 'double'
// winz : DOUBLE -> 'double'
// modelMatrix : DOUBLE* -> 'double *'
// projMatrix : DOUBLE* -> 'double *'
// viewport : INT* -> 'int32_t *'
// objx : DOUBLE* in/out -> 'double *'
// objy : DOUBLE* in/out -> 'double *'
// objz : DOUBLE* in/out -> 'double *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("GLU32.dll", {
  gluUnProject: { parameters: ["f64", "f64", "f64", "pointer", "pointer", "pointer", "pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz)
// winx : DOUBLE -> "f64"
// winy : DOUBLE -> "f64"
// winz : DOUBLE -> "f64"
// modelMatrix : DOUBLE* -> "pointer"
// projMatrix : DOUBLE* -> "pointer"
// viewport : INT* -> "pointer"
// objx : DOUBLE* in/out -> "pointer"
// objy : DOUBLE* in/out -> "pointer"
// objz : DOUBLE* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t gluUnProject(
    double winx,
    double winy,
    double winz,
    double* modelMatrix,
    double* projMatrix,
    int32_t* viewport,
    double* objx,
    double* objy,
    double* objz);
C, "GLU32.dll");
// $ffi->gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, objx, objy, objz);
// winx : DOUBLE
// winy : DOUBLE
// winz : DOUBLE
// modelMatrix : DOUBLE*
// projMatrix : DOUBLE*
// viewport : INT*
// objx : DOUBLE* in/out
// objy : DOUBLE* in/out
// objz : DOUBLE* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Glu32 extends StdCallLibrary {
    Glu32 INSTANCE = Native.load("glu32", Glu32.class);
    int gluUnProject(
        double winx,   // DOUBLE
        double winy,   // DOUBLE
        double winz,   // DOUBLE
        DoubleByReference modelMatrix,   // DOUBLE*
        DoubleByReference projMatrix,   // DOUBLE*
        IntByReference viewport,   // INT*
        DoubleByReference objx,   // DOUBLE* in/out
        DoubleByReference objy,   // DOUBLE* in/out
        DoubleByReference objz   // DOUBLE* in/out
    );
}
@[Link("glu32")]
lib LibGLU32
  fun gluUnProject = gluUnProject(
    winx : Float64,   # DOUBLE
    winy : Float64,   # DOUBLE
    winz : Float64,   # DOUBLE
    modelMatrix : Float64*,   # DOUBLE*
    projMatrix : Float64*,   # DOUBLE*
    viewport : Int32*,   # INT*
    objx : Float64*,   # DOUBLE* in/out
    objy : Float64*,   # DOUBLE* in/out
    objz : Float64*   # DOUBLE* in/out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef gluUnProjectNative = Int32 Function(Double, Double, Double, Pointer<Double>, Pointer<Double>, Pointer<Int32>, Pointer<Double>, Pointer<Double>, Pointer<Double>);
typedef gluUnProjectDart = int Function(double, double, double, Pointer<Double>, Pointer<Double>, Pointer<Int32>, Pointer<Double>, Pointer<Double>, Pointer<Double>);
final gluUnProject = DynamicLibrary.open('GLU32.dll')
    .lookupFunction<gluUnProjectNative, gluUnProjectDart>('gluUnProject');
// winx : DOUBLE -> Double
// winy : DOUBLE -> Double
// winz : DOUBLE -> Double
// modelMatrix : DOUBLE* -> Pointer<Double>
// projMatrix : DOUBLE* -> Pointer<Double>
// viewport : INT* -> Pointer<Int32>
// objx : DOUBLE* in/out -> Pointer<Double>
// objy : DOUBLE* in/out -> Pointer<Double>
// objz : DOUBLE* in/out -> Pointer<Double>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function gluUnProject(
  winx: Double;   // DOUBLE
  winy: Double;   // DOUBLE
  winz: Double;   // DOUBLE
  modelMatrix: Pointer;   // DOUBLE*
  projMatrix: Pointer;   // DOUBLE*
  viewport: Pointer;   // INT*
  objx: Pointer;   // DOUBLE* in/out
  objy: Pointer;   // DOUBLE* in/out
  objz: Pointer   // DOUBLE* in/out
): Integer; stdcall;
  external 'GLU32.dll' name 'gluUnProject';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "gluUnProject"
  c_gluUnProject :: CDouble -> CDouble -> CDouble -> Ptr CDouble -> Ptr CDouble -> Ptr Int32 -> Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO Int32
-- winx : DOUBLE -> CDouble
-- winy : DOUBLE -> CDouble
-- winz : DOUBLE -> CDouble
-- modelMatrix : DOUBLE* -> Ptr CDouble
-- projMatrix : DOUBLE* -> Ptr CDouble
-- viewport : INT* -> Ptr Int32
-- objx : DOUBLE* in/out -> Ptr CDouble
-- objy : DOUBLE* in/out -> Ptr CDouble
-- objz : DOUBLE* in/out -> Ptr CDouble
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let gluunproject =
  foreign "gluUnProject"
    (double @-> double @-> double @-> (ptr double) @-> (ptr double) @-> (ptr int32_t) @-> (ptr double) @-> (ptr double) @-> (ptr double) @-> returning int32_t)
(* winx : DOUBLE -> double *)
(* winy : DOUBLE -> double *)
(* winz : DOUBLE -> double *)
(* modelMatrix : DOUBLE* -> (ptr double) *)
(* projMatrix : DOUBLE* -> (ptr double) *)
(* viewport : INT* -> (ptr int32_t) *)
(* objx : DOUBLE* in/out -> (ptr double) *)
(* objy : DOUBLE* in/out -> (ptr double) *)
(* objz : DOUBLE* in/out -> (ptr double) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library glu32 (t "GLU32.dll"))
(cffi:use-foreign-library glu32)

(cffi:defcfun ("gluUnProject" glu-un-project :convention :stdcall) :int32
  (winx :double)   ; DOUBLE
  (winy :double)   ; DOUBLE
  (winz :double)   ; DOUBLE
  (model-matrix :pointer)   ; DOUBLE*
  (proj-matrix :pointer)   ; DOUBLE*
  (viewport :pointer)   ; INT*
  (objx :pointer)   ; DOUBLE* in/out
  (objy :pointer)   ; DOUBLE* in/out
  (objz :pointer))   ; DOUBLE* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $gluUnProject = Win32::API::More->new('GLU32',
    'int gluUnProject(double winx, double winy, double winz, LPVOID modelMatrix, LPVOID projMatrix, LPVOID viewport, LPVOID objx, LPVOID objy, LPVOID objz)');
# my $ret = $gluUnProject->Call($winx, $winy, $winz, $modelMatrix, $projMatrix, $viewport, $objx, $objy, $objz);
# winx : DOUBLE -> double
# winy : DOUBLE -> double
# winz : DOUBLE -> double
# modelMatrix : DOUBLE* -> LPVOID
# projMatrix : DOUBLE* -> LPVOID
# viewport : INT* -> LPVOID
# objx : DOUBLE* in/out -> LPVOID
# objy : DOUBLE* in/out -> LPVOID
# objz : DOUBLE* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。