The Sandio 3D Mouse SDK is designed to make it easy
to integrate 3D sensor data into your application under Direct X or RAWINPUT
API.
- To use for acquiring 3D button data in a source code of 3D Application
program, i.e. PC game software.
- Very simple. Only one C/C++ function to decode 3D button data.
- Uses industry standard C++ compilers. (Single C++ function call under
DirectX or Win32 USB input API: RAWINPUT)
- Source Code Writing:
Insert a call to Decode3DSignal after acquiring data of HID input device.
Using Sandio SDK, you can create totally new kind of interactive 3D game applications such as:
- Multiple movement at once, i.e. 360 degrees spiral rotation, kick and jump.
- Simultaneous multiobject controls, i.e. robot control of body, arm #1, arm #2 ,gripper.
Example C++ programs using Sandio SDK with source code are available.
//****************************************************************
// Example Program for acquisition of 3D button data using Win 32 RAWINPUT API
// and Sandio 3D Mouse SDK function.
// Copyright sandio Technology Corp. 2006
//****************************************************************
#include "GetRIData.h"
#include "S3Dmouse.h" // for Sandio 3D mouse SDK
……………..
…………….
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//////////////////////////////////////////////////////////////////////////////////////////
int Hid_Device(HWND hWnd, RAWINPUT* raw)
{
………………………………………………………………………
ByteSize3DRawData = raw->data.hid.dwSizeHid;
NumberOf3DInput = raw->data.hid.dwCount;
for (int i=0; i<10; i++)
{ // USB 3D mouse data from RAWINPUT API
RawData3DButton[i] = raw->data.hid.bRawData[i];
}
// ---- decryption ------ // Sandio SDK function call
Decode3DSignal(RawData3DButton, RawData3DButton);
// decryption of 3D button data
// ---- end of decryption ---
return 0;
}
///////////////////////////////////////////////////////////////////////////////
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
………………………………………………………………………
switch (message)
{
……………………………………………………
case WM_INPUT:
{ // RAWINPUT API function call to acquire USB 3D mouse data
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, sizeof(RAWINPUTHEADER));
break; // return 0;
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
|
|