OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Subtle manipulation (without setupDefaultGeometr


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Paul McIntosh
Guest





PostPosted: Tue Oct 21, 2008 3:48 am    Post subject:
Subtle manipulation (without setupDefaultGeometr
Reply with quote

All,

I am trying to recreate an interface where the user clicks on items in
a scene and moves them about. An example of what I am recreating
(originally in X3D) is in the video:
http://www.youtube.com/watch?v=gcgQajTXVrA

I've got the same thing working with OSG with the osgmanipulators
however these manipulators (seem to?) rely on setupDefaultGeometry()
to create handles. I would rather have the original subtle approach,
where the object itself acts as the "handle" and the scene is not
cluttered with other objects.

Is there an easy way to do this or will I have to create my own
specialised dragger?

Cheers,

Paul
--
Paul McIntosh
www.internetscooter.com



------------------
Post generated by Mail2Forum
Back to top
Skylark (Jean-S├ębastien Guay)
Professional


Joined: 05 Jan 2009
Posts: 2249

PostPosted: Tue Oct 21, 2008 12:43 pm    Post subject:
Subtle manipulation (without setupDefaultGeometr
Reply with quote

Hi Paul,

Quote:
I've got the same thing working with OSG with the osgmanipulators
however these manipulators (seem to?) rely on setupDefaultGeometry()
to create handles. I would rather have the original subtle approach,
where the object itself acts as the "handle" and the scene is not
cluttered with other objects.

Is there an easy way to do this or will I have to create my own
specialised dragger?

Check out the code for createDefaultGeometry() for your selected
dragger. You will see that it essentially creates some geometry under
the dragger (geodes as children of the dragger, which is a subclass of
MatrixTransform). Often, there is additional geometry created only to
make picking easier, but never displayed - for example:

// Create an invisible cylinder for picking the line.
{
osg::Cylinder* cylinder =
new osg::Cylinder (osg::Vec3(0.0f,0.0f,0.5f), 0.015f, 1.0f);
osg::Drawable* geometry = new osg::ShapeDrawable(cylinder);
setDrawableToAlwaysCull(*geometry);
geode->addDrawable(geometry);
}

The important part is setDrawableToAlwaysCull(), which is a protected
method of osgManipulator::Dragger. So if, for example, you want to
create a TranslatePlaneDragger which does not display its geometry, you
could just subclass TranslatePlaneDragger, and then in
createDefaultGeometry() you would only create an invisible quad which
would align with the plane you want to translate along, using is
setDrawableToAlwaysCull(). That way, intersections would be found on
that plane and the dragger would behave as you want, but it would not
display any geometry for the dragger itself.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay
http://www.cm-labs.com/
http://whitestar02.webhop.org/


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 am View latest post
No new posts osg-users Digest, Vol 138, Issue 27 Zachary1234 General 0 Tue Jan 01, 2019 1:16 am View latest post
No new posts osg-users Digest, Vol 137, Issue 14 poweruserm@live.com.au General 0 Fri Nov 16, 2018 11:16 pm View latest post
No new posts General Users starting questions in O... A Z General 1 Mon Oct 15, 2018 3:59 am View latest post
No new posts osg-users Digest, Vol 136, Issue 8 jonasydy General 0 Wed Oct 10, 2018 12:40 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP