Re: [osg-users] dimension oh a model

2011-08-15 Thread Tomlinson, Gordon
That's why I still like Openflight Models they have their units it the
header :)
( Plus I can use Creator quite well :) )


One way I also solve this is to have a sidecar file that has the units
of the model(once known) if the format does not supported and then I
process the sidecar along with the model file etc. 


Gordon Tomlinson
3D Technical Product Manager 
Overwatch(r)
An Operating Unit of Textron Systems
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul
Martz
Sent: Friday, August 12, 2011 3:50 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] dimension oh a model

On 8/12/2011 11:11 AM, Sanat Talmaki wrote:
 Hi Paul,

 Sorry for my late reply to your post. That is a very good point you
bring up about the units of different objects in a scene. When one uses
data from USGS in VPB to create a terrain, the rest of the objects have
to be scaled up or down to represent their real world size prior to be
being used in the scene...

 But the confusion for me arises when say I load a truck in osg and its
dimensions are (12, 6, 8) = (L,W,H). (don't know what units these are
in)
 Without knowing the units of the model (whether 12 feet/meters), how
does one apply a scaling factor?
As I said in my previous post, if you don't have access to any metadata
that 
tells you what the units are, there's no way for your software to handle
this in 
an automated way. You must either manually scale the model to fit your 
application coordinate system, or you must manually create some
metadata. In the 
case you cite, both options would be based entirely on guesswork.
-Paul

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


Re: [osg-users] dimension oh a model

2011-08-12 Thread Sanat Talmaki
Hi Paul,

Sorry for my late reply to your post. That is a very good point you bring up 
about the units of different objects in a scene. When one uses data from USGS 
in VPB to create a terrain, the rest of the objects have to be scaled up or 
down to represent their real world size prior to be being used in the 
scene...

But the confusion for me arises when say I load a truck in osg and its 
dimensions are (12, 6, 8) = (L,W,H). (don't know what units these are in)
Without knowing the units of the model (whether 12 feet/meters), how does one 
apply a scaling factor?

I'm not sure if I have explained my point well enough. I can try and re-post if 
that is the case.

Thanks

Sincerely,
Sanat

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





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


Re: [osg-users] dimension oh a model

2011-08-12 Thread Paul Martz

On 8/12/2011 11:11 AM, Sanat Talmaki wrote:

Hi Paul,

Sorry for my late reply to your post. That is a very good point you bring up 
about the units of different objects in a scene. When one uses data from USGS 
in VPB to create a terrain, the rest of the objects have to be scaled up or 
down to represent their real world size prior to be being used in the 
scene...

But the confusion for me arises when say I load a truck in osg and its 
dimensions are (12, 6, 8) = (L,W,H). (don't know what units these are in)
Without knowing the units of the model (whether 12 feet/meters), how does one 
apply a scaling factor?
As I said in my previous post, if you don't have access to any metadata that 
tells you what the units are, there's no way for your software to handle this in 
an automated way. You must either manually scale the model to fit your 
application coordinate system, or you must manually create some metadata. In the 
case you cite, both options would be based entirely on guesswork.

   -Paul

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


Re: [osg-users] dimension oh a model

2011-08-12 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
I've had this problem before with models that are unit-less. I just
manually scaled the models (as Paul suggests) until they looked right
based on landmarks in the database where the sizes were known. It's an
empirical approach but it's the best you can really do if you don't know
the units of the model.

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul
Martz
Sent: Friday, August 12, 2011 1:50 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] dimension oh a model

On 8/12/2011 11:11 AM, Sanat Talmaki wrote:
 Hi Paul,

 Sorry for my late reply to your post. That is a very good point you
bring up about the units of different objects in a scene. When one uses
data from USGS in VPB to create a terrain, the rest of the objects have
to be scaled up or down to represent their real world size prior to be
being used in the scene...

 But the confusion for me arises when say I load a truck in osg and its
dimensions are (12, 6, 8) = (L,W,H). (don't know what units these are
in)
 Without knowing the units of the model (whether 12 feet/meters), how
does one apply a scaling factor?
As I said in my previous post, if you don't have access to any metadata
that 
tells you what the units are, there's no way for your software to handle
this in 
an automated way. You must either manually scale the model to fit your 
application coordinate system, or you must manually create some
metadata. In the 
case you cite, both options would be based entirely on guesswork.
-Paul

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


Re: [osg-users] dimension oh a model

2011-08-12 Thread Sanat Talmaki
Coincidentally that was the approach I was going to take:
Place some object of known size on my terrain and scale the unknown units 
object accordingly, sort of digitally 'eyeballing' it. This empirical approach 
seems to be the most appropriate way when dealing with objects of unknown units 
that need to be used with other objects/terrain of a known size ( units). 

Thanks

Sincerely,
Sanat

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





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


Re: [osg-users] dimension oh a model

2011-08-12 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
It has worked for us just fine in the absence of data.

Good luck with your effort...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Sanat
Talmaki
Sent: Friday, August 12, 2011 2:59 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] dimension oh a model

Coincidentally that was the approach I was going to take:
Place some object of known size on my terrain and scale the unknown
units object accordingly, sort of digitally 'eyeballing' it. This
empirical approach seems to be the most appropriate way when dealing
with objects of unknown units that need to be used with other
objects/terrain of a known size ( units). 

Thanks

Sincerely,
Sanat

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





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


Re: [osg-users] dimension oh a model

2011-08-09 Thread Sanat Talmaki
Hi David,

I guess I am replying to a rather old post, but I'll try my luck anyway:

Adding to your post on getting the size of the terrain, I had a similar 
question in mind. For a given terrain model (built using osgeart/vpb etc), is 
there a way to ensure that models loaded on the terrain conform to the scale of 
the terrain. If I loaded a building model onto a terrain, unless I knows the 
size of the terrain and the dimensions/scaling it is conforming to, my building 
model may be unrealistically big/small not representing reality.

I was searching along these lines and came across your post and just wanted to 
check if you had found any tool that helps you do this (getting terrain size) 

Thanks

Sincerely,
Sanat

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





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


Re: [osg-users] dimension oh a model

2011-08-09 Thread Paul Martz
In response to David's post (which I didn't see until now), it's fairly 
straightforward to back-transform a pixel into world coordinates. I've posted on 
this in the past, email me offline and I'll send you more info about it.


Sanat, one thing I learned in the GIS classes years ago is that you must be very 
careful to have all of your GIS data in the same projection/ellipsoid/units, or 
they won't mix well. If your buildings are too large, then perhaps they were 
modeled in feet and your Earth is modeled in meters, for example. If you don't 
have any meta data for the models to tell your application what coordinate 
system and units the model uses, there is no magic software trick to handle that 
situation. So you have two solutions: Either manually put all your models (Earth 
and buildings) into the same coordinate system and units, or manually ensure 
that each model contains the necessary metadata so that your application can 
transform them as needed into a common coordinate system and units.

   -Paul


On 8/9/2011 10:24 AM, Sanat Talmaki wrote:

Hi David,

I guess I am replying to a rather old post, but I'll try my luck anyway:

Adding to your post on getting the size of the terrain, I had a similar 
question in mind. For a given terrain model (built using osgeart/vpb etc), is 
there a way to ensure that models loaded on the terrain conform to the scale of 
the terrain. If I loaded a building model onto a terrain, unless I knows the 
size of the terrain and the dimensions/scaling it is conforming to, my building 
model may be unrealistically big/small not representing reality.

I was searching along these lines and came across your post and just wanted to 
check if you had found any tool that helps you do this (getting terrain size)

Thanks

Sincerely,
Sanat

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





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





--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/

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


[osg-users] dimension oh a model

2010-04-28 Thread daniele argiolas
Hi,
how can I retrieve the dimension of an OSG model loaded in the scene?

I see that with getBound().radius() I can retrieve informations about the 
BoundingSphere.

But I need also the three dimensions..

Thanks!

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





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


Re: [osg-users] dimension oh a model

2010-04-28 Thread Alberto Luaces
daniele argiolas writes:

 Hi,
 how can I retrieve the dimension of an OSG model loaded in the scene?

 I see that with getBound().radius() I can retrieve informations about the 
 BoundingSphere.

 But I need also the three dimensions..

Hi Daniele,

Assuming that no transformation nodes exist in the graph describing your
node, you can write a node visitor that joins all the bounding boxes of
every geode.

Else you'll need to modify every bounding box by its parent transforms
in order to join them.

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


Re: [osg-users] dimension oh a model

2010-04-28 Thread Jean-Sébastien Guay

Hi Daniele, Alberto,


Assuming that no transformation nodes exist in the graph describing your
node, you can write a node visitor that joins all the bounding boxes of
every geode.

Else you'll need to modify every bounding box by its parent transforms
in order to join them.


Actually you don't need to write this, it's so common that it exists in 
OSG already: osg::ComputeBoundsVisitor. And it does the right thing with 
transforms.


osg::ComputeBoundsVisitor cbbv;
node-accept(cbbv);
osg::BoundingBox bb = cbbv.getBoundingBox();
osg::Vec3 size = bb._max - bb._min;

// Then size contains the size in X, Y and Z.

Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   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


Re: [osg-users] dimension oh a model

2010-04-28 Thread Paul Martz

Jean-Sébastien Guay wrote:

Hi Daniele, Alberto,


Assuming that no transformation nodes exist in the graph describing your
node, you can write a node visitor that joins all the bounding boxes of
every geode.

Else you'll need to modify every bounding box by its parent transforms
in order to join them.


Actually you don't need to write this, it's so common that it exists in 
OSG already: osg::ComputeBoundsVisitor. And it does the right thing with 
transforms.


osg::ComputeBoundsVisitor cbbv;
node-accept(cbbv);
osg::BoundingBox bb = cbbv.getBoundingBox();
osg::Vec3 size = bb._max - bb._min;

// Then size contains the size in X, Y and Z.


For purposes of analyzing models, it's often useful to have access to this 
information from the command line. The osgWorks project 
(osgworks.googlecode.com) contains the osgwbvv application to display bounding 
volume information, either as a sphere or (using ComputeBoundsVisitor) as a box.


  osgwbvv cow.osg
  Sphere:
Center  0.776125 -0.43866 0
Radius  6.35558

  osgwbvv --box cow.osg
  Box:
Center  0.776125 -0.43866 0
Radius  6.35558
Extents 10.4439 3.40282 6.39676

The bounding volume (sphere or box) is also displayed graphically as line 
geometry around the model.


--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] dimension oh a model

2010-04-28 Thread Alberto Luaces
Paul Martz writes:

 Jean-Sébastien Guay wrote:
 Hi Daniele, Alberto,

 Assuming that no transformation nodes exist in the graph describing your
 node, you can write a node visitor that joins all the bounding boxes of
 every geode.

 Else you'll need to modify every bounding box by its parent transforms
 in order to join them.

 Actually you don't need to write this, it's so common that it exists
 in OSG already: osg::ComputeBoundsVisitor. And it does the right
 thing with transforms.

 osg::ComputeBoundsVisitor cbbv;
 node-accept(cbbv);
 osg::BoundingBox bb = cbbv.getBoundingBox();
 osg::Vec3 size = bb._max - bb._min;

 // Then size contains the size in X, Y and Z.

 For purposes of analyzing models, it's often useful to have access to
 this information from the command line. The osgWorks project
 (osgworks.googlecode.com) contains the osgwbvv application to display
 bounding volume information, either as a sphere or (using
 ComputeBoundsVisitor) as a box.

   osgwbvv cow.osg
   Sphere:
 Center  0.776125 -0.43866 0
 Radius  6.35558

   osgwbvv --box cow.osg
   Box:
 Center  0.776125 -0.43866 0
 Radius  6.35558
 Extents 10.4439 3.40282 6.39676

 The bounding volume (sphere or box) is also displayed graphically as
 line geometry around the model.

Hi J-S, Paul,

how could I have missed this! Thank you for the tips :)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] dimension oh a model

2010-04-28 Thread daniele argiolas
It works!!!

Thank you very much!
Daniele

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





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


Re: [osg-users] dimension oh a model

2010-04-28 Thread Paul Martz

Alberto Luaces wrote:

how could I have missed this! Thank you for the tips :)


OSG is big. :-)

--
  -Paul Martz  Skew Matrix Software
   http://www.skew-matrix.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] dimension oh a model

2010-04-28 Thread David Glenn

Paul Martz wrote:
 Alberto Luaces wrote:
 
  how could I have missed this! Thank you for the tips :)
  
 
 OSG is big. :-)
 
 -- 
 -Paul Martz  Skew Matrix Software
 http://www.skew-matrix.com/
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


Hi Paul and J-S!

While we are on the subject, let’s turn this inside out for a moment!  :? 

If say, I was looking at a chunk of the earth on a globe (Assuming that you 
have it dimensioned out properly) You know altitude your camera is from the 
surface (assuming that its the same as the theoretical ellipsoid) and you want 
to know the distance (width and height) of the territory you are covering (in 
the view of your camera) is there a function in OSG that does that?

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=27400#27400





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