If you can't read please download the document
Upload
callox1111
View
488
Download
4
Embed Size (px)
Citation preview
KVS
K V S
Kyoto Visualization System
1. 2.
................................................................................................................ 1 ....................................................................................................................... 22.1 2.2 2.3 OpenGL/GLUT ......................................................................................... 2 Cygwin...................................................................................................... 4 KVS........................................................................................................... 4 ......................................................................................... 4 ......................................................... 5 ............................................................................... 6
2.3.1 2.3.2 2.3.3
3.
............................................................................................................. 73.1 ................................................................................................ 7 1 2 3 3.2 3.3 4 5 6 7 3 C ............ 7 3 KVS ............ 10 3 ...................................................................... 13 .................................................................................... 16 ..................................... 18 ......................................... 22 Object-Renderer ...................................... 25
.............................................................................................. 16 ........................................................................................... 18
4.
............................................................................................. 334.1 ..................................................................... 33 8 9 ..................................... 34 Object Mapper ............................................................. 36
5.
....................................................................................................... 445.1 5.2 ................................................................................ 44 10 ..................................................................... 44 ............................................................................. 48 11 .................................................................. 48
6.
CAVE ......................................................................................... 52 12 CAVE ............................................................................. 52
1.
KVS (Kyoto Visualization Library) KVS KVS KVS (CAVE) C++C++ C C++C
1
2.
2.
KVS KVS Windows, Linux, Mac OS X KVS OpenGL GLUT Windows Cygwin KVS
2.1
OpenGL/GLUT
Linux Linux OpenGL GLUT Mac OS X Mac OS X OpenGL/GLUT Xcode Tools Xcode Tools Developer Tools Software (gcc) OpenGL SDK
Windows (Microsoft Visual C++ .NET) Windows Microsoft Visual C++ .NET VC.NET VC.NET OpenGL (opengl32.lib, glu32.lib) (gl.h, glu.h)GLUT (glut32.lib, glut.h, glut32.dll) GLUT http://www.xmission.com/~nate/glut.html Windows
2
glut32.lib, glut.h, glut32.dll (glut32.lib)C:Program FilesMicrosoft Visual Studio .NET 2003Vc7lib
(glut.h)C:Program FilesMicrosoft Visual Studio .NET 2003Vc7includeGL
DLL (glut32.dll)C:WINDOWSsystem32
Windows (Microsoft Visual C++ 2005 Express Edition) Web http://www.microsoft.com/japan/msdn/vstudio/ express/visualc/ Microsoft Visual C++ 2005 Express Edition VC 2005Windows Platform SDK INCLUDE LIB INCLUDE LIB INCLUDE LIB C:Program FilesMicrosoft Platform SDKInclude C:Program FilesMicrosoft Platform SDKLib
VC 2005 VC.NET GLUT GLUT glut32.lib, glut.h, glut32.dll (glut32.lib)C:Program FilesMicrosoft Platform SDKLib
(glut.h)C:Program FilesMicrosoft Platform SDKIncludegl
DLL (glut32.dll)C:WINDOWSsystem32
3
2.
Windows (Cygwin) Cygwin OpenGL Cygwin (Install) Devel Graphics Libs Make, GCC/C++ OpenGL OpenGL
2.2
Cygwin
Cygwin Windows UNIX Cygwin Windows KVS Cygwin (http://www.cygwin.com/) (setup.exe) OpenGL
2.3
KVS
KVS KVS http://www.viz.media.kyoto-u.ac.jp/kvs/ KVS
2.3.1
Linux, Mac OS X, Windows(Cygwin) Linux, Mac OS X, Windows(Cygwin) UNIX GCC (version 3.3 ) KVS /tmp kvs
4
% cd /tmp/kvs % make
Windows(VC.NET, VC 2005) Windows(VC.NET, VC 2005) Windows KVS C:tmp kvs
C:Document and Settingsvizlab> cd C:tmpkvs C:tmpkvs> nmake f Makefile.vc
Microsoft Visual Studio .NET 2003 / Visual C++ 2005 Express EditionVisual Studio .NET / Visual Studio ToolsVisual Studio .NET 2003 / Visual Studio 2005 VC VC KVS_DIR PATH KVS_DIR KVS PATH
2.3.2
UNIX bash ~/.bashrc
export KVS_DIR=/usr/local/kvs export PATH=$KVS_DIR/bin:$PATH
5
2.
KVS_DIR KVS
% make install
Windows KVS_DIR PATH C:Program Fileskvs %PATH%;%KVS_DIR%bin
KVS_DIR KVS
> nmake f Makefile.vc install
2.3.3
installuninstall kvs KVS
6
3.
2 3 KVS KVS 3 2 KVS UNIX DOS Windows KVS KVS kvsmakeUNIX Windows
3.1
KVS C KVS C 1 3 C
r T x = [1 2 3] ,
r T y = [4 5 6]
(1)
Lesson1
% mkdir Lesson1 % cd Lesson1
7
3.
(2)
main.c 3
#include int main( void ) { double x[3] = { 1, 2, 3 }; double y[3] = { 4, 5, 6 }; return 0; }
(3)
3 Vector3Sum Vector3Sum( x, y, &out ); out &
void Vector3Sum( double* x, double* y, double (*out)[] ) { int i; for( i = 0; i < 3; i++ ) (*out)[i] = x[i] + y[i]; }
(4)
Vector3Diff Vector3DotProduct Vector3CrossProduct Vector3DotProduct
void Vector3Diff( double* x, double* y, double (*out)[] ) { int i; for( i = 0; i < 3; i++ ) (*out)[i] = x[i] - y[i]; } void Vector3DotProduct( double* x, double* y, double* out ) { *out = x[0]*y[0] + x[1]*y[1] + x[2]*y[2]; }
8
void Vector3CrossProduct( { (*out)[0] = x[1]*y[2] (*out)[1] = x[2]*y[0] (*out)[2] = x[0]*y[1] }
double* x, double* y, double (*out)[] ) x[2]*y[1]; x[0]*y[2]; x[1]*y[0];
(5)
3 Vector3Print
void Vector3Print( double* x ) { int i; for( i = 0; i < 3; i++ ) printf( %lf , x[i] ); printf( n ); }r r (3),(4),(5)(2) main.c x , y
(6)
#include /* (3),(4),(5) */ int main( void ) { double x[3] = { 1, 2, 3 }; double y[3] = { 4, 5, 6 }; /* v1 = x + y */ double v1[3]; Vector3Sum( x, y, &v1 ); printf(x + yn); Vector3Print( v1 ); /* v2 = x y */ double v2[3]; Vector3Diff( x, y, &v2 ); printf(x - yn); Vector3Print( v2 ); /* v3 = x dot y */ double v3; Vector3DotProduct( x, y, &v3 ); printf(x dot yn); printf( %dn, v3 ); /* v4 = x cross y */ double v4[3]; Vector3CrossProduct( x, y, &v4 ); printf(x cross yn); Vector3Print( v4 );
9
3.
return 0; }
(7)
(6)
UNIX % gcc main.c % ./a.out Windows > cl main.c > a.exe
C KVS 2 3 KVS
r r x , y KVS
(1)
Lesson2
% mkdir Lesson2 % cd Lesson2
(2)
main.cpp C++C Plus Plus cpp KVS (kvs.h) KVS kvs kvs KVS
10
#include using namespace kvs; int main( void ) { return 0; }
// kvs.h // kvs
(3)
r r x , y 3 double Vector3d
3 3 d double
Vector3d x; Vector3d y;
(4)
[] C
x[0] = 1; x[1] = 2; x[2] = 3; y[0] = 4; y[1] = 5; y[2] = 6;
Vector3d x( 1, 2, 3 ); Vector3d y( 4, 5, 6 );
(5)
// v1 = x + y Vector3d v1 = x + y; // v2 = x y Vector3d v2 = x - y; // v3 = x dot y double v3 = x.dot( y ); // v4 = x cross y Vector3d v4 = x.cross( y );
11
3.
(6)
C++ cout cout iostream cout std std::cout using namespace std;
cout