Hey, I about have all of it!

The last two things I am trying to work out are the:
Producer::KeyboardMouse::positionPointer( float x, float y )

and
Producer::KeyboardMouse::computePixelCoords(mouseX, mouseY, renderSurface,
pixelX, pixelY)

for computePixelCoords, should I just find the width and height of the
window, and then do
pixelX = (width*0.5)*(mouseX+1.0);
pixelY = (height*0.5)*(mouseY+1.0); // maybe flipped?

I imagine this has to be somewhere.


As for the positionPointer thing, I am turning the cursor off and just
keeping the mouse pointer in the screen and measuring how much it moved
since last frame (for a game).  Perhaps someone knows of a better way to do
this?

Thanks much
-- Rick

On Tue, Jun 17, 2008 at 7:12 PM, Rick Pingry <[EMAIL PROTECTED]> wrote:

> Thanks guys,
>
> that is just what I did.
>
> Now I am looking for the equivilent of
>
> Producer::KeyboardMouse::positionPointer( float x, float y )
> Any way to set the mouse position like this?
> Thanks Again,
> -- Rick
>
>   On Tue, Jun 17, 2008 at 1:08 PM, Jean-Sébastien Guay <
> [EMAIL PROTECTED]> wrote:
>
>> Hello Rick,
>>
>> I noticed that there is:
>>> osgViewer::Viewer->getCamera()->setPostDrawCallback()
>>>  but there is only one (implied by a set* rather than add*).  Any way to
>>> have multiple ones?
>>>
>>
>> You could create a CompositeDrawCallback class, which would be an
>> osg::Camera::DrawCallback, would have a vector osg
>> osg::Camera::DrawCallbacks, and in its operator() would call the callbacks'
>> operator() methods one by one.
>>
>> I know that there are probably new ways to do all of this stuff, add
>>> HUD's, new ways to handle the keyboard and mouse and everything else.  I am
>>> just trying to refactor what I have rather than re-writing the whole darn
>>> thing.
>>>
>>
>> That's perfectly normal. Just be prepared to look around (generating the
>> doxygen from the source is a great tool - it's unfortunately not up to date
>> on the OSG web site).
>>
>> As a side note, you can also do a HUD with a post-draw camera added as a
>> child to your main camera - so you could have multiple post-draw cameras as
>> children of the main camera. That would probably scale better than post-draw
>> callbacks. See the osghud example.
>>
>> Hope this helps,
>>
>> J-S
>> --
>> ______________________________________________________
>> Jean-Sebastien Guay    [EMAIL PROTECTED]
>>                               http://www.cm-labs.com/
>>                        http://whitestar02.webhop.org/
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
>  --
> >> Rick
> Check us out at http://fringe-online.com/
>



-- 
>> Rick
Check us out at http://fringe-online.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to