osgHaptics. Discussion and everone who like to help.

please read further...

thanks

/Adegli


Von: [EMAIL PROTECTED] Anders Backman
An: [EMAIL PROTECTED] 'Adrian Egli'
Datum: Mon, 15 May 2006 11:54:51 +0200
Betreff: RE: osgHaptics

Ah, now I understand.
You want to do some kind of culling for haptics...

Well, I guess this is a pretty complicated problem.

Currently (with OpenHaptics from Sensable) the Haptic Shape is rendered
through immediate calls to OpenGL (typically glVertex3fv())

As everybody knows, they dont scale that well, (how large model are we
talking about here?)

Also, as we dont have a HapticsCard to store the geometry on, we cannot use
displayLists either, so we have to call glVertex3f() for each geometry each
frame....

Now for hundreds of thousands of triangles this wont work.

But a simple speedup would be to use a similar approach as ordinary
view-culling, but you cull against a sphere (proximity to the device).

So you would cull the haptic scene against a sphere with a specific radius
around the proxy-device.
Only the part of the subgraph that interesect the sphere would be haptically
rendered.

That would certainly give you quite a speedup.
Havent thought of that before, but we havent used that large models either.

Its not that hard either, just recursively compare a sphere with bounding
spheres in the scene...
The problem is to design it properly.

I guess a custom cullvisitor that uses a specified radius from the
hapticdevice as cullingvolume instead of the viewfrustum would work...
Which would be run only in the haptic subgraph.

Shouldnt be that much work.

This also depends on the structure of your scene.
If your geometry is stored as one renderleaf, then the whole geometry would
be rendered anyway...
but only when the proxy is within the bounds of your geometry.
So that wouldnt give you much of a speedup.

So then you either have to subdivide your geometry into several geometries
or some other clever trick to partially render the geometry depending on the
position of the proxy.
But that will be very inefficient on a large geometry.

If you go for your approach, to only render the triangle closest to the
proxy, you would get very nasty effects when moving over a surface built
from many triangles...You would certainly feel discontinous surface effects.

There are of course a more complicated way, and that is to build up a
spatial datastructure, such as a Octree or a Kd-tree that can return a set
of triangles which are all within a certain distance from the proxy, and
only render those haptically.

That would give you the best performance and probably also the best haptic
sensation.
You would though have to create several representations of the geometry,
which is bad if the geometry is changing....



So thats my two cent to this.


So the reason that H3D and osgHaptics perform the same on this model is the
underlying technology implementation of OpenHaptics from sensable Inc.

There is in this case a need of a smart structure to avoid shipping the
whole geometry to the haptic rendering.

Its is something that it is possible to do, and I would gladly contribute if
there is something I can help.
Its something that would make osgHaptics stand out!

/Anders


________________________________________________________________
Anders Backman Email: [EMAIL PROTECTED]
HPC2N/VRlab Phone: +46 (0)90-786 9936
Umea university Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
http://www.cs.umu.se/~andersb





_____

From: Adrian Egli [mailto:[EMAIL PROTECTED] ]
Sent: den 15 maj 2006 11:32
To: Anders Backman
Subject: Re: osgHaptics



(1) the trouble is if i load a very huge dataset ( for haptics , not huge
for visualisation ) my framerate become very bad. so i like to know why we
can not speed up the haptics device. or my they have to do this.

(2) i mean, openscenegraph is quite fast and robust in doing linesegement
intersection. i guess there would be a solution to intersect the world from
a line starting at the haptics device with a linesegment direction based on
devices. segement length scaled be the motion speed and direction. so we can
minize the intersection test. my the line segment would never touch the
world (scene) and if we got an intersection we can just do haptics rendering
for the triangles we found. or i am completly wrong ?





2006/5/15, Anders Backman < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >:





________________________________________________________________
Anders Backman Email: [EMAIL PROTECTED]
HPC2N/VRlab Phone: +46 (0)90-786 9936
Umea university Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
http://www.cs.umu.se/~andersb
<http://www.cs.umu.se/%7Eandersb>





_____


From: Adrian Egli [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]

Sent: den 15 maj 2006 11:11

To: Anders Backman
Subject: Re: osgHaptics




hi andres,

now i could test the osgHaptics. and i have got some questions, i hope not
stupids ones, but i have such question in speed up the haptics.
i still tested it with h3d. i saw similar concepts.

I dont understand the question, speed up the haptics?



i think it would be possible to render just the nearest triangle if we are
close enought to it? detection with linesegment intersection ?
i feel that this could work?

This is not dependent on osgHaptics, this is up to osg.
Collision Detection in general is a complicated thing.
To find the nearest triangle in a large mesh of triangles can cost a lot of
time if you do it in a bad way.

Using a ray for intersection is not a very stable way, in which direction
should you shoot the ray?
In all directions?
Sounds like you need some better intersection libraries such as SOLID,
I-COLLIDE, ....

Otherwise, if you stick to using just osg, osgHaptics will give you the
position of the proxy, not any information about what surface you are
currently touching, just the Shape you are touching.

You could of course use that information:

void MyContactHandler:: contact( osgHaptics::ContactState& state){

osgHaptics::Shape *shape = state.getShape();

MyIterator it = my_map_with_shape_node_pairs.find(shape)

if (it != my_map_with_shape_node_pairs.end())

osg::Node *node = it->second;



Now if you have stored in some smart way a pair of shape/nodes somewhere (in
a std::map) for example, you could cut down the search for your closest
triangle by just searching in that node...
As I illustrated in the above example.



/Adegli



2006/5/15, Adrian Egli <[EMAIL PROTECTED]>:

thanks
/Adegli



2006/5/15, Anders Backman < <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]>:

Read the README file.
The Dexterity game should be started with room.ac
so go to the data directory, and run dexterity_game room.ac


If you just want to touch a model try:

osgHapticViewer cow.osg

or

osgHapticViewer cessna.osg


/Anders

________________________________________________________________
Anders Backman Email: [EMAIL PROTECTED]
HPC2N/VRlab Phone: +46 (0)90-786 9936
Umea university Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
http://www.cs.umu.se/~andersb
<http://www.cs.umu.se/%7Eandersb>





_____


From: Adrian Egli [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]


Sent: den 15 maj 2006 10:11

To: Anders Backman
Subject: Re: osgHaptics




thanks,

a found the CD in our phantom box. and i installed now the libraries. and
replaced observer_ptr with osg::ptr, i seams to work.

i have called: dexterity_game.exe cow.osg and got :

HL_DEVICE_ERROR( HD_EXCEEDED_MAX_VELOCITY )

what's wrong. the phantom makes a very strange noise.

adegli


2006/5/15, Anders Backman <[EMAIL PROTECTED] >:

First, OpenHaptics <hlu...> comes as a library from Sensable Inc. (stated in
the README file)
Either you have purchased a Phantom device (where you get the library on a
CD together with the device), or you have to purchase it (unless you are an
academic institution, then its free, you just have to register on their
website.

http://www.sensable.com

If you are using a commercial version, you need a valid license file which
can be obtained from them.


Secondly, you are probably using an older version of OpenSceneGraph than me.
observer_ptr has been in the CVS version for quite a while now, (several
months) and Im not sure if they are contained in the "official" 1.0 release.

So you need to do a CVS update to get them.
Or download a tarball that is newer than the release you are using now.




/Anders


________________________________________________________________
Anders Backman Email: [EMAIL PROTECTED]
HPC2N/VRlab Phone: +46 (0)90-786 9936
Umea university Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
http://www.cs.umu.se/~andersb
<http://www.cs.umu.se/%7Eandersb >





_____


From: Adrian Egli [mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]

Sent: den 15 maj 2006 09:37

To: Anders Backman
Subject: Re: osgHaptics




hi anders,

i can not compiler without error. may i am missing some libraries.

first of all: openhaptics: hlu/... i can not find it, where to download?

and missing to include
#include <osg/observer_ptr>

adegli


2006/5/12, Anders Backman <[EMAIL PROTECTED]>:

Yep, got to it, packing it into a stand-alone library. I hope that it will
be picked up and developed further by a larger community...


/Anders


________________________________________________________________
Anders Backman Email: [EMAIL PROTECTED]
HPC2N/VRlab Phone: +46 (0)90-786 9936
Umea university Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax: +46 90-786 6126
http://www.cs.umu.se/~andersb
<http://www.cs.umu.se/%7Eandersb>





_____



From: Adrian Egli [mailto: <mailto: [EMAIL PROTECTED]> [EMAIL PROTECTED]]

Sent: den 12 maj 2006 13:53
To: Anders Backman
Subject: Re: osgHaptics




hi andres,

thanks for the latest effort in haptics integration into openescenegraph. (i
just watch the latest
news)

:-)

adegli


2006/4/12, Adrian Egli < <mailto: [EMAIL PROTECTED]> [EMAIL PROTECTED]>:

thanks a lot,

i^ll try to work with the links you sent, if would have some further
questions i let you know.

thanks
adegli


2006/4/11, Anders Backman <[EMAIL PROTECTED]>:


Hi Adrian.

Well, I know the guys behind H3D very well...
Its a spinoff/dropout or whatever you call it from ReachIn technology,
another swedish company.


I have a similar view, of H3D, as a scenegraph, well there are better
alternatives.

When it comes to the integration of haptics into the scenegraph it sure is
one of the better alternatives. So if haptics is crucial, volume haptics is
even more important, I dont think that there are that many options.

One could sure make a haptics library to osg that does exactly the same
thing, but with a large effort, as H3D is designed for being used with
haptics, osg is not...

With that said, yes I have written a library I call osgHaptics.
Its written for our own purposes and is not complete in any sense.

Although it probably works for most cases.

The problem I constantly has to fight with is the fact that I dont want to
duplicate code into different libraries. That becomes an issue everytime I
want to share some code, as there is always some common code like
math-libraries, base-clases etc that Im using between libraries.

If someone should be able to use osgAL for sound totally independent from
osgHaptics, I have to ship two copies of any code that is common between the
two libraries.

Right now, osgHaptics is a part of a sensor library consisting of several
6DOF devices, such as Polhemus liberty, AscentionMotionstar etc..

the sensor.osgHaptics.HapticDevice is just one of those.
So to rip it out, I have to rip out some very handy base-classes that are
common for all sensors...

This causes some extra job for me. But its definately worth it if someone
wants to use it.

Regarding whats better or not, thats pretty hard to judge from an
executable, as they all behave the same more or less.

I can give you a zip-file with all the run-times you need and a simple
viewer that allows you to haptically touch any object loaded from
command-line.

But that doesnt really show much now does it?

What is it that you really need to show?
I could send you the code, but its not very useful until I have packed it so
it builds without our framework (Colosseum3D,
http://www.vrlab.umu.se/research/colosseum3d
<http://www.vrlab.umu.se/research/colosseum3d> )

So think about what it is that you need, and well find something out.

I have attached the code for a simple haptic viewer

Also, there are two movies available, although, a video of haptics, what an
idea ;-)

http://www.vrlab.umu.se/research/colosseum3d/screenshots.html

So to summarize, I will pack osgHaptics into a stand-alone library setup a
webpage and release it to the public.

But not in the nearest two weeks (going for vacation at the end of this
week!)

So, keep in touch, and let me know what you need.
I could probably create a zip file with all the executable you need to run
the simple viewer...
or even the whole colosseum3d package.
Just let me know and Ill start to zip.

/Anders









_____

From: Adrian Egli [mailto: [EMAIL PROTECTED]]
Sent: den 11 april 2006 11:33
To: [EMAIL PROTECTED]
Subject: osgHaptics




hi anders,

i am working on a research project. we like to integrate the haptics
(senable phantom) into our prototype application. we have 1.5 month ago
started developing it, at the moment we
use h3d and thier haptics. i am also more than 1.5 year involved in
application usning openscenegraph, and it is much better designed than
h3d.org <http://h3d.org/> .

you told that the haptics would become as part of an opensource release or
may openscenegraph nodekit for haptics? (have i you missunderstood?)
would it be possible to get a short demo file, test viewer because now we
have to decide wether we want use h3d.org <http://h3d.org/> or
openescenegraph. i would prefere the 2nd one.
but is a little politics at the office at the moment, so i have to show
something better runing with openscenegraph than with h3d.org
<http://h3d.org/ > . i know that osg is much better
but i can not prove it because i have not yet implemented haptics? my i can
show that it would be much better. i hope so. otherwise i have to work with
h3d.org <http://h3d.org/> - what i don't really want- that's life. it's
politcs.

also do you have some test.? binary format i use openescenegraph and visual
stuido 2005 / 2003 . VC8 or VC7 would be greate.

thanks.

adegli












_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to