[osg-users] How can I get the bounding box of an imported model?

2010-12-28 Thread Axel Spirtaat
Hi,

I need to place the imported model of a table on the floor of my virtual room. 
Since the table is longer and wider than high, the related boundingSphere 
radius is really imprecise and i can't place it correctly (i use also bullet 
for physics). 
Is it possible to get the bounding box of an object in any way? 
Since i need to decorate the room with many objects, this can result difficult 
only with the boundingSphere.

Thank you!

Cheers,
Axel

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





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


[osg-users] [build] Cannot load models

2010-12-28 Thread Norton Pigozzo
Hi,

I've been trying to load models using the osg::PositionAttitudeTransform class, 
since it has no constructors I have to make my own, but when I tried , a error 
message was displayed there is no base class.

Can anyone help me how to load a simple 3ds model with animations?


Thank you!

Norton

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





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


[osg-users] OpenSceneGraph Demos, Shadowing

2010-12-28 Thread Brit Clousing
Hi,

I was evaluating OpenSceneGraph, so I tried downloading some demos.  I 
downloaded openscenegraph-examples-2.8.2-win32-x86-vc90-Release.zip from [ URL 
REMOVED because the forums won't let me post a URL ] but none of the examples 
work because they're missing the dlls.  So, I downloaded 
openscenegraph-all-2.8.2-win32-x86-vc90-Release(2).zip from the same URL and 
figured out that I needed to copy the dlls from a different directory into the 
same directory as the exes.  Many of the examples don't work because they 
require command line arguments.

I specifically wanted to look at shadowing, so I ran the osgshadow.exe 
application.  The output looks like this:
img5.imageshack.us / img5 / 6517 / osgshadow1.png
Or this:
img526.imageshack.us / img526 / 84 / osgshadow2.png

(Oops. The forums won't let me post images or URLs yet.)

I don't know if this is because my graphics card isn't advanced enough (it's a 
low-end graphics card in a laptop).  It also looks like its trying to display a 
texture that's filled with random noise.  It also looks different each time I 
run it, and it changes from frame to frame.  Is there a texture file missing 
that didn't come with the zip?

So, I guess this post has two purposes: to suggest a better demo system so 
people can see the technology (or maybe I'm downloading the wrong files?) and 
to figure out why shadowing isn't working.

Thank you!

Cheers,
Brit

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





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


Re: [osg-users] How can I get the bounding box of an imported model?

2010-12-28 Thread Alberto Luaces
Axel Spirtaat writes:

 Hi,

 I need to place the imported model of a table on the floor of my virtual 
 room. Since the table is longer and wider than high, the related 
 boundingSphere radius is really imprecise and i can't place it correctly (i 
 use also bullet for physics). 
 Is it possible to get the bounding box of an object in any way? 
 Since i need to decorate the room with many objects, this can result 
 difficult only with the boundingSphere.

Use a Node Visitor to reach the available geodes in the model. Every
geode can be asked for its bounding box.

-- 
Alberto

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


Re: [osg-users] LOD::setRange crash

2010-12-28 Thread Vincent Bourdier
2010/12/26, issam boughanmi amigof...@gmail.com:
 Hi,
 using delta3d 2.4 +osg 2.8.2


 i have a pagedlod terrain built with vpb 0.9.10 (i think) and some other
 objects in my scene

 i have a crash in my application

 after switching to the debug mode the crash occur in this line


 Code:


 void LOD::setRange(unsigned int childNo, float min,float max)
 {
 if (childNo=_rangeList.size())
 _rangeList.resize(childNo+1,MinMaxPair(min,min));
 _rangeList[childNo].first=min;
 _rangeList[childNo].second=max;
 }


  of the lod.cpp file

 this happen when i load the pagedlod terrain

 what this mean ?

 before my application was unstable and i had crash sometime but now i have
 the crash every application load

 any help is welcome

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





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


-- 
Envoyé avec mon mobile
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How can I get the bounding box of an imported model?

2010-12-28 Thread Glenn Waldron
Try osg::ComputeBoundsVisitor.

Glenn Waldron : Pelican Mapping : +1.703.652.4791


On Tue, Dec 28, 2010 at 4:03 AM, Axel Spirtaat loginv...@gmail.com wrote:

 Hi,

 I need to place the imported model of a table on the floor of my virtual
 room. Since the table is longer and wider than high, the related
 boundingSphere radius is really imprecise and i can't place it correctly (i
 use also bullet for physics).
 Is it possible to get the bounding box of an object in any way?
 Since i need to decorate the room with many objects, this can result
 difficult only with the boundingSphere.

 Thank you!

 Cheers,
 Axel

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





 ___
 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] StandardShadowMap effect

2010-12-28 Thread Linda Lee
Hi Wojtek Lewandowski,

Thanks for your help.

I tried using ShadowMap and the effect is the same.  How do I check if my model 
is using texture coordinates on the same stage as shadow map (1 by default)?  I 
tried using ShadowTexture and the effect is okay.  But it seems that of all 
Shadow effects, only Shadow Texture seems to work on my machine.  I am using 
ATI Mobility Radeon HD 4330.  Is that an issue?

Thank you!

Cheers,
Linda

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





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


Re: [osg-users] StandardShadowMap effect

2010-12-28 Thread Wojciech Lewandowski

Hi Linda,

I tried using ShadowMap and the effect is the same.  How do I check if my 
model is using texture coordinates on  the same stage as shadow map (1 by 
default)?  I tried using ShadowTexture and the effect is okay.


Does osgshadow example look correct (using shadow map and default scene with 
rotating shapes) ?

Does it look correct when you load different model. ?

If they do, then your model could be the cause. Try converting your model to 
.osg format with osgconv utility.  Then load produced .osg file into text 
editor and look for 'textureUnit 1' sections. If you find one then it means 
your model does use the same stage as shadow map.


But it seems that of all Shadow effects, only Shadow Texture seems to work 
on my machine.  I am using ATI  Mobility Radeon HD 4330.  Is that an 
issue?


That could be the reason. Older ATI drivers were flipping shadow map 
texture. Install most recent Catalyst drivers you can find. I have old 
Radeon  X1250 in my laptop. Last Catalyst available for this board are rev 
10.2. And they seem to work correctly with shadow maps, but earlier 
revisions were a disaster. I am sure you will find fresher release than 10.2 
for your board.


Cheers,
Wojtek

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


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2010-12-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Deniz,

If you're using osgdem with the --geocentric flag set, you're building a
geocentric database which is correct.

Here's a code snippet that may help you position your camera on the spheroid
in geocentric space. It sets the view matrix for the camera given the lat,
lon and alt. Roll, pitch, and yaw are zero in this example which means you
will be flying level looking north.

osg::Matrixd vm;
ellipsoid-computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadia
ns(lat),
osg::DegreesToRadians(lon),
alt, vm);
vm.invert(vm);

osg::Matrixd rotation2YUp;
rotation2YUp.makeRotate(-M_PI_2, osg::Vec3f(1.0, 0.0, 0.0));
vm *= rotation2YUp;
view-getCamera()-setViewMatrix(vm);

Hope this helps...
-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of deniz
diktas
Sent: Monday, December 27, 2010 3:35 PM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] [vpb] geographic to geocentric coordinate
transformation

Hi,

I am using osgdem to generate a terrain from a set of dted-files in
geocentric coordinates. What I am trying to do next is to navigate the
camera along a path given in geographic coordinates (lat, long, alt).

However, when I try to convert a geographic coordinate (of which I am sure
from where the terrain is visible) to geocentric coordinates, and place my
camera there I do not get to see anything. I transform the coordinates using
osg:EllipsoidModel. 

I also realized that I am getting weird output results from the Ellipsoid
transformation: when I construct a bounding sphere bounding the whole
terrain (built in geocentric coord-sys) and test a point at the center of
the terrain (converted from geographic to geocentric coordinates) to see if
it is included in this bonding sphere, it turns out that this point in
geocentric coordinates is not included inside this bounding sphere - which
is a contradiction.

am I missing something when performing the transformation from geographic to
geocentric coordinates? 
are there other transformations I have to incorporate into my calculation? 
or am I building my terrain database with the wrong parameters ?

I use --geocentric option and I pass the root directory of all dted files. 
I use osg-version 2.9.5 and virtual-planet-builder-v11.

