Re: [osg-users] Rubber-band control for resizing an object

2013-12-09 Thread Mots G
Thanks a tonne Robert! *osgManipulator::Scale2DDragger* seems to suffice my
need!

Best regards,
Mots


On Mon, Dec 9, 2013 at 4:01 PM, Robert Osfield wrote:

> Hi Mots,
>
> Have a look at the osgmanipulator example.
>
> Robert.
>
>
> On 9 December 2013 04:40, Mots G  wrote:
>
>> Hi all,
>> I was wondering if there is a control available to scale an object by
>> dragging/stretching along its corners. I wish to allow the user to resize
>> door and window objects by stretching it across its borders.
>>
>> I wish to give a 'rubber - banding' visual cue (as in spreadsheets).
>>
>> Or would it be advisable to create a custom geode which draws a rectangle
>> and gets attached to the object which is to be resized. On stretching it it
>> would resize itself and on mouse release, pass the scaled parameter to the
>> object concerned.
>>
>> Again, apologies for the noob question, but just wanted to know if there
>> is something available already or there is a better way to apporach the
>> problem.
>>
>> Best regards,
>> Mots
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Rubber-band control for resizing an object

2013-12-08 Thread Mots G
Hi all,
I was wondering if there is a control available to scale an object by
dragging/stretching along its corners. I wish to allow the user to resize
door and window objects by stretching it across its borders.

I wish to give a 'rubber - banding' visual cue (as in spreadsheets).

Or would it be advisable to create a custom geode which draws a rectangle
and gets attached to the object which is to be resized. On stretching it it
would resize itself and on mouse release, pass the scaled parameter to the
object concerned.

Again, apologies for the noob question, but just wanted to know if there is
something available already or there is a better way to apporach the
problem.

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


Re: [osg-users] Collision detection using osgBullets

2013-11-18 Thread Mots G
Thank you Paul and Jan for the explanations!

I have checked the collision example that comes with the osgBullet library.
I was trying to modify the same example to get collision between two
osg-models.

I first modified the  CF_KINEMATIC_OBJECT box by an osg mode (Cow.osgt).
Collision worked fine with precision between the CF_STATIC_OBJECT Box-geode
and the CF_KINEMATIC_OBJECT cow model.

I then changed the other CF_STATIC_OBJECT box by another osg model
(cessna.osgt) and the collision completely stopped working.

On digging further, I came across a post
(here<http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=6816>),
which suggested that collision between two "Trimesh:
btBvhTriangleMeshShape" does not work with the default dispatcher. It
suggests the use of gimpact algorithm and create
'btGImpactConvexDecompositionShape' collision shapes for the osg-geode.

I am yet to figure out the correct way to generate a
'btGImpactConvexDecompositionShape' shape for an osg-geode.

I hope I'm on the right track :)

Regards,
Mots



On Mon, Nov 18, 2013 at 5:41 AM, Jan Ciger  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hello,
>
> On 11/17/2013 06:42 PM, Mots G wrote:
> > Hi Paul, I'm confused between static and dynamic objects. Does
> > dynamic object mean the rigid body dynamic object and the dynamic
> > world? I thought dynamic objects were only needed if I had to get
> > inertia and motion states properties to the objects. In my case I
> > only need to test if the 3D models collide among themselves so
> > their movement(translations etc) could be restricted.
>
> These the classes objects Bullet is using:
>
> Static = never moves, doesn't get any collision response (think
> landscape or buildings), but other objects hitting it get collisions.
>
> Dynamic = both moves and gets collision response (i.e. bounces off
> when hit), typically most of your mobile objects.
>
> Kinematic = moves but doesn't get any collision response (it is not
> affected by impacts from other objects), but still will participate in
> the collision testing (can push away other objects, for example).
> Typically used for things that the user is manipulating. This is in
> order for the physics engine to not "freak out" because the object is
> moving differently than the physics expects it to.
>
> The reason for this type of division is optimization - e.g. two static
> objects never move, thus can never collide with each other and Bullet
> doesn't need to calculate such collision. Collision testing can be
> very expensive, that's why this optimization is there - to minimize
> the amount of calculation to be done.
>
> If you are getting a static-static collision, that either means that
> you haven't set the object type correctly for your moving objects or
> that you have two static objects overlapping - typically something
> like one piece of static decor (e.g. a building) overlapping another
> one (or even the ground!).
>
> >
> > Therefore I was under the impression only the collision library
> > (osgbCollision) would suffice my purpose. However I'm still missing
> > on something and unable to get it work.
>
> Bullet doesn't work like that. Even if you are using only the
> collision tests and not driving your objects using the physics
> simulation, you still must set up the object types correctly.
> Otherwise the collision engine will optimize the tests out or even
> fail with an error.
>
> In your case you must set the objects that you are moving as dynamic
> (perhaps kinematic) for the collisions to work. They cannot be all static.
>
> Regards,
>
> Jan
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.14 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iD8DBQFSiTgIn11XseNj94gRAixBAJ9PdzxAypWx4GU4x60gEmeXh27gSwCfZJEL
> Mefjrx+3c/ub8uxJeoxB7+8=
> =hH53
> -END PGP SIGNATURE-
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Collision detection using osgBullets

2013-11-17 Thread Mots G
Hi Paul,
I'm confused between static and dynamic objects. Does dynamic object mean
the rigid body dynamic object and the dynamic world? I thought dynamic
objects were only needed if I had to get inertia and motion states
properties to the objects. In my case I only need to test if the 3D models
collide among themselves so their movement(translations etc) could be
restricted.

Therefore I was under the impression only the collision library
(osgbCollision) would suffice my purpose. However I'm still missing on
something and unable to get it work.

Thanks
Mots


On Fri, Nov 15, 2013 at 12:32 AM, Paul Martz  wrote:

> My guess is that you've somehow created the collision shapes as static
> instead of dynamic. Bullet uses the static classification for objects that
> never move. If you have two objects that never move, Bullet will assume
> they never collide.
>
> Although I've done quite a bit of work in the past with Bullet and
> osgBullet, I would not consider myself a Bullet expert. This is really just
> a guess. Since the warning comes from Bullet, the Bullet forum might be a
> better place. osgBullet also has its own discussion group.
>
>
> On Thu, Nov 14, 2013 at 7:56 AM, Mots G  wrote:
>
>> Hi all,
>> I'm trying to use osgBullets in my application for collision detection.
>> The library comes with a sample example for detection between two
>> box-geodes.
>> I've modified it to use a cessna and a cow model and obtained a
>> 'btCollisionObject' by calling:
>>
>> *osgbCollision::btCompoundShapeFromOSGGeodes(cess_model,COMPOUND_SHAPE_PROXYTYPE
>> )*
>>
>> However, the collision detection does not happen and I'm unable to figure
>> out what's going wrong.
>> I also get a warning "warning btCollisionDispatcher::needsCollision:
>> static-static collision".
>>
>> Sorry for the noob question but I'm trying to get this feature in my app
>> and using the bullet/osgBullet library for the first time. Also I'm not
>> sure if this question belongs here or to another forum.
>> Inconvenience regretted.
>>
>> Best regards,
>> Mots
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
>
> --
> Paul Martz
> Skew Matrix Software LLC
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Collision detection using osgBullets

2013-11-14 Thread Mots G
Hi all,
I'm trying to use osgBullets in my application for collision detection. The
library comes with a sample example for detection between two box-geodes.
I've modified it to use a cessna and a cow model and obtained a
'btCollisionObject' by calling:

*osgbCollision::btCompoundShapeFromOSGGeodes(cess_model,COMPOUND_SHAPE_PROXYTYPE
)*

However, the collision detection does not happen and I'm unable to figure
out what's going wrong.
I also get a warning "warning btCollisionDispatcher::needsCollision:
static-static collision".

Sorry for the noob question but I'm trying to get this feature in my app
and using the bullet/osgBullet library for the first time. Also I'm not
sure if this question belongs here or to another forum.
Inconvenience regretted.

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


[osg-users] Delay in reading .obj models

