2005-04-18から1日間の記事一覧

COLLADAの穴(解決?)

三角形分割用の頂点データと、表示に使う頂点データが別だった #include<windows.h> #include<stdio.h> #include "triangulate.h" #include <GL/gl.h> #include <GL/glut.h> #include <GL/glaux.h> CvPolygon cvp; CvVertexNode cvvn[] = { {0, NULL}, {1, NULL}, {2, NULL}, {3, NULL}, {-1, NULL}, {4, NULL}, {</gl/glaux.h></gl/glut.h></gl/gl.h></stdio.h></windows.h>…

todo

行列を作る為の関数 D3DXMatrixLookAtLH() D3DXMatrixPerspectiveFovLH() を自作する

スクリーン変換関数

viにプロジェクション変換までしたものを渡すとvoにスクリーン座標が返る void convertScreen(D3DXVECTOR3 *vo, D3DXVECTOR3 *vi, int screenWidth, int screenHeight) { vo->x = (vi->x + 1) * screenWidth / 2; vo->y = (-vi->y + 1) * screenWidth / 2; v…

3D変換行列を自分でやる

DirectXの行列による変換は、普通IDirect3DDevice9::SetTransform()を使って 自動で行っているが、この仕組みを使わずに頂点変換するには、 world変換 * view変換 * projection変換 を、頂点に掛けることでできる。 // テストコード #include <stdio.h> #include <windows.h> #in</windows.h></stdio.h>…

3D 座標変換

http://www.c3.club.kyutech.ac.jp/~sukiyaki/3dt/afin.html#screen

マウスによるポリゴン選択

http://www.tsg.ne.jp/sept/prg/memo/polypick.asp