Powered by SmartDoc

�v���e���E�ǂ�����������N���Ă��Ȃ��͂�

2009�N6��13��-
����ŕF
shirai at mail.com
http://akihiko.shirai.as/projects/BookWii/

�ڎ�

���c�O�Ȃ���v�e�\��(�ォ�珇�ɗ��p���l�L��)

API��r

�{���ł̓v���O���~���OAPI�Ƃ��Ă�WiimoteLib��WiiYourself!���Љ�܂������A����2�ˆȊO�ɂ����Ȃ葽����API�v���W�F�N�g�����݂��܂��B

��(�쐬��)API��r
API�� �X�^�b�N�Ή� ���� �@�\ ���C�Z���X ����
WiimoteLib B/W/T C#/VB/C++(��.NET) B/A/I/R/L/M MS-PL�� �{��4�͂ɂĉ��
Wiim ×{W} C++ B/A/R/L/M GNU LGPL SDL�Ɖ����x���g�����Q�[���J������

B:�{�^���AA:�����x�Z���T�[�AI:�ԊO���AR:�o�C�u���[�^�[�o�́AL:LED�o�́AM:�����ڑ��AS:�X�s�[�J�[

Wiiuse

�}���`�v���b�g�t�H�[��������Ƃ���API http://wiiuse.net/ http://www.wiili.org/index.php/Wiiuse http://arbitrary2.blog22.fc2.com/blog-entry-284.html http://sourceforge.net/project/showfiles.php?group_id=187194

cWiid

cWiid��Linux�‹��ŗ��p����Ă���WiiRemote�p���C�u�����ł��B

[���M���E����m�F��]Wiim

�V���v���ȃQ�[�������uWiim�v

Wiim("whim"��������"wheem"�Ɣ������邻���ł�)�́A�č��~�l�\�^�B�ݏZ��eric_hcr80���ɂ���ĊJ�����ꂽC++�pAPI�ŁAGNU Lesser General Public License�Ō��J����A2007�N�ɊJ�����I�����Ă��܂��B

Wiim�̃z�[���y�[�W

http://digitalretrograde.com/projects/wiim/

�@�\�I�ɂ͉����x�Z���T�A�{�^����Ԍ��o�ALED�E�o�C�u���[�^�o�͂Ȃǂ̊�{�@�\�ɉ����A�}���`WiiRemote�ւ̃A�N�Z�X�Ȃǂ���������Ă��܂��BVector�N���X�𗘗p���A���J�ɏ�����Ă���A�R�[�f�B���O�͂��₷���̂ł����A�ԊO���֌W�A�k���`���N�A�g���[�q�̋@�\�͖������̂܂܃v���W�F�N�g�͏I�����Ă���悤�ł�(���[���ɂĖ{�l�ɖ₢���킹���Ƃ���A���̃v���W�F�N�g�̋}���Ȑ����ɂ��A�Ƃ̂��Ƃł�)�B

Wiim�̃z�[���y�[�W

�������Q�[���uWiim Landar�v

Wiim�͏�L�̒ʂ�A���ɊJ�����I����Ă��܂����v���W�F�N�g�ł����A������I�[�v���\�[�XWiiRemote�pAPI�̒��ł��A�B��Q�[���炵���Q�[���uWiim Landar�v�̃\�[�X�R�[�h���t�����Ă��܂��B

��Wiim Landar�̉���

�܂���Wiim�̃z�[���y�[�W����f���̎��s�t�@�C���uwiim\_lander\_demo.zip�v����肵�܂��傤�B������̃A�[�J�C�u�ɂ̓r���h�ς݂̎��s�t�@�C�����܂܂�Ă��܂��B�𓀂����t�H���_�ɂ�SDL.dll�ASDL\_gfx.dll�A�����Ď��s�t�@�C��WiimDemo.exe��3�‚̃t�@�C��������͂��ł��B�܂��́uWiimDemo.exe�v���_�u���N���b�N���Ă݂܂��傤�B

�������ʼn^���悯��΁uWiim Landar�v�̃Q�[����ʂ��\������܂��B

GiiMote

GiiMote�̓W���[�W�A�H�ȑ�̊w��Sam Whited(http://samwhited.com/)�ɂ���ĊJ������AGoogle Code(http://code.google.com/p/giimote/)�ɂČ��J����Ă���v���W�F�N�g�ŁA�uGame Maker�v�Ƃ����Q�[������p�X�N���v�g����GML(Game Maker Language)�ƌ����ł悭�g���鐔�w�c�[���uMATLAB�v�p��WiiRemote�@�\�g����񋟂��Ă��܂��B���C�Z���X��GNU Lesser General Public License�ł��B

MaxMSP���g�����v���W�F�N�g

�X���ɂ��WiiRemote�}�E�X

http://www.kosaka-lab.com/tips/2009/02/wii-raw.html

WiiYourself!��Demo.cpp���(�󂵂����A��������B�t�^�H)

���̃Z�N�V�����ł́AWiiYourself!�t���f���̃\�[�X�R�[�h�uDemo.cpp�v��ǂ݁AWiiYourself!����������Ă���̂��������Ă����܂��傤�B���͂���Demo�������A��҂�gl.tter�����炪�F�߂�uWiiYourself!�B��̃h�L�������g�v�Ȃ̂ł�(�{��������)�B

�����ł́uWiiYourself! v.1.11 BETA�v�ɕt����Demo.cpp���R�����g�̖|��������ĉ�����܂��B�R�[�h�̑S���͂��ЍŐVWiiYourself!�ɓ�������Ă���Demo.cpp���Q�Ƃ��Ă��������B

s

Demo.cpp
// \
    _______________________________________________________________________________ \
//
//   - WiiYourself! - native C++ Wiimote library  v1.11 BETA
//    (c) gl.tter 2007-8 - http://gl.tter.org
//
// see License.txt for conditions of use. see History.txt for change log.
// \
    _______________________________________________________________________________ \
//
//  demo.cpp  (tab = 4 spaces)
#include "Demo.h"
#include "..\wiimote.h"
#include <mmsystem.h>  // for timeGetTime

// configs:
#define USE_BEEPS_AND_DELAYS // undefine to test library works without them
#define LOOK_FOR_ADDITIONAL_WIIMOTES // tries to connect any extra wiimotes

// \
    ------------------------------------------------------------------------------------ \
//  simple callback example (we use polling for everything else):
// \
    ------------------------------------------------------------------------------------ \
void on_state_change (wiimote &remote, state_change_flags changed)
  {
  // extension was just connected:
  // �g���[�q�����ܐڑ����ꂽ��c
  if(changed & EXTENSION_CONNECTED)
    {
#ifdef USE_BEEPS_AND_DELAYS
    Beep(1000, 200);
#endif
    // switch to a report mode that includes the extension data (we will
    //  loose the IR dot sizes)
    //���|�[�g���[�h���g���[�q�f�[�^���܂ރ��[�h�ɐ؂芷��
    //(��������ƐԊO���h�b�g�T�C�Y�������Ȃ��Ȃ�܂�)
    remote.SetReportType(wiimote::IN_BUTTONS_ACCEL_IR_EXT);
    }
  // extension was just disconnected:
  // �g���[�q���ؒf���ꂽ��A
  else if(changed & EXTENSION_DISCONNECTED)
    {
#ifdef USE_BEEPS_AND_DELAYS
    Beep(200, 300);
#endif
// use a non-extension report mode (this gives us back the IR dot sizes)
    // ��g���[�q���|�[�g���[�h���g���܂�(�ԊO���h�b�g�T�C�Y������)
    remote.SetReportType(wiimote::IN_BUTTONS_ACCEL_IR);
    }
  }
// \
    ------------------------------------------------------------------------------------ \
int _tmain ()
  {
  
  //�R���\�[���ւ̕\��������
  SetConsoleTitle(_T("- WiiYourself! - Demo: "));
  HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);

  // write the title
  BRIGHT_WHITE;
  _tprintf(_T("\n")); 
  _tprintf(_T("   -WiiYourself!- "));
  WHITE; _tprintf(       _T("library Demo:   "));
  CYAN;  _tprintf(               _T("| (c) "));
  BRIGHT_CYAN;  _tprintf(               _T("gl"));
  BRIGHT_PURPLE;_tprintf(                            _T("."));
  BRIGHT_CYAN;  _tprintf(                _T("tter"));
  CYAN; _tprintf(                        _T(" 2007-08\n")
       _T("                        v") WIIYOURSELF_VERSION_STR
                     _T(" | http://gl.tter.org\n"));
CYAN;_tprintf(_T(" \
    ______________________________________________________________________\n\n\n")); \

  // let's load a couple of samples:
  wiimote_sample sine_sample, daisy_sample;

  // one .raw (just to demonstrate it)
  //�X�s�[�J�p�T���v�����O�t�@�C���̃��[�h
  if(!wiimote::Load16BitMonoSampleRAW(_T("1kSine16 (3130).raw"),
                    true, FREQ_3130HZ, sine_sample)) {
_tprintf(_T("\r ** can't find 'Sine16 (3130).raw' - (sample won't work!) \
    **"));
    Beep(100, 1000);
    Sleep(3000);
    _tprintf(_T("\r") BLANK_LINE);
    }
  // and one (more convenient) .wav 
if(!wiimote::Load16bitMonoSampleWAV(_T("Daisy16 (3130).wav"), \
    daisy_sample)) {
_tprintf(_T("\r ** can't find 'Daisy16 (3130).wav' - (sample won't work!) \
    **"));
    Beep(100, 1000);
    Sleep(3000);
    _tprintf(_T("\r") BLANK_LINE);
    }


  // create a wiimote object
  //WiiYourself!�̃I�u�W�F�N�g(Wiimote)���쐬
  wiimote remote;
  
  // simple callback example (we use polling for almost everything here):
  //  notify us when something related to the extension changes
  //(�����ł́A�قƂ�ǑS�Ă̏������|�[�����O���g���Ă��܂��̂�)
  //�P���ȃR�[���o�b�N�̗�Ƃ��āA
  //�g���[�q�ɉ����N�����Ƃ��ɂ�΂��R�[���o�b�N���쐬���܂�
  remote.ChangedCallback     = on_state_change;
// avoid unwanted callback overhead by requesting only extension-related \
    data
  //�g���֌W�f�[�^�������ĂԎ��ŕs�v�ȃR�[���o�b�N�̃I�[�o�[�w�b�h��h���ł��܂�
  remote.CallbackTriggerFlags = EXTENSION_CHANGED;

  //�Đڑ�
reconnect:
  COORD pos = { 0, 6 };
  SetConsoleCursorPosition(console, pos);

  // try to connect the first available wiimote in the system
  //  (available means 'installed, and currently Bluetooth-connected'):
  //�uthe first available�v��WiiRemote��T���āA�ڑ������݂܂�
  //available�Ƃ́u�C���X�g�[������Ă��Č���Bluetooth�ڑ�����Ă���v�Ƃ����Ӗ�
  
  WHITE; _tprintf(_T("  Looking for a Wiimote     "));
     
  static const TCHAR* wait_str[] = { _T(".  "), _T(".. "), _T("...") };
  unsigned count = 0;
  while(!remote.Connect(wiimote::FIRST_AVAILABLE)) {
    _tprintf(_T("\b\b\b\b%s "), wait_str[count%3]);
    count++;
#ifdef USE_BEEPS_AND_DELAYS
    Beep(500, 30); Sleep(1000);  //�s�b�s�b�s...1�b���Ƃɉ���‚炵�Ă��܂�
#endif
    }

  // connected - light all LEDs
  // �‚Ȃ������̂őS�Ă�LED��_��
  remote.SetLEDs(0x0f);
  BRIGHT_CYAN; _tprintf(_T("\b\b\b\b... connected!"));
#ifdef USE_BEEPS_AND_DELAYS
  Beep(1000, 300); Sleep(2000);
#endif

  COORD cursor_pos = { 0, 6 };

#ifdef LOOK_FOR_ADDITIONAL_WIIMOTES
  // try to connect any additional wiimotes (just to show the code)
  //�lj���WiiRemote������ΐڑ�������(�ǂ��v���O���~���O���邩�������Ă��邾��)
  _tprintf(_T("\n\n"));
  
  //7��͂�����݌v
  wiimote  *extra_motes [7] = { NULL }; // 7 should cover it
  unsigned detected      = 0;
  while(detected < 7)
    {
    //�����ЂƂ�wiimote�I�u�W�F�N�g���쐬����FIRST_AVAILABLE�Őڑ�������
    wiimote *next = new wiimote;
    if(!next->Connect(wiimote::FIRST_AVAILABLE))
      break;
    extra_motes[detected++] = next;
    
    WHITE    ; _tprintf(_T("   also found wiimote "));
    BRIGHT_GREEN; _tprintf(_T("%u\n\n"), detected+1);
# ifdef USE_BEEPS_AND_DELAYS
    Beep(1000 + (detected*100), 100);
    Sleep(500);
# endif
    }
  WHITE; _tprintf( ((detected == 7)? _T("     (can't detect any more).") :
                     _T("    (no more found).")) );
# ifdef USE_BEEPS_AND_DELAYS
  Sleep(2000);
# endif
  // clean up
  //�s�v��WiiRemote�𐮗�
  for(unsigned index=0; index<detected; index++)
    delete extra_motes[index];
  
  SetConsoleCursorPosition(console, cursor_pos);
#endif // LOOK_FOR_ADDITIONAL_WIIMOTES

// ask the wiimote to report everything (using the 'non-continous updates'
// default mode - updates will be frequent anyway due to the \
    acceleration/IR
  //  values changing):
  //�unon-continous updates�v���g�����ƂŁAWiiRemote�ɑS�Ă����|�[�g������悤�₢���킹
  //�f�t�H���g���[�h:�X�V�͎����I�ɂȂ�B������ɂ�������x�Ƃ��ԊO���̒l���ς��Ƃ�

  // *note*: the report mode that includes the extension data unfortunately
// only reports the 'BASIC' IR info (ie. no dot sizes) - so let's choose
// the best mode based on the extension status (we also toggle modes
  //      as needed in the callback above):
  //[���L]�F�g���[�q�f�[�^���܂ރ��|�[�g���[�h�͎c�O�Ȃ���uBASIC�v�ԊO����񂵂��g���Ȃ�
  //(���Ƃ��΃h�b�g�̑傫���Ƃ�)�A�Ȃ̂Ŋg���[�q�̏�Ԃɂ���čœK�ȃ��[�h��I��ł�������
  //(��̃R�[���o�b�N�̒��ł��K�v�ȃ��[�h�������p���Ă��܂���)

  //�g���[�q�̏�Ԃɂ���ă��|�[�g�^�C�v��ݒ�
  //�g���[�q���g���Ƃ��͐ԊO���̃h�b�g�T�C�Y�͌����܂���
  if(remote.bExtension)
    remote.SetReportType(wiimote::IN_BUTTONS_ACCEL_IR_EXT); // no IR dots
  else
    remote.SetReportType(wiimote::IN_BUTTONS_ACCEL_IR);    //    IR dots

  // print the button event instructions:
  // �{�^���̎g������\��
  BRIGHT_WHITE;
_tprintf(_T("\r -- TRY: B = rumble, A = square, 1 = sine, 2 = daisy, Home = \
    Exit --\n"));

  // (stuff for animations)
  //timeGetTime()���‚����ĐU�����̃A�j���[�V�������쐬
  DWORD   last_rumble_time = timeGetTime(); // for rumble text animation
  DWORD    last_led_time    = timeGetTime(); // for led         animation
  bool   rumble_text    = true;
  unsigned lit_led          = 0;  
  
  // display the wiimote state data until 'Home' is pressed:
  // WiiRemote�̃X�e�[�g(���)���uHome�v�{�^�����������܂ŕ\������
  while(!remote.Button.Home())
    {
    // the wiimote state needs to be refreshed for each pass
    // WiiRemote�X�e�[�g�͖���"���t���b�V��"�����K�v������܂�
    while(remote.RefreshState() == NO_CHANGE)
    //�����ω����Ȃ������Ƃ���CPU��hog�����Ȃ��悤��
      Sleep(1); // // don't hog the CPU if nothing changed

    cursor_pos.Y = 8;
    SetConsoleCursorPosition(console, cursor_pos);

    // did we loose the connection?
    //�����ڑ������X�g������...
    if(remote.ConnectionLost())
      {
      BRIGHT_RED; _tprintf(
_T(" *** connection lost! *** \n")
        BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE
        BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE BLANK_LINE
        BLANK_LINE BLANK_LINE BLANK_LINE);
      Beep(100, 1000);
      Sleep(2000);
      COORD pos = { 0, 6 };
      SetConsoleCursorPosition(console, pos);
      _tprintf(BLANK_LINE BLANK_LINE BLANK_LINE);
      goto reconnect;
      }

    // rumble if 'B' (trigger) is pressed
    // �uB�v�{�^���������ƃo�C�u���[�^�[��U��������
    remote.SetRumble(remote.Button.B());

    // actions for buttons just pressed/released:
    // �{�^�����������/�������Ƃ�����actions���i�[����ϐ�
    static bool last_A = false, last_One = false, last_Two = false;
    //�{�^����actions�������}�N��
    #define ON_PRESS_RELEASE(button, pressed_action, released_action)  \
      { bool pressed = remote.Button.button();            \
        if(pressed)                          \
         {           /* just pressed? */            \
        if(!last_##button) pressed_action;              \
        }                              \
      else if(last_##button) /* just released */            \
        released_action;                      \
      /* remember the current button state for next time */      \
      last_##button = pressed; }
    //���݂̃{�^���X�e�[�g������̂��߂ɕێ�����
    //���܉����ꂽ�̂��A�����ꂽ�̂��A�������ςȂ��Ȃ̂ł��̂��Ɨ������̂�
    //���������if���ŏ����̂�����Ȃ̂Łulast_##button�v�Ƃ��āA
    //ON_PRESS_RELEASE�}�N���ł܂Ƃ߂Ă��܂��B
    
    //  play audio whilst certain buttons are held
    //  ���ꂼ��̃{�^�����z�[���h���ꂽ�Ƃ��̉����t�@�C���Đ���whilst
    // ��`�g����
    ON_PRESS_RELEASE(  A, remote.PlaySquareWave(FREQ_3130HZ, 0x20), 
                remote.EnableSpeaker (false));
    //�T�C���g�T���v�����O����
    ON_PRESS_RELEASE(One, remote.PlaySample     (sine_sample),
                remote.EnableSpeaker (false));
    //DAISY���T���v�����O����
    ON_PRESS_RELEASE(Two, remote.PlaySample     (daisy_sample),
                remote.EnableSpeaker (false));


    // �o�b�e���[���x��
    // Battery level:
    CYAN; _tprintf(_T("  Battery: "));
    // (the green/yellow/red colour ranges are rough guesses - my wiimote
    //  with rechargeable battery pack fails at around 15%)
    // ��/��/�ԂɃJ���[�����W�𐄒�
    // (����WiiRemote�̏[�d�o�b�e���[�p�b�N�ł�15%�ŗ�����)
    if     (remote.BatteryPercent >= 30) BRIGHT_GREEN;
    else if(remote.BatteryPercent >= 20) BRIGHT_YELLOW; else BRIGHT_RED;
    _tprintf(_T("%3u%%   "), remote.BatteryPercent);

    DWORD current_time = timeGetTime();
    
    // LED�A�j���[�V������1�b���ƍĐ�
    // LEDs:
    //  animate them every second
    if((current_time - last_led_time) >= 1000) { //1�b�o��
      remote.SetLEDs((BYTE)(1<<lit_led));     //�r�b�g�V�t�g���Z:[0001]��0-3�r�b�g���Ɉړ�
      lit_led      = (++lit_led) % 4;    //�]��
      last_led_time = timeGetTime();
      }

    CYAN; _tprintf(_T("LEDs: ")); WHITE; _tprintf(_T("["));
    for(unsigned led=0; led<4; led++)
      {
      if(remote.LED.Lit(led)) {
        BRIGHT_CYAN; _tprintf(_T("*"));
        }
      else{
        WHITE      ; _tprintf(_T("-"));//_T("%c"), '0'+led);
        }
      }

    // �o�C�u���[�^�[
    // Rumble
    WHITE; _tprintf(_T("]    "));
    if(remote.bRumble) {
      BRIGHT_WHITE; _tprintf(rumble_text? _T(" RUMBLE") : _T("RUMBLE "));
      // animate the text
      if((current_time - last_rumble_time) >= 110) {
        rumble_text     = !rumble_text;
        last_rumble_time = current_time;
        }
      }
    else
      _tprintf(_T("       "));

    // ���݂�HID�ւ̏o�̓��[�h��\��
    // Output method:
      CYAN; _tprintf( _T("    using %s\n"), (remote.IsUsingHIDwrites()?
                         _T("HID writes") : _T("WriteFile()")));
    //�{�^������
    // Buttons:
    CYAN; _tprintf(_T("\n  Buttons: ")); WHITE; _tprintf(_T("["));
    for(unsigned bit=0; bit<16; bit++)
      {
      WORD mask = (WORD)(1 << bit);
      // skip unused bits
      if((wiimote_state::buttons::ALL & mask) == 0)
        continue;

      const TCHAR* button_name = wiimote::ButtonNameFromBit[bit];
      bool     pressed   = ((remote.Button.Bits & mask) != 0);
      if(bit > 0) {
        CYAN; _tprintf(_T("|")); // seperator
        }
      if(pressed) {
        BRIGHT_WHITE; _tprintf(_T("%s")  , button_name);
        }
      else{
        WHITE       ; _tprintf(_T("%*s"), _tcslen(button_name), _T(""));
        }
      }
    WHITE; _tprintf(_T("]\n"));

    // �����x�Z���T�[
    // Acceleration:
    CYAN ; _tprintf(_T("    Accel:"));
    WHITE; _tprintf(_T("  X %+2.3f  Y %+2.3f  Z %+2.3f  \n"),
            remote.Acceleration.X,
            remote.Acceleration.Y,
            remote.Acceleration.Z);
  
    // ��������(�Ō�̓K���Ȓl���玞�Ԃ��o���Ă���Ȃ�Ԃŕ\��)
    // Orientation estimate (shown red if last valid update is aging):
    CYAN ; _tprintf(_T("   Orient:"));
    WHITE; _tprintf(_T("  UpdateAge %3u  "),
            remote.Acceleration.Orientation.UpdateAge);
    // �Ō�̕����X�V�����Ԑ؂�Ɣ��f�����
    //  show if the last orientation update is considered out-of-date
    //   (using an arbitrary threshold)
    if(remote.Acceleration.Orientation.UpdateAge > 10)
      RED;
      
    _tprintf(_T("Pitch %4ddeg  Roll %4ddeg  \n")
_T(" (X %+.3f Y %+.3f Z %+.3f) \n"),
         (int)remote.Acceleration.Orientation.Pitch,
         (int)remote.Acceleration.Orientation.Roll ,
         remote.Acceleration.Orientation.X,
         remote.Acceleration.Orientation.Y,
           remote.Acceleration.Orientation.Z);
        
    // IR:
    CYAN ; _tprintf(_T("       IR:"));
    WHITE; _tprintf(_T("  Mode %s  "),
      ((remote.IR.Mode == wiimote_state::ir::OFF     )? _T("OFF  ") :
       (remote.IR.Mode == wiimote_state::ir::BASIC   )? _T("BASIC") :
       (remote.IR.Mode == wiimote_state::ir::EXTENDED)? _T("EXT. ") :
                                _T("FULL ")));
// IR dot sizes are only reported in EXTENDED IR mode (FULL isn't supported \
    yet)
    bool dot_sizes = (remote.IR.Mode == wiimote_state::ir::EXTENDED);

    for(unsigned index=0; index<4; index++)
      {
      wiimote_state::ir::dot &dot = remote.IR.Dot[index];
      
      WHITE;_tprintf(_T("%u: "), index);

      if(dot.bVisible) {
        WHITE; _tprintf(_T("Seen       "));
        }
      else{
        RED  ; _tprintf(_T("Not seen   "));
        }

      _tprintf(_T("Size"));
      if(dot_sizes)
         _tprintf(_T("%3d "), dot.Size);
      else{
        RED; _tprintf(_T(" n/a"));
        if(dot.bVisible) WHITE;
        }

      _tprintf(_T("  X %.3f  Y %.3f\n"), dot.X, dot.Y);
      
      if(index < 3)
        _tprintf(_T("                        "));
      }

    // Speaker:
    CYAN ; _tprintf(_T("  Speaker:"));
    WHITE; _tprintf(_T("  %s | %s    "),
                  (remote.Speaker.bEnabled? _T("On ") :
                                _T("Off")),
                  (remote.Speaker.bMuted  ? _T("Muted") :
                                _T("     ")));
    if(!remote.Speaker.bEnabled || remote.Speaker.bMuted)
      RED;
    else//if(remote.IsPlayingAudio()) BRIGHT_WHITE; else WHITE;
      WHITE;
    _tprintf(_T("Frequency %4u Hz   Volume 0x%02x\n"),
         wiimote::FreqLookup[remote.Speaker.Freq],
         remote.Speaker.Volume);
    
    // -- Extensions --:
    CYAN ; _tprintf(_T("__________\n  Extnsn.:  "));
    switch(remote.ExtensionType)
      {
      case wiimote_state::NONE:
        {
        RED;
_tprintf(_T("None \n"));
        _tprintf(BLANK_LINE BLANK_LINE BLANK_LINE);
        }
        break;
      
      case wiimote_state::PARTIALLY_INSERTED:
        {
        BRIGHT_RED;
_tprintf(_T("Partially Inserted \n"));
        _tprintf(BLANK_LINE BLANK_LINE BLANK_LINE);
        }
        break;
      
      // -- Nunchuk --
      case wiimote_state::NUNCHUK:
        {
        BRIGHT_WHITE; _tprintf(_T("Nunchuk   "));

        // Buttons:
        CYAN    ; _tprintf(_T("Buttons: ")); WHITE; _tprintf(_T("["));
        BRIGHT_WHITE; _tprintf(remote.Nunchuk.C? _T("C") : _T(" "));
        CYAN    ; _tprintf(_T("|"));
        BRIGHT_WHITE; _tprintf(remote.Nunchuk.Z? _T("Z") : _T(" "));
        WHITE    ; _tprintf(_T("]   "));
        // Joystick:
        CYAN    ; _tprintf(_T("Joystick:  "));
        WHITE    ; _tprintf(_T("X %+2.3f  Y %+2.3f\n"),
                     remote.Nunchuk.Joystick.X,
                     remote.Nunchuk.Joystick.Y);
        // Acceleration:
        CYAN    ; _tprintf(_T("    Accel:"));
        WHITE    ; _tprintf(_T("  X %+2.3f  Y %+2.3f  Z %+2.3f  \n"),
                     remote.Nunchuk.Acceleration.X,
                     remote.Nunchuk.Acceleration.Y,
                     remote.Nunchuk.Acceleration.Z);
        
        // Orientation estimate (shown red if last valid update is aging):
        CYAN    ; _tprintf(_T("   Orient:"));
        WHITE    ; _tprintf(_T("  UpdateAge %3u  "),
                remote.Nunchuk.Acceleration.Orientation.UpdateAge);
        //  show if the last orientation update is aging
        if(remote.Nunchuk.Acceleration.Orientation.UpdateAge > 10)
          RED;
        _tprintf(_T("Pitch %4ddeg  Roll %4ddeg  \n")
_T(" (X %+.2f Y %+.2f Z %+.2f) \n"),
             (int)remote.Nunchuk.Acceleration.Orientation.Pitch,
             (int)remote.Nunchuk.Acceleration.Orientation.Roll ,
             remote.Nunchuk.Acceleration.Orientation.X,
             remote.Nunchuk.Acceleration.Orientation.Y,
               remote.Nunchuk.Acceleration.Orientation.Z);
        }
        break;

      // -- Classic Controller --
      case wiimote_state::CLASSIC:
      case wiimote_state::CLASSIC_GUITAR:
        {
        BRIGHT_WHITE;
        // the Guitar Hero controller is just a classic controller with
        //  another ID
        if(remote.ExtensionType == wiimote_state::CLASSIC_GUITAR)
          _tprintf(_T("Guitar Hero Contrl.  "));
        else
          _tprintf(_T("Classic Controller   "));
        
        // L: Joystick/Trigger
        WHITE; _tprintf(_T("L:  "));
        CYAN ; _tprintf(_T("Joy "));
        WHITE; _tprintf(_T("X %+2.3f  Y %+2.3f  "),
                remote.ClassicController.JoystickL.X,
                remote.ClassicController.JoystickL.Y);
        CYAN ; _tprintf(_T("Trig "));
        WHITE; _tprintf(_T("%+2.3f\n"),
                remote.ClassicController.TriggerL);
        // R: Joystick/Trigger
        WHITE; _tprintf(_T("                                 R:  "));
        CYAN ; _tprintf(_T("Joy "));
        WHITE; _tprintf(_T("X %+2.3f  Y %+2.3f  "),
                remote.ClassicController.JoystickR.X,
                remote.ClassicController.JoystickR.Y);
        CYAN ; _tprintf(_T("Trig "));
        WHITE; _tprintf(_T("%+2.3f\n"),
                remote.ClassicController.TriggerR);

        // Buttons:
        CYAN; _tprintf(_T("  Buttons: ")); WHITE; _tprintf(_T("["));
        for(unsigned bit=0; bit<16; bit++)
          {
          WORD mask = (WORD)(1 << bit);
          // skip unused bits
          if((wiimote_state::classic_controller::buttons::ALL & mask) == 0)
            continue;

const TCHAR* button_name = wiimote::ClassicButtonNameFromBit[bit];
          const TCHAR* seperator   = (bit==0)? _T("") : _T("|");
bool pressed = ((remote.ClassicController.Button.Bits & mask) != 0);
          CYAN; _tprintf(seperator);
          if(pressed) {
            BRIGHT_WHITE; _tprintf(_T("%s")  , button_name);
            }
          else{
            WHITE  ; _tprintf(_T("%*s"), _tcslen(button_name), _T(""));
            }
          }
        WHITE; _tprintf(_T("]"));
        }
        break;

      case wiimote_state::BALANCE_BOARD:
        {
        BRIGHT_WHITE; _tprintf(_T("Balance Board"));

        // Buttons:
        CYAN ; _tprintf(_T("   Weight: "));
        WHITE; _tprintf(_T("TL    "));
             _tprintf(_T("%2.2f"), remote.BalanceBoard.Kg.TopL);
        CYAN ; _tprintf(_T(" kg")); WHITE; ;_tprintf(_T("  TR "));
             _tprintf(_T("%2.2f"), remote.BalanceBoard.Kg.TopR);
        CYAN;  _tprintf(_T(" kg\n")); WHITE;
             _tprintf(_T("                                    BL    "));
             _tprintf(_T("%2.2f"), remote.BalanceBoard.Kg.BottomL);
        CYAN;  _tprintf(_T(" kg")); WHITE; _tprintf(_T("  BR "));
             _tprintf(_T("%2.2f"), remote.BalanceBoard.Kg.BottomR);
        CYAN;  _tprintf(_T(" kg \n")); WHITE;
             _tprintf(_T("                                    Total "));
             _tprintf(_T("%2.2f"), remote.BalanceBoard.Kg.Total);
        CYAN;  _tprintf(_T(" kg"));
        }
        break;
      }
      }


// disconnect (auto-happens on wiimote destruction anyway, but let's play \
    nice)
  remote.Disconnect();
  Beep(1000, 200);

  BRIGHT_WHITE; // for automatic 'press any key to continue' msg
  CloseHandle(console);

  return 0;
  }
// \
    ------------------------------------------------------------------------------------ \
// \
    ------------------------------------------------------------------------------------ \

Wiiyourself!��DirectX�ō��3DCG�ł̗��p

�͂��߂�

�{�͂ł́AC++���g���ĕ����G���W�����C�u������WiiRemote��g�ݍ��킹��3DCG�`��v���O���������܂��B

�����G���W���Ƃ́A�O���t�B�b�N�X�ƘA�g���āA���̂̏Փ˂�j��A�d�͂▀�C�A�����Ȃǂ̗͊w�I�Ȍv�Z�����Ă����֗��ȃ��C�u�����ł��B�ŋ߂̓R���s���[�^�[�̑��x�������ɂȂ��Ă������Ƃ�����A���G�ȕ��������A���^�C��(������)�����ł���悤�ɂȂ��Ă��܂����B���p�̂��̂ł́A�uHavok�v��uPhysX�v�ƌ��������̂�����A�Q�[�����i�Ȃǂɑg�ݍ��܂�Ă��܂��B�I�[�v���\�[�X�̂��̂ł́A�uOpen Dynamics Engine(ODE)�v��uBullet�v�Ƃ��������̂��L���ł����A�{�͂ł́A���̒��ł��I�[�v���\�[�X�́uBullet�v�Ƃ������C�u�������Љ�܂��B

�uBullet�v�ł�OpenGL(GLUT)���g�p�����f������������Ă��܂����A�{�͂ł́A�uBullet�v�ƁuDirectX�v�A�uWiiYourself!�v���g���āA�����{3DCG�{WiiRemote��g�ݍ��킹���C���^���N�e�B�u�ȃv���O�������J�����܂�(���M���́F"shader.jp" masafumi��)�B

Bullet Physics Library

Bullet�Ƃ�

Bullet Physics Library��ZLib���C�Z���X�̃I�[�v���\�[�X�����G���W���ł��B�I�[�v���\�[�X�̂��ߖ����ŗ��p���邱�Ƃ��ł��AWindows�AMac�ALinux�APlayStation 3�AXbox 360�AWii�ȂǗl�X��OS��v���b�g�t�H�[���Ŏg����悤�ɂȂ��Ă��܂��BBullet�ł́A���̓��m�̏Փˏ�����A�W���C���g�A�z�⃍�[�v�̂悤�ȃ\�t�g�{�f�B�Ȃǂ̃Q�[�����ł̕����̏������s���Ă���܂��B

Bullet�̃T���v���̉��

Bullet�̏���

Bullet��SDK�́A�����T�C�g�̕�����_�E�����[�h���ł��܂��B�{���̎��M�i�K�ł́A�ŐV�ł̓o�[�W����2.74�ɂȂ�܂��B

Bullet�����T�C�g

http://www.bulletphysics.com/

Bullet�̌����T�C�g(���ŐV�ł͂Ȃ�)

Bullet��SDK�́AZIP���k���ꂽ�A�[�J�C�u�ɂȂ��Ă��܂��B�C���X�g�[���`���ł͂Ȃ��̂ŁA������HDD�̔C�ӂ̏ꏊ�ɓW�J����K�v������܂��B�{���ł́A���L�̂悤��C�h���C�u�̒����ɓW�J�������̂Ƃ��Ęb��i�߂܂��B

C:\bullet-2.74

Bullet SDK�̓W�J���o���܂�����ŏ��ɂ�邱�Ƃ̓��C�u�����̃r���h�ɂȂ�܂��B"C:\bullet-2.74\msvc"�Ƃ����t�H���_�ɐ}3�̂悤�ɔz�u����Ă��܂��B6�`8�܂ł̃t�H���_������܂����A�\1�̂悤��Visual Studio�̃o�[�W�����ɑΉ��������̂ɂȂ��Ă��܂��B6�`8�̊e�t�H���_�ɂ́AVisual C++ 6.0�̃��[�N�X�y�[�X����Visual C++ 2005�܂ł̃\�����[�V����������܂��BVisual C++ 2008�̃\�����[�V�����͕t�����Ă��܂��񂪁AVisua C++ 2005�̂��̂ł���8���R���o�[�g���邱�Ƃŗ��p���邱�Ƃ��ł��܂��B

Visual Studio�����̃v���W�F�N�g(���ŐV�ł͂Ȃ�)
Visual Studio�̃o�[�W�����ƑΉ�����t�H���_
�t�H���_�� �Ή�����Visual Studio / Visual C++
6 Visual Studio 6.0 / Visual C++ 6.0
7 Visual Studio .NET / Visual C++ .NET
71 Visual Studio .NET 2003 / Visual C++ .NET 2003
8 Visual Studio 2005 / Visual C++ 2005

msvc�t�H���_�̒��ɂ́ABullet�Ŏg�����C�u�����̂��߂̃\�����[�V�����t�@�C���̑��ɁA�T���v���v���O�����̃\�����[�V�����t�@�C���Ȃǂ�����܂��B���C�u�������r���h����ɂ�wksbullet.sln���J���܂�(Visual C++ 6.0�ȊO)�B

�ŐV��Visual Studio 2008���g���Ă���ꍇ�ɂ́A�u8�v���Ȃ킿VC2005�̃v���W�F�N�g���R���o�[�g���Ă���g���܂��B�u8�v�̃t�H���_���R�s�[���āu9�v�Ɩ��O��ς��Ă����܂��傤�BVisual Studio 2008���N�����ăR�s�[�����uwksbullet.sln�v���J�����ƂŁA�E�B�U�[�h���N�����A�R���o�[�g�ł��܂��B��������̃v���W�F�N�g������܂����A�uapp�`�v�Ǝn�܂���̂̓T���v���v���O�����̃v���W�F�N�g�Łulib�`�v�Ŏn�܂���̂̓��C�u�����̃t�@�C���ɂȂ�܂��B�K�v�Ȃ̂̓��C�u�����Ȃ̂ŁAlib�`�Ŏn�܂�v���W�F�N�g�Ɋւ��Ă��ׂ�Debug��Release�Ńr���h���Ă����܂��B

�r���h���I����"C:\bullet-2.72\out"�Ƃ����t�H���_�Ƀ��C�u�������r���h����܂��BVisual Studio 2005�iVisual Studio 2008�łɍX�V�����ꍇ���j�ł̃r���h�ł���΁Adebug8��release8�̂悤�ȃt�H���_���쐬����Ă���A���̉���libs�Ƃ����t�H���_������A�����Ƀr���h���ďo�������C�u����������܂��B���C�u�������r���h�ł��Ă���΃��C�u�����̏����͊����ł��B

DirectX SDK�̃Z�b�g�A�b�v

DirectX SDK�̓���

�{���ł́A3D�̕`����s�����߂�DirectX�𗘗p���܂��BDirectX���g�����v���O������g�ނ��߂ɂ́AMicrosoft�̃T�C�g����SDK���_�E�����[�h���Ă��܂��BMicrosoft��DirectX�̊J���Ҍ����̃T�C�g�͓��{��̂��̂Ɖp��̂��̂�����܂��BMicrosoft�̓A�����J�̊�Ƃ̂��߉p��̕����ŐV�̏�񂪎�ɓ���܂��B

DirectX�̊J���Ҍ����T�C�g���{��http://www.microsoft.com/japan/msdn/directx/

�p��http://msdn.microsoft.com/en-us/directx/default.aspx

SDK�͊J���Ҍ����T�C�g�̕�����_�E�����[�h���邱�Ƃ��o���܂��BDirectX SDK�͐��������ƂɃo�[�W�������X�V����邽�߁ADirectX SDK August 2008�̂悤�ɁA���A�N�����O�ɓ���܂��B�{�����M�i�K�ł�Augst 2008���ŐV�̃o�[�W�����ɂȂ�܂��B�{���ł͂��̃o�[�W���������ɃT���v�����쐬���Ă��܂��B

�C���X�g�[��

DirectX SDK�̓C���X�g�[���`���ɂȂ��Ă��邽�߃Z�b�g�A�b�v�͊ȒP�ɍs�����Ƃ��o���܂��BVisual Studio 2005�ȍ~�𗘗p���Ă���ꍇ�ɂ́A�C���N���[�h�t�@�C���⃉�C�u�����t�@�C���̃p�X�Ȃǂ̐ݒ���C���X�g�[���������ōs���Ă���܂��B

DXUT�t���[�����[�N���g����Direct3D�̃v���O����

DirectX��SDK�ɂ́ADXUT�ƌĂ΂��N���X���C�u�������t�����Ă��܂��B���̃��C�u�����ł́AWindows�̐����}�E�X�A�L�[�{�[�h�������e��R�[���o�b�N�֐���A3DCG�̃��f���f�[�^��ǂݍ���ŕ\������N���X���ʏ�Ƀ{�^����e�L�X�g�{�b�N�X�Ȃǂ�GUI��\������N���X�Ȃǂ��p�ӂ���Ă��܂��B����̃T���v���ł́A���������֗��ȃ��C�u�������g����DirectX�̃��f���`���ł���X�t�@�C����ǂݍ���ŕ\�����Ă݂܂��B���̏͂̃v���O�����́ADirectX SDK�ɕt������SimpleSample(�}4)���x�[�X�ɍ���Ă����܂��BSimpleSample�́ADirectX SDK�ɕt������DirectX Sample Browser�i�}5�j��I������Insrall Project��I������ƃZ�b�g�A�b�v�ł��܂��B

SimpleSample
DirectX Sample Browser

DXUT���g�����v���O�����̍\��

PC��3D��\�����邽�߂̃��C�u�����ɂ͍���Љ��DirectX�̑���OpenGL������܂��BOpenGL�ł́A�N���X�v���b�g�t�H�[����3D���C�u�����̂���DirectX�ƈقȂ�l�X��OS��v���b�g�t�H�[����Ŏg�����Ƃ��o���܂��B�������A���ۂ̃A�v���P�[�V�����J���ɂ����ẮAOpenGL�ȊO�̕����̃v���O�����ɂ‚��Ă�OS��v���b�g�t�H�[���Ɉˑ������R�[�h�������Ȃ��ƍs���Ȃ����Ƃ������ł��B���Ƃ��΁AWindows��Mac OS X�ł��ꂼ��E�B���h�E��\������v���O�������ꍇ�ɂ́A�eOS�ɉ������R�[�h�������܂��B��������OS�Ԃ̊�{�I�ȕ����ł̍��ق��z�����Ă���郉�C�u�����Ƃ���GLUT�Ƃ������C�u����������܂��BGLUT�ł́A�E�B���h�E�̐�����}�E�X�A�L�[�{�[�h�Ȃǂ̏�����`��p�̊֐����ȒP�ɐݒ肵�Ďg�����Ƃ��o���܂��B������ƑO�u���������Ȃ�܂������ADXUT��OpenGL�ł���GLUT�̊֌W�ɋ߂����C�u�����ŁADirectX���g�����v���O�����ɂ����ėl�X�ȏ�����⏕���Ă���郉�C�u�����ɂȂ��Ă��܂��B�{���ł́A����DXUT���g���Ă���y��DirectX�̃v���O���������܂��BDXUT��GLUT�ɋ߂��Ə����܂������AGLUT�ł̓}�E�X��L�[�{�[�h�A�`��֐��Ȃǂ̃C�x���g�����O�Ɋ֐��ŃZ�b�g���Ă����̂ł����ADXUT�ł�����ɋ߂��d�g�݂ɂȂ��Ă��܂��BDXUT�ł́A�}�E�X��L�[�{�[�h������`��֐��Ȃǂ͍ŏ��ɃR�[���o�b�N�֐����`���ăZ�b�g���܂��B���ۂɁASimpleSample�̃R�[�h�����Ă݂܂��B

wWinMain
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR \
    lpCmdLine, int nCmdShow )
{
    // Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    // DXUT will create and use the best device (either D3D9 or D3D10)
// that is available on the system depending on which D3D callbacks are set \
    below

    // Set DXUT callbacks
    DXUTSetCallbackMsgProc( MsgProc );
    DXUTSetCallbackKeyboard( OnKeyboard );
    DXUTSetCallbackFrameMove( OnFrameMove );
    DXUTSetCallbackDeviceChanging( ModifyDeviceSettings );

    DXUTSetCallbackD3D9DeviceAcceptable( IsD3D9DeviceAcceptable );
    DXUTSetCallbackD3D9DeviceCreated( OnD3D9CreateDevice );
    DXUTSetCallbackD3D9DeviceReset( OnD3D9ResetDevice );
    DXUTSetCallbackD3D9DeviceLost( OnD3D9LostDevice );
    DXUTSetCallbackD3D9DeviceDestroyed( OnD3D9DestroyDevice );
    DXUTSetCallbackD3D9FrameRender( OnD3D9FrameRender );

    InitApp();
DXUTInit( true, true, NULL ); // Parse the command line, show msgboxes on \
    error, no extra command line params
    DXUTSetCursorSettings( true, true );
    DXUTCreateWindow( L"SimpleSample" );
    DXUTCreateDevice( true, 640, 480 );
    DXUTMainLoop(); // Enter into the DXUT render loop

    return DXUTGetExitCode();
}

DXUT�̃��C�u�����Ɋ܂܂��֐��̖��O�ɂ́ADXUT�̐ړ��ꂪ�‚��܂��BDXUTSet�`()�ł́A�}�E�X��L�[�{�[�h�A�`��A�A�v���P�[�V�����̏I���ȂNJe��̃C�x���g�ɑΉ������R�[���o�b�N�֐��̃Z�b�g���s���܂��B����g���Ă�����̂ɂ‚��Ă͈ȉ��̕\2�ɂ܂Ƃ߂Ă����܂��B

�\2�R�[���o�b�N�֐��̎�ރR�[���o�b�N�֐����Z�b�g����֐��C�x���g�̓��eDXUTSetCallbackMsgProc�E�B���h�E�̃��b�Z�[�W����������DXUTSetCallbackKeyboard�L�[�{�[�h�̓��͂���������DXUTSetCallbackFrameMove���t���[���Ăяo����鏈��DXUTSetCallbackDeviceChanging Direct3D�f�o�C�X�ɉ��炩�̕ύX���������Ƃ������������DXUTSetCallbackD3D9DeviceAcceptable Direct3D�f�o�C�X���A�w�肵�����[�h�ŋN�����邩�ǂ������`�F�b�N����ۂɎg������DXUTSetCallbackD3D9DeviceCreated Direct3D�f�o�C�X�̐������ɌĂяo����鏈��DXUTSetCallbackD3D9DeviceReset Direct3D�f�o�C�X�̃��Z�b�g���ɌĂяo����鏈��DXUTSetCallbackD3D9DeviceLost Direct3D�f�o�C�X�����X�g�������ɌĂяo����鏈��DXUTSetCallbackD3D9DeviceDestroyed Direct3D�f�o�C�X���j�������ꍇ�ɌĂяo����鏈��DXUTSetCallbackD3D9FrameRender�`�揈�����s��DXUTSetCallbackMouse�}�E�X�̏������s���֐��i��̃T���v���ł͗��p���Ă܂���j�B

�R�[���o�b�N�֐��̃Z�b�g��ɂ́ADXUT�̊e��֐����Ăяo����܂��B�֐��̖����͕\3�ł��B

�֐��������̓��eDXUTInit DXUT�̏���������DXUTSetCursorSettings�J�[�\���̕\���Ɋւ��Đݒ肷��֐�DXUTCreateWindow�E�B���h�E�̐���DXUTCreateDevice Direct3D�f�o�C�X�̐���DXUTMainLoop���C�����[�v�̌Ăяo��DXUTGetExitCode�I������

X�t�@�C���̕`��N���X

DirectX�ɂ́AX�t�@�C��(�g���q.x)�Ƃ���3D���f���f�[�^�̌`��������܂��B���̃f�[�^�́A3D���f�����O�\�t�g���g�����Ƃō쐬���邱�Ƃ��o���܂��B���f�����O�\�t�g�́A3ds Max��Maya�ASoftimage XSI�Ȃǂ̃\�t�g����\�I�ł����A�����̃\�t�g�E�F�A�͌l�����‚ɂ͑�ύ����ł��B�l�ł���y�Ɏ�ɓ����\�t�g�E�F�A�ł́A���^�Z�R�C�A�i�V�F�A�E�F�A�ł����A�����ł�����܂��j��Blender�i�����j�Ƃ��������̂�����܂��BDXUT�̃N���X�̒��ɂ́AX�t�@�C����ǂݍ���ŕ`�悷��N���X���p�ӂ���Ă��܂��B����́A���ꂪ�֗��Ȃ̂ł�����g���Ă����܂��BDXUT��X�t�@�C���`��N���X�𗘗p���邽�߂ɂ́A�v���W�F�N�g��2�‚̃t�@�C����lj�����K�v������܂��B���̃t�@�C����SDKmesh.h��SDKmesh.cpp�ɂȂ�܂��B���̃t�@�C����DXUT�t�H���_������Optional�Ɋ܂܂�Ă��܂��BVisual Studio��ŁA�\�����[�V�����G�N�X�v���[����DXUT�t�H���_���E�N���b�N���āy�lj�(D)�z�́y��������(G)...�z��I�����Ēlj����܂��BX�t�@�C����`�悷��N���X�͂��̒lj������w�b�_�[�t�@�C���Ɋ܂܂�Ă���CDXUTXFileMesh�N���X���g���܂��B

SDKmesh.h��SDKmesh.cpp�̒lj�

�EX�t�@�C���EX�t�@�C���̓ǂݍ���X�t�@�C���̓ǂݍ��݂���`��܂ł́A�O�q��CDXUTXFileMesh�N���X���g���܂��B

4.3�����ł����������v���O�����́A�}x�̂悤�ɂȂ�܂��BDXUT�ŗe�Ղ�r�Ă���N���X���g���Ƃƌ����݂ƍs��̃Z�b�g�����ŊȒP�ɕ`��ł����B

�V���v����DirectX��Bullet�̃v���O����

�����ł͑O�͂�DirectX�̃v���O�����ɕ����G���W���̃R�[�h�������ĕ��̂��Փ˂����蒵�˕Ԃ����肷��V���v���ȃv���O������������܂��B

6.1 Bullet��g�ݍ��ޑO�̏͂ŁADXUT���g����X�t�@�C���̃��f����\������v���O�����̉�������܂����B���̏͂ł́A�O�͂̃T���v�����x�[�X��Bullet�̃v���O������g�ݍ����3DCG�ɏՓˏ����Ȃǂ��������܂��B

6.2 Bullet�𗘗p���鏀��2.2��Bullet SDK���烉�C�u�������r���h���܂����B������v���W�F�N�g�ɒlj����܂��B�V���ɒlj����郉�C�u�����͉��L�ł��B

�EDebug�r���h��libbulletdynamics_d.lib libbulletcollision_d.lib libbulletmath_d.lib

�ERelase�r���h��libbulletdynamics.lib libbulletcollision.lib libbulletmath.lib

Debug�r���h�łɂ́A�u_d�v���t���܂��B

6.3 Bullet�̏�����

6.4���̂̓o�^

6.4.1�n�ʂ̒�`

6.4.2���̍��̂�

6.4.3�{�b�N�X�̓o�^

6.5�`��R�[�h

6.6�I������

7.WiiRemote���g�����T���v�����̏͂ł́A�O�͂̕����ɉ����Ă��悢��WiiRemote��g�ݍ��񂾏�����������܂��B

7.1 WiiYourSelf !�̏���WiiRemote������̃v���O�����ɑg�ݍ��ނ��߂̃��C�u������\�t�g�E�F�A�ɂ‚��ėl�X�Ȃ��̂����J����Ă��܂��B����́AC++���痘�p�ł���WiiYourSelf !�𗘗p���܂��B

7.2 WiiYourSelf !�̑g�ݍ���

7.�Z���T�o�[���g����Pick�v���O����

7.1�Z���T�o�[�̗��p7.2 Pick�����̎���

8.WiiRemote�ƕ����G���W�����g�����~�j�Q�[��

8.1�~�j�Q�[�������

���R�����FVirtools(3DVia)+WiiRemote

CAD(Computer Aided Design)��3DStudioMax�Ȃǂ�3D�f�[�^����A�C���^���N�e�B�u��3D�O���t�B�b�N�X�A�v���P�[�V�����𐧍�ł���c�[���ɁuVirtools(���@�[�c�[���X)�v������܂�(http://www.virtools.com/)�B���E�ő��CAD���[�J�[�A�t�����X�u�_�b�\�[�V�X�e���Y(Dassault Systemes)�v�̃O���[�v�ŁA�ŋ߂ł́u3dvia�v�Ƃ����u�����h�œW�J����Ă��܂��B

Virtools�͍����ȎY�ƌ������i�ł��邱�Ƃ�����A���{�ł͂���قǗL���ł͂���܂��񂪁A���Ăł͍ł����p����Ă���Ž����v���b�g�t�H�[���ł�(�M�҂��t�����X�ł͓���I�Ɏg���Ă��܂����I)�B���f����摜�Ȃǂ̃��\�[�X��GUI�����łقƂ�ǂ̃C���^���N�e�B�u�f�U�C���֌W�����Ă��܂��A�Ƃ����_������I�ŁA�v���O���~���O�s�v�ł��B�������[���J��������ꍇ�̓v���O���~���O���K�v�ł����A�����_���[��v���O�C���ȂǂقƂ�ǂ̃\�[�X�͌��J����Ă��܂��B

�Y�Ɨp��CAD�f�[�^����AVirtools���g����Web��Ō��J�����C���^���N�e�B�u�ȏ��i�L���̊J���A�v���g�^�C�v���i�̃��[�U�����Ȃǂ��J�����邱�Ƃ��ł��܂����A���Ƃ���Virtools�̓Q�[���p�v���g�^�C�s���O�c�[���ł����B�Q�[���J���̃v���g�^�C�v�A�‚܂�Q�[���̗����ʔ����̍����Ɋւ�镔���̐݌v���v�����i�[��GUI�ōs���āA�ŏI�H���ł���œK����v���b�g�t�H�[���̓Ǝ������Ȃǂ��v���O���~���O�ōs���A�Ƃ������Q�[���J����@�ł��B

Virtools�͌����Ƀ��C�Z���X���󂯂��c�[���J���p�[�g�i�[�ł��̂ŁA�\�j�[PSP�p��C�V��Wii�p��Virtools�����݂��܂��B�C�V��Wii�̊J�����C�Z���X�������Ă���Q�[���J����Ƃł���΁AWiiRemote�֌W�̃v���O�C������肷�邱�Ƃ��ł��邻���ł��B

Virtools�̊J���҃R�~���j�e�B�͊����ŁA�X���b�v�~�[�g(http://www.theswapmeet-forum.com/)�ŗl�X�ȏ���\�[�X�A�v���O�C�������L����Ă��܂�(PC��ŗ��p�ł���WiiRemote�̃v���O�C���֌W����������܂�)�B�����Q�[�������ڎw���w�������A�t���[�̃Q�[�����҂ɂƂ��āA����͋��͂ȃ\�����[�V�����ł��BVirtools���g����PC��ŃQ�[���̃v���g�^�C�v�𐧍삷��΁A���΂₭�A�C�f�B�A���`�ɂł��܂����A������Z�p�I�ȃ��X�N������ł��邩��ł��B

�M�҂�Virtools���WiiRemote�𗘗p����Q�[�����������J�����܂�����(��q)�A�v���O�C���̊J�����܂ߔ��ɍ����ɁA�Â������̂���邱�Ƃ��ł��܂����B�����߂ł��B����Virtools�̃z�[���y�[�W����e��f�������Ă݂Ă��������B

��Virtools(3DVia)�Ɋւ�����Virtools(�p��) http://www.virtools.com/

���{�ł͎O�������ƃN���b�Z���g���㗝�X���s���Ă��܂��B�R���e���c�̐���T�|�[�g��Z�p�T�|�[�g�A����x���A�w�Z�������C�Z���X�̔��Ȃǃ��Z���[�e�Ђ̓��ӕ��삪����܂�����A���Ж₢���킹�Ă݂Ă��������B

���O������(Virtools�֌W) http://www.san-toku.co.jp/VirtoolsOnlinePage/VirtoolsIndex.htm

��������ЃN���b�Z���ghttp://www.crescentvideo.co.jp/virtools/

��WiiYourself! on Virtools Se'bastion Kuntz (http://cb.nowan.net/blog/)

Products

Bespoke Software

Bespoke 3DUI XNA Framework Version 4.2 http://www.bespokesoftware.org/wordpress/?page_id=50

wiimoteproject.com

http://www.wiimoteproject.com/

���R�����FWiiFit��������j����

%{Wii Fit�J���C���^�r���[} %http://wii.com/jp/articles/wii-fit/crv/vol2/index.html %�u���J�a�v�̊J���҂��Ƃ����Ƃ��낪�ʔ����ł��ˁB

[�č\����]�C���^���N�V�����Z�p�F��̐V��

�uSoundQuest�v�����b

�ԊO���}�[�J�[���g�������[�V�����L���v�`��