any help is greatly appreciated..

Thank you!

Cheers,
deniz

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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Shadows in large Urban area

2010-12-28 Thread Linda Lee
Dear all,

I am new to OSG and is thinking of implementing shadows in a large urban area 
with lots of buildings.  Could anyone tell me if this is feasible and what 
shadow tecnique should I used?  Or should I try to implement a customized 
shadow algorithm?  Would computation performance be an issue?

Any suggestions and advices would be most welcome.  

Thank you!

Cheers,
Linda

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





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


Re: [osg-users] StandardShadowMap effect

2010-12-28 Thread Linda Lee
Hi Wojtek Lewandowski,

I tried using cow.osg and have similar problem.  I tried download the driver 
from AMD website but the latest version they have is 10.12 and it seems to keep 
crashing after installed.  Do you think there is any work around using the ATI 
card like change the mapping method for the shadow texture?  Or should I keep 
to find another device or simply abandon this machine?

Thank you!

Cheers,
Linda

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2010-12-28 Thread deniz diktas
Hi Shayne,

thank you for your reply.
but the problem I am facing is related to the transformation.
But I will keep your suggestion in mind when placing the camera, so thanks 
again :)

The input to the application will be a flight-path given as a list of 
consecutive points in geographic coordinates which have to be transformed to 
geocentric coordinates (I also have orientation information of the airplane) 
but somehow the ellipsoid model fails to do it appropriately. I found another 
tool that transforms the coordinates correctly and I could see the terrain: so 
the problem seems to be solved for now.

But I cannot see how  why osgdem transforms it correctly but the ellipsoid 
model fails to do it. So I still would be glad if someone could tell me what 
the problem is..

deniz

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinatetransformation

2010-12-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Deniz,

Which method in EllipsoidModel were you using to do the transform from
(lat,lon,alt) to (X,Y,Z)?

Can you provide a code snippet on how you're doing the transform? Also
provide the actual osgdem command you're using to build your database...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of deniz
diktas
Sent: Tuesday, December 28, 2010 1:10 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [vpb] geographic to geocentric
coordinatetransformation

Hi Shayne,

thank you for your reply.
but the problem I am facing is related to the transformation.
But I will keep your suggestion in mind when placing the camera, so thanks
again :)

The input to the application will be a flight-path given as a list of
consecutive points in geographic coordinates which have to be transformed to
geocentric coordinates (I also have orientation information of the airplane)
but somehow the ellipsoid model fails to do it appropriately. I found
another tool that transforms the coordinates correctly and I could see the
terrain: so the problem seems to be solved for now.

But I cannot see how  why osgdem transforms it correctly but the ellipsoid
model fails to do it. So I still would be glad if someone could tell me what
the problem is..

deniz

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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2010-12-28 Thread deniz diktas
I am using osg::EllipsoidModel::convertLatLongHeightToXYZ() method to convert 
the coordinates as such:

osg:::EllipsoidModel em;
em.convertLatLongHeightToXYZ(_lat,_long,_alt, x,y,z);

when building the model I used osgdem with the following parameters:
osgdem --geocentric  -d  dted_dir  -o terrain.ive 

dted_dir contains dted files in a certain directory structure defined in 
dted-standard. I checked the validty of the dted with a commercial software, 
the geographic ranges are consistent with osgdem without --geocentric parameter 
(I looked at the contents of the height field of the first subtile:  lod=0) so 
there is no problem with the input file, I am sure of that.

-deniz

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





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


Re: [osg-users] StandardShadowMap effect

2010-12-28 Thread Wojciech Lewandowski

Hi Linda,

I tried using cow.osg and have similar problem.  I tried download the 
driver from AMD website but the latest version they have is 10.12 and it 
seems to keep crashing after installed.  Do you think there is any work 
around using the ATI card like change the mapping method for the shadow 
texture?  Or should I keep to find another device or simply abandon this 
machine?


Does osgshadow (without command line params ) crash ? If it does you may 
check if --SingleThreaded --window 10 10 800 600 options help. They do 
sometimes.
You may also try looking at earlier driver versions. I would check 10.8 
and/or 10.9. I believe  that with 10.9 or 10.10 ATI introduced  OpenGL 4.0 
support and this was a chance to break some stuff if it was not broken yet.


We still mainly use NVidia cards for OpenGL development and occasionaly 
switch to ATI to check if the code works there. AMD/ATI improved their 
OpenGL drivers recently but its clearly still not the same quality as on 
NVidia.


Cheers,
Wojtek

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


Re: [osg-users] [vpb] geographic to geocentric coordinatetransformation

2010-12-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
A couple more questions...

1) Are your lat, lon in radians when you call convertLatLongHeightToXYZ?
2) Have you tried viewing your database (terrain.ive) with osgviewer to see
what it looks like (osgviewer terrain.ive)? If you can't see your database
with osgviewer, then there's a problem with your database.

I use the exact same methods and my stuff works fine for viewing the terrain
given a lat,lon,alt with a geocentric database. As for osgdem, the only
difference is that I'm using a pagedLOD database and I'm using osgTerrain...

Here's the osgdem command I use...

osgdem --TERRAIN -PagedLOD --geocentric --whole-globe -t wholeearthtexture
-t texturedir -d elevationdir -l 24 -o geodatabase.ive

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of deniz
diktas
Sent: Tuesday, December 28, 2010 2:18 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [vpb] geographic to geocentric
coordinatetransformation

I am using osg::EllipsoidModel::convertLatLongHeightToXYZ() method to
convert the coordinates as such:

osg:::EllipsoidModel em;
em.convertLatLongHeightToXYZ(_lat,_long,_alt, x,y,z);

when building the model I used osgdem with the following parameters:
osgdem --geocentric  -d  dted_dir  -o terrain.ive 

dted_dir contains dted files in a certain directory structure defined in
dted-standard. I checked the validty of the dted with a commercial software,
the geographic ranges are consistent with osgdem without --geocentric
parameter (I looked at the contents of the height field of the first
subtile:  lod=0) so there is no problem with the input file, I am sure of
that.

-deniz

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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] Cannot load models

2010-12-28 Thread Torben Dannhauer
Hi,

you can't use the PAT for loading. You could instantiate a PAT node, then use 
the static load function of osgDB to load the model and add the loaded model 
than as a child to the PAT. Add finally the PAT to the viewer. Now you should 
be able to display the model and influence its PAT.



Cheers,
Torben

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinate transformation

2010-12-28 Thread deniz diktas
1) oops.. you are right! I am not passing them in radians  :-* 
ok I feel a little embarassed as of why I could not think of that  :x 
I guess because I always tend to think in terms of opengl logic: in opengl you 
pass angles in degrees. 

2) I have been able to see the terrain in osgviewer so no problem there..

Thank you so much Shayne, help greatly appreciated :)

best wishes!
deniz

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





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


Re: [osg-users] [vpb] geographic to geocentric coordinatetransformation

2010-12-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
I'm glad things are working for you...

-Shayne

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of deniz
diktas
Sent: Tuesday, December 28, 2010 4:25 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [vpb] geographic to geocentric
coordinatetransformation

1) oops.. you are right! I am not passing them in radians  :-* 
ok I feel a little embarassed as of why I could not think of that  :x 
I guess because I always tend to think in terms of opengl logic: in opengl
you pass angles in degrees. 

2) I have been able to see the terrain in osgviewer so no problem there..

Thank you so much Shayne, help greatly appreciated :)

best wishes!
deniz

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





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


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadows in large Urban area

2010-12-28 Thread Adrian Egli OpenSceneGraph (3D)
Hi Linda,

For such cases we have 2 reasonable shadow tecs:
- Light Space Shadow Maps
- Parallel Splited Shadow Maps

did you tried out this both with osgShadow.exe -pssm  or with
osgShadow -lispsm ...

Adrian

2010/12/28 Linda Lee zenith...@hotmail.com:
 Dear all,

 I am new to OSG and is thinking of implementing shadows in a large urban area 
 with lots of buildings.  Could anyone tell me if this is feasible and what 
 shadow tecnique should I used?  Or should I try to implement a customized 
 shadow algorithm?  Would computation performance be an issue?

 Any suggestions and advices would be most welcome.

 Thank you!

 Cheers,
 Linda

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





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




-- 

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