logo资料库

OpenHaptics_ProgGuide1.0.pdf

第1页 / 共138页
第2页 / 共138页
第3页 / 共138页
第4页 / 共138页
第5页 / 共138页
第6页 / 共138页
第7页 / 共138页
第8页 / 共138页
资料共138页,剩余部分请下载后查看
Contents
Preface
Introduction
HDAPI vs. HLAPI
Installation
System Requirements
Installing the OpenHaptics Toolkit
Directory Structure
Creating Haptic Environments
Introduction to Forces
Force Rendering
Contact and Constraints
Combining Haptics with Graphics
Combining Haptics with Dynamics
Haptic UI Conventions
HDAPI Overview
Getting Started
The Device
The Scheduler
Developing HDAPI Applications
Design of Typical HDAPI Program
HDAPI Programming
Haptic Device Operations
Haptic Frames
Scheduler Operations
State
Calibration Interface
Error Reporting and Handling
Cleanup
HLAPI Overview
Generating Forces
Leveraging OpenGL
Proxy Rendering
Threading
Design of Typical HLAPI Program
HLAPI Programming
Device Setup
Rendering Contexts
Haptic Frames
Rendering Shapes
Mapping Haptic Device to Graphics Scene
Drawing a 3D Cursor
Material Properties
Surface Constraints
Effects
Events
Calibration
Dynamic Objects
Direct Proxy Rendering
Multiple Devices
Extending HLAPI
Utilities
Vector/Matrix Math
Workspace to Camera Mapping
Snap Constraints
C++ Haptic Device Wrapper
hduError
hduRecord
Haptic Mouse
Deploying OpenHaptics Applications
Troubleshooting
Device Initialization
Frames
Thread Safety
Race Conditions
Calibration
Buzzing
Force Kicking
No Forces
Device Stuttering
Error Handling
Index
Numerics
3D Cursor, drawing 7-20
A
adaptive viewport 7-11
advanced mapping 7-19
B
basic mapping 7-18
begin/end shape 7-5
buffer
button 7-30
buzzing
C
C++ haptic device wrapper 8-8
calibration 7-30, 7-31
callbacks
cleanup 5-13
client thread events 7-30
closest feature callback 7-39
collision thread events 7-31
combining
contact
contexts
culling with spatial partitions 7-13
cursor
custom effects 7-40
custom shapes 7-37
D
damping 7-23
depth buffer 7-6
developing 3D touch applications 4-3
device
device initialization
device setup
devices
direct proxy rendering 7-36
directory structure 2-5
drawing 3D cursor 7-20
drawing a 3D Cursor 7-20
dynamic objects 7-33
dynamics
E
effects 7-26
error handling
error reporting and handling 5-12
event callbacks 7-28
event handling 3-7
event types 7-29
events 7-28, 7-30
extending HLAPI 7-37
external modules 2-7
F
feedback buffer 7-9
force kicking
forces 3-2
frames
friction 7-23
G
generating forces 6-2
get state 5-7
graphics
graphics scene
H
haptic camera view 7-12
haptic cues 3-11
haptic device
haptic frames 5-3
haptic workspace 7-16
haptics
HDAPI vs HLAPI 1-1
hduError 8-10
hduRecord 8-10
HLAPI programs design of 4-6, 6-5
I
intersect callback 7-38
L
leveraging OpenGL 6-2
M
manipulation
mapping 7-18
material properties 7-22
math 8-2
matrix
matrix math 8-2
matrix stacks 7-17
matrix utilities 8-3
motion 7-29
motion friction 3-11
multiple devices 7-37
O
OpenGL, leveraging 6-2
optimizing shape rendering 7-11
P
PDD. See PHANTOM Device Driver
PHANTOM Device Driver 2-2
proxy 3-5
R
race conditions
registry entries 2-7
relative transformations 3-10
rendering
S
scheduler operations 5-4
SCP. See surface contact point
servo loop 1-3
servo thread 1-3
shape
shape rendering, optimizing 7-11
shapes
snap
spatial partitions, culling with 7-13
specific shapes 7-30
stabilizing
stacks 7-17
state 5-7
stiffness
surface
surface constraints 7-24
surface contact point 3-5
synchronization of state 5-9
system requirements 2-1
T
thread safety
threading 6-4, 7-30
touch 7-29
touch-workspace matrix 7-18
transformations 3-10
troubleshooting 10-1
types
types of events 7-29
U
utilities 8-1
V
vector math 8-2
vector utilities 8-2
View-touch Matrix 7-18
visual cues 3-11
W
workspace 7-16
3D TOUCH™ SDK OPENHAPTICS™ TOOLKIT VERSION 1.0 PROGRAMMER’S GUIDE
Copyright Notice ©2004. SensAble Technologies, Inc. All rights reserved. Printed in the USA. Except as permitted by license, no part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means electronic, mechanical, recording or otherwise, without prior written consent of SensAble Technologies. Trademarks FreeForm, FreeForm Concept, FreeForm Modeling, FreeForm Modeling Plus, FreeForm Mold, GHOST, HapticSound, OpenHaptics, PHANTOM, PHANTOM Desktop, PHANTOM Omni, 3D Touch, Splodge, SensAble, and SensAble Technologies, Inc. are trademarks or registered trademarks of SensAble Technologies, Inc. Other brand and product names are trademarks of their respective holders. Warranties and Disclaimers SensAble Technologies does not warrant that this publication is error free. This publication could include technical or typographical errors or other inaccuracies. SensAble may make changes to the product described in this publication or to this publication at any time, without notice. Questions or Comments If you have any questions for our technical support staff, please contact us at support@sensable.com. You can also phone 1-888-SENSABL (U.S.A. only) or 1-781-937-8315 (International). If you have any questions or comments about the documentation, please contact us at documentation@sensable.com. Corporate Headquarters SensAble Technologies, Inc. 15 Constitution Way Woburn, MA 01801 Phone: 1-888-SENSABL (U.S.A. only) or 1-781-937-8315 (International) E-mail: support@sensable.com Internet: http://www.sensable.com Last Updated - 5 August, 2004 6:33 pm P/N - 02523 R3
Contents i Preface......................................................................... Introduction ................................................................ 1-1 HDAPI vs. HLAPI .............................................................................. 1-1 Installation .................................................................. 2-1 System Requirements .......................................................................... 2-1 Installing the OpenHaptics Toolkit ..................................................... 2-2 Directory Structure .............................................................................. 2-5 Creating Haptic Environments ................................. 3-1 Introduction to Forces ......................................................................... 3-2 Force Rendering .................................................................................. 3-2 Contact and Constraints ...................................................................... 3-5 Combining Haptics with Graphics ...................................................... 3-6 Combining Haptics with Dynamics .................................................... 3-8 Haptic UI Conventions ........................................................................ 3-9 HDAPI Overview ........................................................ 4-1 Getting Started ..................................................................................... 4-2 The Device .......................................................................................... 4-2 The Scheduler ...................................................................................... 4-3 Developing HDAPI Applications ........................................................ 4-3 Design of Typical HDAPI Program .................................................... 4-6 HDAPI Programming ................................................. 5-1 Haptic Device Operations ................................................................... 5-2 Haptic Frames ..................................................................................... 5-3 Scheduler Operations .......................................................................... 5-4 State ..................................................................................................... 5-7 Calibration Interface .......................................................................... 5-10 Error Reporting and Handling ........................................................... 5-12 Cleanup .............................................................................................. 5-13 HLAPI Overview ......................................................... 6-1 Generating Forces ............................................................................... 6-2 OpenHaptics Toolkit - Programmer’s Guide Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6
Chapter 7 Chapter 8 Chapter 9 Chapter 10 Leveraging OpenGL ............................................................................6-2 Proxy Rendering ..................................................................................6-3 Threading .............................................................................................6-4 Design of Typical HLAPI Program .....................................................6-5 HLAPI Programming ................................................. 7-1 Device Setup ........................................................................................7-2 Rendering Contexts ..............................................................................7-2 Haptic Frames ......................................................................................7-3 Rendering Shapes .................................................................................7-5 Mapping Haptic Device to Graphics Scene .......................................7-16 Drawing a 3D Cursor .........................................................................7-20 Material Properties .............................................................................7-22 Surface Constraints ............................................................................7-24 Effects ................................................................................................7-26 Events .................................................................................................7-28 Calibration ..........................................................................................7-31 Dynamic Objects ................................................................................7-33 Direct Proxy Rendering .....................................................................7-36 Multiple Devices ................................................................................7-37 Extending HLAPI ..............................................................................7-37 Utilities ....................................................................... 8-1 Vector/Matrix Math .............................................................................8-2 Workspace to Camera Mapping ...........................................................8-4 Snap Constraints ..................................................................................8-7 C++ Haptic Device Wrapper ...............................................................8-8 hduError .............................................................................................8-10 hduRecord ..........................................................................................8-10 Haptic Mouse .....................................................................................8-11 Deploying OpenHaptics Applications ..................... 9-1 Troubleshooting ...................................................... 10-1 Device Initialization ...........................................................................10-2 Frames ................................................................................................10-2 Thread Safety .....................................................................................10-3 Race Conditions .................................................................................10-6 Calibration ..........................................................................................10-6 Buzzing ..............................................................................................10-7 Force Kicking ...................................................................................10-12 No Forces .........................................................................................10-15 Device Stuttering ..............................................................................10-15 OpenHaptics Toolkit - Programmer’s Guide
Error Handling ................................................................................. 10-16 Index ........................................................................ A-1 OpenHaptics Toolkit - Programmer’s Guide
OpenHaptics Toolkit - Programmer’s Guide
Preface This guide explains the SensAble 3D Touch™ SDK OpenHaptics™ toolkit. This document will introduce you to the architecture of the toolkit, how it works, and what you can do with it. The guide will also introduce you to the fundamental components of creating haptic environments and walk you through installing the toolkit and deploying your haptically enabled application. A more recent version of this document may be available for download from the SensAble online Developer Support Center (DSC). To access the DSC, visit the SensAble Support page at http://www.sensable.com/support/. The DSC provides customers with 24 x 7 access to the most current information and forums for the 3D Touch and GHOST® SDKs. Please note that you will be asked to create a registration profile and have your customer information authenticated before you will have access to the DSC. What is Haptics? Haptics is the science of incorporating the sense of touch and control into computer applications through force (kinesthetic) or tactile feedback. By using special input/output devices—called haptic devices—with a haptically enabled application, users can feel and manipulate virtual three-dimensional objects. The type of feedback used to convey the sense of touch is determined by the type of haptic device being used. Application areas for haptics are varied and continually expanding. These include: • • • Military applications such as aerospace and military training and Surgical simulation and medical training Painting, sculpting, and CAD simulation OpenHaptics Toolkit - Programmer’s Guide i
PREFACE • Assistive technology for the blind or visually impaired • Simple interaction techniques with the standard user interface such as opening/closing windows, and interacting with menus • Gaming Audience This guide assumes that the reader has an intermediate to advanced background in software development, is familiar with the C programming language, and is somewhat familiar with 3D graphics programming. Although the core API is C based, some of the utility libraries and the source code examples use C++. For additional information about haptics, see the SensAble Developer Support Center. Typographical Conventions This guide uses the following typographical conventions: Convention Italics Courier Note, Warning, Important Description Reference to another document or file; first use of a new term. Identifies code. Calls out important additional information. Identifies a variable such as a file name or location. Example See the Programmer’s Guide. hdBeginFrame(hHD); /OpenHaptics Important Code snippets included in this document may contain soft or hard line breaks for formatting purposes. ii OpenHaptics Toolkit - Programmer’s Guide
分享到:
收藏