2013-10-14 Thread Mots G
Hi,
I'm loading .obj models in my project and I noticed it takes enormous time
to do so. I converted the model from .obj to .osgt and saw the .osgt model
loaded within milli-seconds.

I found this post
(here)where a
user experienced similar problem and I also tried setting the
locale and various other settings suggested. However, none seemed to work.

Also mine is a Qt 4 app (Qt 4.8). However, when trying to load .obj models
in non qt app too, I noticed similar delay.]
I then downloaded osg 3.2.0 pre-compiled binaries and tried loading the obj
models and all worked like charm. Currently I'm using osg-3.1.5 but I don't
think much has changed in the plugin readers. I'm not sure what seems to be
causing this delay?

Anyone know a way of getting around this?

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


Re: [osg-users] Camera representing node

2013-10-08 Thread Mots G
Thank you so much Robert, will give it a try!

Cheers,
mots


On Tue, Oct 8, 2013 at 3:36 PM, Robert Osfield wrote:

> Hi Mots,
>
> It sounds like inserting osg::CameraView nodes within the subgraphs you
> wish to track, then using a osgGA::CameraViewSwitchManipulator would be the
> easiest way forward.
>
> Robert.
>
>
> On 8 October 2013 03:29, Mots G  wrote:
>
>> Hi,
>> I'm trying to add cameras to the scene (dropping models across the scene)
>> and the user could drag them or rotate them and change its parameters.
>> All works good for the first time, however, I lose track if the user
>> rotates the camera representing object. I'm banging my head with simple
>> math but I'm unable to figure out how the camera's center/up vector change
>> if the camera object rotates. I put the eye to where the node is translated
>> to.
>>
>> I tried to figure out the rotation angle so that I could initialize the
>> camera with the original parameters for the center and up and then apply
>> rotation to the model view matrix but it doesn't seem to make the camera
>> look at, in the correct direction. I'm using daggers for rotating and
>> translating the node.
>>
>> Tried looking at source for some manipulators but could not understand
>> much.
>>
>> Sorry for the noob question but would be glad if anyone could help.
>>
>> Thanks,
>> mots
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Camera representing node

2013-10-07 Thread Mots G
Hi,
I'm trying to add cameras to the scene (dropping models across the scene)
and the user could drag them or rotate them and change its parameters.
All works good for the first time, however, I lose track if the user
rotates the camera representing object. I'm banging my head with simple
math but I'm unable to figure out how the camera's center/up vector change
if the camera object rotates. I put the eye to where the node is translated
to.

I tried to figure out the rotation angle so that I could initialize the
camera with the original parameters for the center and up and then apply
rotation to the model view matrix but it doesn't seem to make the camera
look at, in the correct direction. I'm using daggers for rotating and
translating the node.

Tried looking at source for some manipulators but could not understand much.

Sorry for the noob question but would be glad if anyone could help.

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


Re: [osg-users] Saving scene-graph data with references to models

2013-08-23 Thread Mots G
Hi Robert,
Appears osg::ProxyNode is the way to go. I wasn't aware of it before -
sorry noob here :)
I tried a few samples and it does not embed the entire node data but just
the model path (as desired).

Thanks a lot!

Best regards,
Sumit


On Fri, Aug 23, 2013 at 4:04 PM, Robert Osfield wrote:

> Hi Sumit,
>
> I guess you could decorate all your external models with a ProxyNode, this
> kinda does what you are looking for, possibly...
>
> If not then you'll just need come up with your own scheme for exporting
> what parts of the scene graph you want to export and not others.
>
> Robert.
>
>
> On 23 August 2013 07:38, Mots G  wrote:
>
>> Hi Robert,
>>
>> Thanks for the prompt reply!
>>
>> I noticed it does not add the imagery data so textures get added as file
>> paths :)
>>
>> However, I want to avoid the model files (.3ds, .obj, .osgt) data getting
>> exported in the scene as it anyway resides on the server where the the
>> scene is getting passed ( only the transform node for the model with the
>> identifier of model file seems sufficient on the server end)
>>
>> With the model-data, the file size is huge and duplication of same model
>> being passed back to the server. I understand that the model once loaded is
>> a node (group/geode) and the  osgDB reader/writer plugin just traverses all
>> the nodes and serializes all the node properties.
>>
>> Is there a way I can achieve this?
>>
>> Best regards,
>> Sumit
>>
>>
>> On Fri, Aug 23, 2013 at 2:45 PM, Robert Osfield > > wrote:
>>
>>> Hi Sumit,
>>>
>>> By default the .osgt and .osgx won't save the imagery to the files so
>>> will just store the file paths to the original files.
>>>
>>> So just do:
>>>
>>>   osgDB::writeNodeFile(*mymodel, "myfile.osgt");
>>>
>>> Robert.
>>>
>>>
>>> On 23 August 2013 06:13, Mots G  wrote:
>>>
>>>> Hello all,
>>>> I'm trying to save the scene-graph to pass it across to a server. The
>>>> scene-graph may contain plenty models/materials/textures which were
>>>> initially fetched from the server.
>>>>
>>>> Is there a way I can save the scene-graph with only the relevant
>>>> information and not add to it the entire node for models/textures which
>>>> anyway reside on the server (but the transformations and positions). Also,
>>>> would it be possible to re-generate the scene using these references (the
>>>> reference could be entire path or some model-id associated on the server)
>>>>
>>>> I'm using the osgDB reader/writer extension to save the root as an
>>>> 'obj' format.
>>>>
>>>> Sorry I'm a noob to this and couldn't figure out.
>>>>
>>>> Thanks,
>>>> Sumit
>>>>
>>>> ___
>>>> osg-users mailing list
>>>> osg-users@lists.openscenegraph.org
>>>>
>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>>
>>>>
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Saving scene-graph data with references to models

2013-08-23 Thread Mots G
Hi Robert,

Thanks for the prompt reply!

I noticed it does not add the imagery data so textures get added as file
paths :)

However, I want to avoid the model files (.3ds, .obj, .osgt) data getting
exported in the scene as it anyway resides on the server where the the
scene is getting passed ( only the transform node for the model with the
identifier of model file seems sufficient on the server end)

With the model-data, the file size is huge and duplication of same model
being passed back to the server. I understand that the model once loaded is
a node (group/geode) and the  osgDB reader/writer plugin just traverses all
the nodes and serializes all the node properties.

Is there a way I can achieve this?

Best regards,
Sumit


On Fri, Aug 23, 2013 at 2:45 PM, Robert Osfield wrote:

> Hi Sumit,
>
> By default the .osgt and .osgx won't save the imagery to the files so will
> just store the file paths to the original files.
>
> So just do:
>
>   osgDB::writeNodeFile(*mymodel, "myfile.osgt");
>
> Robert.
>
>
> On 23 August 2013 06:13, Mots G  wrote:
>
>> Hello all,
>> I'm trying to save the scene-graph to pass it across to a server. The
>> scene-graph may contain plenty models/materials/textures which were
>> initially fetched from the server.
>>
>> Is there a way I can save the scene-graph with only the relevant
>> information and not add to it the entire node for models/textures which
>> anyway reside on the server (but the transformations and positions). Also,
>> would it be possible to re-generate the scene using these references (the
>> reference could be entire path or some model-id associated on the server)
>>
>> I'm using the osgDB reader/writer extension to save the root as an 'obj'
>> format.
>>
>> Sorry I'm a noob to this and couldn't figure out.
>>
>> Thanks,
>> Sumit
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Saving scene-graph data with references to models

2013-08-22 Thread Mots G
Hello all,
I'm trying to save the scene-graph to pass it across to a server. The
scene-graph may contain plenty models/materials/textures which were
initially fetched from the server.

Is there a way I can save the scene-graph with only the relevant
information and not add to it the entire node for models/textures which
anyway reside on the server (but the transformations and positions). Also,
would it be possible to re-generate the scene using these references (the
reference could be entire path or some model-id associated on the server)

I'm using the osgDB reader/writer extension to save the root as an 'obj'
format.

Sorry I'm a noob to this and couldn't figure out.

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