[osg-users] osgGA modifications for IPhone and other stuff

2010-09-11 Thread Thomas Hogarth
Hi Stephan and everyone else

I've been thinking a little about multi touch support for osgGA for use with
IPhones and other multi touch devices. I've got a few things I'd like others
thoughts on before beginning.

-Firstly do we treat multi touch inputs as completely separate event types,
or do we have an array for each of the mouse event variables and treat them
as if there were multiple mice?

-If we use the first method do we still use touch one as if it is the mouse,
basically generating two events a mouse and touch1 event?

-Do we make the system capable of handling any number of inputs all
encapsulated under the same event type or do we just support the current max
of 4 points and have a different event type for each?

-Do we also add support for the other input devices that are now becoming
common place?
-Accelerometers
-3 Axis gyros

-And on a slightly different note what do people think of adding two new
event types
-RECEIVE_FOCUS
-LOOSE_FOCUS

My hud system is starting to need them and I can't think of a way to find
when the mouse enters/leaves the window without osgGA supporting it.


Cheers
Tom
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other

2010-09-14 Thread Thomas Hogarth
Looks ace Stephan

I've not had a chance to checkout your osgGA changes yet, but now I can't
wait. Also nice to see it's been tested on the IPad, I've only got an IPod
touch so the testing has been pretty limited. I'm getting and IPod touch 4th
gen this week so I can finally use gles 2.0, it's less then £200 so decent
mobile AR is now looking promising :).

I'll check out your changes (those include my cmake stuff right?) and have a
play, but by the look of things you've done it already, nice one.

Tom
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other

2010-09-16 Thread Stephan Huber
Hi Tom,

Am 14.09.10 22:05, schrieb Thomas Hogarth:
> Looks ace Stephan
> 
> I've not had a chance to checkout your osgGA changes yet, but now I can't
> wait. Also nice to see it's been tested on the IPad, I've only got an IPod
> touch so the testing has been pretty limited. I'm getting and IPod touch 4th
> gen this week so I can finally use gles 2.0, it's less then £200 so decent
> mobile AR is now looking promising :).
> 
> I'll check out your changes (those include my cmake stuff right?) and have a
> play, but by the look of things you've done it already, nice one.

Yeah, your changes are included (hopefully). I added support for
changing the orientation (flip the ipad/iphone to landscape and back,
you can disable this, if you set the
GraphicsContext::Traits::supportsResize to false) and added a
MultiTouchTrackballManipulator, which has still some minor bugs.

Here's another video ;-) http://vimeo.com/15017377


cheers,
Stephan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other

2011-07-18 Thread William Hutama
Hi Stephan,

I just tried your modification on my iPhone (3gs) and also on iPad.
The rendering looks ok when I change the orientation to landscape.
However, the touch input space does not seem to be correct, there are some 
offsets between the location that I actually touch and the location in the clip 
space (only happens in landscape mode).

I used simpleExample inside the iPhoneExample folder in the OSGIPhone project, 
which has the DebugTouchPointsEventHandler to draw the touch location.

Thank you!

Cheers,
William

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41418#41418





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-12 Thread Stephan Huber
Hi Thomas,

Am 11.09.10 22:56, schrieb Thomas Hogarth:
> Hi Stephan and everyone else
> 
> I've been thinking a little about multi touch support for osgGA for use with
> IPhones and other multi touch devices. I've got a few things I'd like others
> thoughts on before beginning.
> 
> -Firstly do we treat multi touch inputs as completely separate event types,
> or do we have an array for each of the mouse event variables and treat them
> as if there were multiple mice?

I'd say, we'll use the the exisiting event-types , push, drag, release
for touch-events. What is needed is a touch-id-variable to differentiate
between multiple touches at the same time. So we have basic
compatibility to old code and do not bloat the GUIEventAdapter-class too
much, only adding one int. We can even use the _button-property of
EventAdapter. (that's my current approach)

As different multi-touch-devices have different limits (some can handle
2 simultaneous touches only, some others up to 11 (e.g. the iPad)) I'd
say, that we should not limit the number of simultanous touches.

Perhaps we'll need some higher class which saves the states of different
touches and their locations, so it's easier to query for the touches and
their positions, this can be a custom event-handler baseclass.

> -Do we also add support for the other input devices that are now becoming
> common place?
> -Accelerometers
> -3 Axis gyros

Personally I handle these types of input with a derived
eventadapter-class which stores the additional data, and can be queried
by a custom event handler.

perhaps it would be a good idea to add an additional variable to the
event-adapter class to differentiate between multiple user-event-types.


I started coding the integration of multi-touch-events into osgGA, you
can have a look at the changeset at:
http://github.com/stmh/osg/commit/f906fc15737fa7af6a179534168d09820cab639d
(no manipulator yet)


just my 2 cents.

cheers,

Stephan

Bytheway: I comitted your cmake integration to the git-repository at
http://github.com/stmh/osg
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-13 Thread Robert Osfield
Hi Stephan and Thomas,

On Sun, Sep 12, 2010 at 8:03 PM, Stephan Huber  wrote:
> I'd say, we'll use the the exisiting event-types , push, drag, release
> for touch-events. What is needed is a touch-id-variable to differentiate
> between multiple touches at the same time. So we have basic
> compatibility to old code and do not bloat the GUIEventAdapter-class too
> much, only adding one int. We can even use the _button-property of
> EventAdapter. (that's my current approach)

I kinda like this idea, it's not too intrusive w.r.t osgGA.  However,
in terms of event handlers receiving events I would have thought you'd
want to get all the events for a single multi-touch together, since if
you are getting them one by one you'd need to have a start and stop
event so you'd know how to accumulate.

How about a composite GUIEventType, or one that forms a linked list,
and you just pass the head around.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-13 Thread Stephan Maximilian Huber
Hi,

Am 13.09.10 10:39, schrieb Robert Osfield:
> I kinda like this idea, it's not too intrusive w.r.t osgGA.  However,
> in terms of event handlers receiving events I would have thought you'd
> want to get all the events for a single multi-touch together, since if
> you are getting them one by one you'd need to have a start and stop
> event so you'd know how to accumulate.
> 
> How about a composite GUIEventType, or one that forms a linked list,
> and you just pass the head around.

Yes you are right, that's a problem with my last approach. Perhaps it's
best to add a ref_ptr to GuiEventAdapter holding a custom structure with
all touch-points with their positions, tapCounts and Ids.

(after a while)

So I tried that approach, I did not use a linked list of
GUIEventAdapters, as they would store too much information for a single
touchpoint (like scrolling and tablet-information, etc).

Instead I added a new class called TouchData which basically holds a
list of structs of { touch-id, touch-phase, x, y, tap-count}. The
GUIEventAdapter holds only a ref_ptr to this class, so the overhead for
osgGUIEventAdapter is not too much. I added some convenience-methods to
EventQueue and GUIEventAdapter.

To add multiple touch-points to a GUIEventAdapter you'll basically do
something along these lines:

osg::ref_ptr osg_event(NULL);

for(int i=0; igetEventQueue()->touchMoved(id, phase,x, y);
} else {
osg_event->addTouchPoint(id, phase, x, y);
}
}

The current implementations set the x and y properties of the
GUIEventAdapter from the first touch point, so we get some basic
compatibility to existing manipulators (basically a one button mouse).

To get the touch-points from inside your event-handler:

if (ea.isMultiTouchEvent())
{
osgGA::GUIEventAdapter::TouchData* data = ea.getTouchData();
for(
osgGA::GUIEventAdapter::TouchData::iterator i = data->begin();
i != data->end();
++i)
{
std::cout
  << " id: " << i->id
  << " phase: " << i->phase
  << " pos: " << i->x << "/" << i->y
  << " tapCount:" << i->tapCount
  << std::endl;
 }
}

I hope this design makes more sense. You can find this approach in the
git-repository / iphone-branch.


cheers,
Stephan

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-13 Thread Stephan Huber
Hi,

just a short follow-up: The new code works nicely, here's a small demo
video (just crosslines for every touch-point):

http://vimeo.com/14938178

cheers,

Stephan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-13 Thread David Glenn

sth wrote:
> Hi,
> 
> just a short follow-up: The new code works nicely, here's a small demo
> video (just crosslines for every touch-point):
> 
> http://vimeo.com/14938178
> 
> 


Kool! Look like the same thing on smart boards. The only thing is that smart 
boards use multiple mice points and to my understanding Linux can't do that now 
- only Windows 7 can on PC's!

D Glenn


D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your 
Desk!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=31583#31583





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-14 Thread Jason Daly

David Glenn wrote:

sth wrote:
  

Hi,

just a short follow-up: The new code works nicely, here's a small demo
video (just crosslines for every touch-point):

http://vimeo.com/14938178






Kool! Look like the same thing on smart boards. The only thing is that smart 
boards use multiple mice points and to my understanding Linux can't do that now 
- only Windows 7 can on PC's!
  


There is a multiple pointer extension for X (called MPX) that has 
recently been added to the X.org server:


http://en.wikipedia.org/wiki/Multi-Pointer_X

The latest distributions should have it (I know Fedora has had it since 
release 12).  It's most likely disabled by default.


--"J"

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA modifications for IPhone and other stuff

2010-09-14 Thread David Glenn

Jason Daly wrote:
> 
> There is a multiple pointer extension for X (called MPX) that has recently 
> been added to the X.org server:
> 
> http://en.wikipedia.org/wiki/Multi-Pointer_X 
> (http://en.wikipedia.org/wiki/Multi-Pointer_X)
> 
> The latest distributions should have it (I know Fedora has had it since 
> release 12). It's most likely disabled by default.
> 
> --"J"
> 
>  --
> Post generated by Mail2Forum


Well, if it can support 8 mice, it can use a smartboard! At least that what 
I've been told!


D Glenn (a.k.a David Glenn) - Join the Navy and See the World ... from your 
Desk!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=31603#31603





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org