Re: [osg-users] [build] how to build basicGeometry example?

2009-10-29 Thread Mathieu MARACHE
Hi Thomas,

you need to do a couple of things, first take a copy of the
CMakeModules folder of OSG itself :
http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/CMakeModules

Then you need to tell CMake via your CMakeLists.txt where to find those

set(CMAKE_MODULE_PATH PATH_TO/CMakeModules;${CMAKE_MODULE_PATH})

# this will include and run CMakeModules/FindXXX.cmake
find_package(OpenThreads)
find_package(OSG)
include_directories(${OSG_INCLUDE_DIR})
project(testProject)
add_executable(testProjectMain
 main.cpp
)
target_link_libraries(testProjectMain ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY})

HTH

--
Mathieu
O ascii ribbon campaign - stop html mail - www.asciiribbon.org



2009/10/26 Thomas Maier in...@web.de:
 Hi,

 i used the source code on this site 
 http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/BasicGeometry,
  then i build test-src/ and test-build/ directories. Into test-src/ dir i put 
 in the file main.cpp with the example code. Then i created a CMakeLists.txt 
 file and put into it:
 PROJECT(testProject)
  ADD_EXECUTABLE(testProjectMain
   main.cpp
  )

 then i switched into test-build/ dir and run ccmake ../test-src/ then i run 
 make and the output is:
 Linking CXX executable /tmp/testProjectMain
 /usr/bin/cmake -E cmake_link_script CMakeFiles/testProjectMain.dir/link.txt 
 --verbose=1
 /usr/bin/c++   -g   CMakeFiles/testProjectMain.dir/main.o  -o 
 /tmp/testProjectMain -rdynamic
 CMakeFiles/testProjectMain.dir/main.o: In function `main':
 /home/bob/openscenegraph-programming/test/test-src/main.cpp:27: undefined 
 reference to `osgViewer::Viewer::Viewer()'
 /home/bob/openscenegraph-programming/test/test-src/main.cpp:28: undefined 
 reference to `osg::Group::Group()'


 How can i let cmake know that it should use osg header/libs? Is there 
 anywhere online a tutorial which explains the building of e.g. the examples? 
 i did not find anything,sorry.

 thanks for help
 flo




 Thank you!

 Cheers,
 inflo

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





 ___
 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] [build] how to build basicGeometry example?

2009-10-29 Thread J.P. Delport

Hi,

it seems like it found the headers and is breaking on linking.

I attach a CMakeLists.txt I use for simple test apps. It assumes OSG is 
installed and the linker can find it (e.g. mine is installed in 
/usr/local and /usr/local/lib is added in /etc/ld.so.conf).


You could also have a look at FindOSG module in the latest cmake versions.

jp

--8---
PROJECT(test)

#SET(CMAKE_CXX_COMPILER g++-3.4)

SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -g)
#SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -O2)

SET(SOURCES
test.cpp
)

INCLUDE_DIRECTORIES(/usr/local/include)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR})

ADD_EXECUTABLE(test ${SOURCES})

TARGET_LINK_LIBRARIES(test m osg osgUtil osgGA osgDB osgText osgSim 
osgParticle OpenThreads rt)


Thomas Maier wrote:

Hi,

i used the source code on this site 
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/BasicGeometry,
 then i build test-src/ and test-build/ directories. Into test-src/ dir i put 
in the file main.cpp with the example code. Then i created a CMakeLists.txt 
file and put into it:
PROJECT(testProject)
 ADD_EXECUTABLE(testProjectMain
   main.cpp
 )

then i switched into test-build/ dir and run ccmake ../test-src/ then i run 
make and the output is:
Linking CXX executable /tmp/testProjectMain
/usr/bin/cmake -E cmake_link_script CMakeFiles/testProjectMain.dir/link.txt 
--verbose=1
/usr/bin/c++   -g   CMakeFiles/testProjectMain.dir/main.o  -o /tmp/testProjectMain -rdynamic 
CMakeFiles/testProjectMain.dir/main.o: In function `main':

/home/bob/openscenegraph-programming/test/test-src/main.cpp:27: undefined 
reference to `osgViewer::Viewer::Viewer()'
/home/bob/openscenegraph-programming/test/test-src/main.cpp:28: undefined 
reference to `osg::Group::Group()'


How can i let cmake know that it should use osg header/libs? Is there anywhere 
online a tutorial which explains the building of e.g. the examples? i did not 
find anything,sorry.

thanks for help
flo




Thank you!

Cheers,
inflo

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





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] [vpb] Can I build a round earth with DEM?

2009-10-29 Thread J.P. Delport

Hi,

you can use vpbmaster instead of osgdem to make large earth DBs. I 
takes the same parameters.


You can use multiple DEM/texture sources in one command. E.g. see the 
command line used here:

http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/ExampleClusterJPD

You can also patch an existing DB:
http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/PatchExisting

Also search here for vpbmaster or just vpb:
http://news.gmane.org/gmane.comp.graphics.openscenegraph.user

jp

Lv Qing wrote:

Hi,

... 
 
I have created an earth model with VPB ( an ellipsoid with earth texture) by the instruction post in http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/osgdem. (osgdem --bluemarble-west -t land_shallow_topo_west.tif --bluemarble-east -t land_shallow_topo_east.tif -l 8 -o earth.ive -a earth.osga)  


Can I just add some small area of DEM in the suface  of this round earth?



Thank you!

Cheers,
Lv

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





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] multiple root graphs?

2009-10-29 Thread J.P. Delport

Hi,

Cory Riddell wrote:

I want to create a graph where some nodes have more than one parent, but
every parent node doesn't necessary have a non-backtracking path back to
the root node. Does this make sense? How about some bad ascii art:

A
|
B  C
| /
D

A has been designated as the root but there is a node C that isn't a
child of that root. Is this possible?


Do you want to render it with one camera? You could try modify the 
compositeviewer example and add A as the root node of one camera and C 
as the root of another and see what happens.


jp



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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] TerrainManipulator Questions

2009-10-29 Thread J.P. Delport

Hi,

Allen Saucier wrote:

Hi,

I'm trying to use the TerrainManipulator class and I am scratching my head.

Problem:
I use a patch of terrain w/in a simple program and the terrainmanipulator works 
great.

In another example of mine:
I then add a sky-dome by simply putting a sphere around the terrain and 
painted the sphere with a pic of the sky.
I then re-ran my application and the terrain manipulator basically stops 
zooming in once I get really close to the sphere which wraps my terrain.  At 
that point, I can NEVER get close to the terrain again, ever!

Does anyone know why?


AFAIK the manipulator intersects with what it thinks is the terrain and 
in your case the sphere you added is also intersected. You should try to 
get your sphere and terrain split so that only the terrain is used for 
intersection.




I even tried using the method, setNode(), w/in the terrain manipulator and that 
did not change things at all for me.


What did you pass to setNode?

jp



... 


Thank you!

Cheers,


Allen

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





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


[osg-users] How should I organize the scene graph to handle 2 million points and lines?

2009-10-29 Thread Angus Lau
Hi,

I am trying to build a viewer that can display millions of points and lines. 
How should I organize or structure the scene graph to maximize the performance 
and minimize the memory usage?

Thank you!

Cheers,
Angus

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





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


Re: [osg-users] How should I organize the scene graph to handle 2 million points and lines?

2009-10-29 Thread J.P. Delport

Hi,

how much of this dataset do you want visible at one time?

jp

Angus Lau wrote:

Hi,

I am trying to build a viewer that can display millions of points and lines. 
How should I organize or structure the scene graph to maximize the performance 
and minimize the memory usage?

Thank you!

Cheers,
Angus

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





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] runtime bug when loading obj model in OpenSceneGraph 2.8.2

2009-10-29 Thread Ulrich Hertlein

On 29/10/09 12:27 AM, Nguyen Tien Dat wrote:

texture. Do you need to compare all properties of each material in
order to find duplicate?


Everything except the name ;-D
Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] sRGB frame buffer

2009-10-29 Thread Tugkan Calapoglu
Hi,

I couldn't find sRGB related GLX tokens in the source code so it looks
like sRGB color space is not supported by OSG at the moment. Am I right
or did I miss something?

Does anybody here have experience with sRGB frame buffers under Linux
with NVidia hardware?

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


Re: [osg-users] First pass at Optional compile paths now checked in.

2009-10-29 Thread Robert Osfield
Hi Paul,

On Thu, Oct 29, 2009 at 1:25 AM, Paul Martz pma...@skew-matrix.com wrote:
 Thanks. Builds clean when set for GL3 on VS2009, at r10699.

Excellent.  So does this mean we've just the GL3 context to implement
to start test GL3 support... :-)

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


Re: [osg-users] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-29 Thread Michael Weber
Has no one ever done this before? ;)

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





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


Re: [osg-users] [osgOcean] Is it possible to combine the effect of osgOcean to the terrain model which is build by VPB?

2009-10-29 Thread Kim Bale
Hi Lv,

I've not used VPB so I don't know if it would work or not. osgOcean in
it's present state only renders a flat plane of ocean and if I
understand correctly there is an ellipsoid distortion involved in
large planet sized terrains. If you'd like to jump in and modify it to
work with vpb I'd be happy to assist, it would be a cool thing to
have.

Regards,

Kim.



2009/10/28 Lv Qing donlvq...@msn.com:
 Hi,

 ...
 I have build some terrain model by VPB(VirtualPlanetBuilder) which including 
 some area of ocean.Is it possible to combine the effect of osgOcean to the 
 terrain model which is build by VPB?

 Thank you!

 Cheers,
 Lv

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





 ___
 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] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-29 Thread J.P. Delport

I'm sure many people do. Maybe check how osgearth does it.

I think no one understood the problem/question well enough to help. 
Could you explain the exact problem, maybe some pictures :)


jp

Michael Weber wrote:

Has no one ever done this before? ;)

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





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] [osgOcean] Is it possible to combine the effect of osgOcean to the terrain model which is build by VPB?

2009-10-29 Thread Jean-Sébastien Guay

Hi Lv,


I have build some terrain model by VPB(VirtualPlanetBuilder) which including 
some area of ocean.Is it possible to combine the effect of osgOcean to the 
terrain model which is build by VPB?


VPB terrain, as long as it's not built in geocentric mode (i.e. as long 
as it's flat terrain), can be added as a child of the OceanScene just 
like any other terrain. VPB's LOD will work independently of osgOcean's 
LOD, but that shouldn't be a problem.


If your terrain is round-earth, then as Kim said osgOcean will not work 
with it in its current form. I don't know precisely what's needed to 
adapt it. I guess we'd need to get some kind of curvature information 
from the terrain model, and make the ocean follow this curvature?


If your terrain is flat, see the oceanExample in the osgOcean sources, 
it adds a terrain loaded from an .osg or .ive file (islands.ive I think) 
and adds it to the scene. You can do the same thing with your terrain.


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] Errors on svn trunk

2009-10-29 Thread Jean-Sébastien Guay

Hi Robert,


Hi Gusy,


I assume you meant Hi J-S since apart from the typo, Guay is my last 
name as you well know :-)



Was there are resolution to the build issue under VS?


There was no resolution needed, it seems that Paul had an incomplete 
update or had updated before you merged in Cedric's changes to the 
osgAnimation examples yesterday.


No error remains, all builds fine, only the bucketload of warnings 
remain and I'll try Thomas's suggestion, though I don't understand the 
implications (having not used virtual inheritance myself as I stated 
before).


I'll let you know.

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] Errors on svn trunk

2009-10-29 Thread Jean-Sébastien Guay

Hi Tom,


Try virtual public T in the derived class.


No effect, and I also tried adding virtual in the other places and that 
doesn't change anything either. Of course, removing virtual in the base 
class's inheritance of osg::Object results in errors about ambiguity, as 
expected.


Perhaps I'm not the best placed to fix this warning - I need to read up 
on virtual inheritance first. Anyone else have any ideas? Currently, 
building osgAnimation.lib results in 90 warnings of this sort, and 
building the osgAnimation examples gives 10 warnings each (for those 
that include the osgAnimation/UpdateCallback header).


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] Errors on svn trunk

2009-10-29 Thread Robert Osfield
On Thu, Oct 29, 2009 at 1:30 PM, Jean-Sébastien Guay
jean-sebastien.g...@cm-labs.com wrote:
 Hi Robert,

 Hi Gusy,

 I assume you meant Hi J-S since apart from the typo, Guay is my last name
 as you well know :-)

I actually meant Guys as in people :-)

 Was there are resolution to the build issue under VS?

 There was no resolution needed, it seems that Paul had an incomplete update
 or had updated before you merged in Cedric's changes to the osgAnimation
 examples yesterday.

 No error remains, all builds fine, only the bucketload of warnings remain
 and I'll try Thomas's suggestion, though I don't understand the implications
 (having not used virtual inheritance myself as I stated before).

 I'll let you know.

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


Re: [osg-users] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-29 Thread Michael Weber
Well, my programm is pretty much like the osgsimulation example. But instead of 
a aircraft which flies a constant route I use a model which flies an arbitrary 
trajectory.

For the positioning of the model I just use makeTranslate with the new X,Y,Z 
coordinates, which works as expected.

Now I try to rotate my model that way that it heads towards the direction it is 
flying. For the rotation I use makeRotate with the new position and the 
previous position (taken from here 
(http://forum.openscenegraph.org/viewtopic.php?p=16587#16587)).

But somehow it works not as expected. The model always looks somewhere else. So 
I suppose either I use the makeRotate in a wrong way or the rotation somehow 
depends on the position within the EllipsoidModel (maybe some conversion from 
world to local coordinates or vice versa?)

Any ideas?

Michael

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





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


Re: [osg-users] OSG and QT problem

2009-10-29 Thread Eric ZAREMBA
Hi,

 

I experiment this. I used an already displayed scene in another viewer. (I 
think you do not reload your nodes).

So, they are a marker in the osg::Texture which indicates to unref the image 
after apply.

I thinks it a save memory trick.

But in our case, the image does not exist anymore when the scene is set to the 
second view.

So, I wrote a visitor which look into each node of my graph and check the 
stateset.

I apply it just after loading before insert it in my scene.

 

So, my code:

// osg::StateSet* stateset = ...

osg::StateAttribute* attribute = NULL;

while( (attribute = stateset-getTextureAttribute(i, 
osg::StateAttribute::TEXTURE)) )

{

  ++i;

  osg::Texture* tex = dynamic_castosg::Texture*(attribute);

  if( tex )

tex-setUnRefImageDataAfterApply( false );

}

 

And all should work fine.

 

Eric Z.

 



De : osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] De la part de Maxim Gammer
Envoyé : jeudi 29 octobre 2009 12:41
À : OpenSceneGraph Users
Objet : [osg-users] OSG and QT problem

 

Hello,

There is one problem while using OSGViewer in QT:
first run of Widget goes just fine (1.jpg). After I close it and then create it 
again there is an incorrect picture (2.jpg).
There is a suspicious chancks in debug info (1.txt and 2.txt):
 returning cached instanced of - tells us that an object wasn't 
deleted. I closed widget though. 

At the first run there are following strings in debug, but they dissapear at 
second run:

--
RegisterWindowingSystemInterfa

ceProxy()
X11WindowingSystemInterface()
GraphicsContext::setWindowingSystemInterface() 0x1b26f200x7f39a7ccc890
---

The following strings appear at the moment when I delete OSGViewer:


Warning: deleting still referenced object 0x6b8d378 of type 
'PN3osg10ReferencedE'
 the final reference count was 2, memory corruption possible.



OSG 2.8.2.
QT 4.5.0

Where to dig for a solution? Thanx in advance.



-- 
Maxim Gammer

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


Re: [osg-users] Errors on svn trunk

2009-10-29 Thread Jean-Sébastien Guay

Hi Robert,


I actually meant Guys as in people :-)


Hah! Darn ambiguous typos... :-)

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] Errors on svn trunk

2009-10-29 Thread Paul Martz

Jean-Sébastien Guay wrote:
Perhaps I'm not the best placed to fix this warning - I need to read up 
on virtual inheritance first. Anyone else have any ideas?


It tends to be one of those dark corners of C++ where few developers 
tread. I once used this style of coding quite often, but found it 
confused developers too much, so I dropped its use. Consequently, I've 
forgotten most of what I once knew about it.


I'd recommend we not use this code style in OSG, if we can avoid it. It 
makes the code harder to understand. Can the class that derives from 
NodeCallback use the has a pattern instead?

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


Re: [osg-users] First pass at Optional compile paths now checked in.

2009-10-29 Thread Paul Martz

Robert Osfield wrote:

Excellent.  So does this mean we've just the GL3 context to implement
to start test GL3 support... :-)


That's one of the shovel-ready projects I've identified so far.

I also want to do some performance measurements between the old Geometry 
and the new Geometry.

   -Paul

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


Re: [osg-users] Errors on svn trunk (now: osgAnimation and virtual inheritance)

2009-10-29 Thread Jean-Sébastien Guay

Hi Paul,

I'd recommend we not use this code style in OSG, if we can avoid it. It 
makes the code harder to understand. Can the class that derives from 
NodeCallback use the has a pattern instead?


Only Cedric can answer that and perhaps refactor the code so that it 
doesn't use virtual inheritance.


Unless Robert makes the call that the code is fine, that he's OK with 
keeping it like that, and that he wants to disable the VC++ warning 
instead. Which is a perfectly fine option as long as all the pros and 
cons are weighed.


Robert? Cedric? Any chance you can join this discussion?

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] multiple root graphs?

2009-10-29 Thread Paul Martz

Cory Riddell wrote:

I want to create a graph where some nodes have more than one parent, but
every parent node doesn't necessary have a non-backtracking path back to
the root node. Does this make sense? How about some bad ascii art:

A
|
B  C
| /
D

A has been designated as the root but there is a node C that isn't a
child of that root. Is this possible?


Unless you've hidden some deeper question within your question, the 
answer is to simply do this:

  A-addChild( B );
  B-addChild( D );
  C-addChild( D );

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


Re: [osg-users] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-29 Thread J.P. Delport

Hi,

I'm guessing here, but I think you might be misunderstanding what the 
from and to parameters for makeRotate do. It creates a rotation from 
one _vector_ to another, not from one position to another (have a look 
at the makeRotate docs in osg::Quat). You could try to use a unit vector 
(to the nose of your model) as from and then now-previous as to, 
which should at least make your model point in the right direction, but 
this is still not enough info to get the roll of the model. IOW 
makeRotate cannot magically from 2 vectors figure out 3 rotations. If 
your model only rotates in a horizontal plane, then makeRotate would 
appear to work, but otherwise you'd be better off calculating 3 
rotations yourself.


jp

Michael Weber wrote:

Well, my programm is pretty much like the osgsimulation example. But instead of 
a aircraft which flies a constant route I use a model which flies an arbitrary 
trajectory.

For the positioning of the model I just use makeTranslate with the new X,Y,Z 
coordinates, which works as expected.

Now I try to rotate my model that way that it heads towards the direction it is 
flying. For the rotation I use makeRotate with the new position and the 
previous position (taken from here 
(http://forum.openscenegraph.org/viewtopic.php?p=16587#16587)).

But somehow it works not as expected. The model always looks somewhere else. So 
I suppose either I use the makeRotate in a wrong way or the rotation somehow 
depends on the position within the EllipsoidModel (maybe some conversion from 
world to local coordinates or vice versa?)

Any ideas?

Michael

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





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] TerrainManipulator Questions

2009-10-29 Thread Allen Saucier
Hi JP,

thanks for the idea.  I'd forgotten that about aspect of the Terrain 
Manipulator.  Hum, so I've got to get the Terrain Manipulator (TM) to actually 
intersect w/ the terrain node I really want instead of the sphere surrounding 
the terrain.

As for what I passed, I sent in the address of the terrain node and not the 
entire scene or the sphere node's address.  And I noticed that the _node 
variable should contain the address I sent to setNode and it so happens that 
that variable is used often in the call to intersect().  This is curious.  I 
will have to verify more completely that the address I sent in is what I think 
it is.

O, do you know when setByMatrix is called from w/in the rendering pipeline?  I 
truly don't entirely understand what OSG operations occur during the 
viewer.frame() sequence.

... 

Thank you!!!

Cheers,
Allen

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





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


Re: [osg-users] sRGB frame buffer

2009-10-29 Thread Jason Daly

Tugkan Calapoglu wrote:

Hi,

I couldn't find sRGB related GLX tokens in the source code so it looks
like sRGB color space is not supported by OSG at the moment. Am I right
or did I miss something?
  


I don't have any experience with sRGB framebuffers (apart from hearing 
about them at SIGGRAPH one year), but I agree that it looks like OSG 
doesn't support them yet.


--J

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


Re: [osg-users] TerrainManipulator Questions

2009-10-29 Thread J.P. Delport

Hi Allen,

Allen Saucier wrote:

Hi JP,

thanks for the idea.  I'd forgotten that about aspect of the Terrain
Manipulator.  Hum, so I've got to get the Terrain Manipulator (TM) to
actually intersect w/ the terrain node I really want instead of the
sphere surrounding the terrain.

As for what I passed, I sent in the address of the terrain node and
not the entire scene or the sphere node's address.  And I noticed
that the _node variable should contain the address I sent to setNode
and it so happens that that variable is used often in the call to
intersect().  This is curious.  I will have to verify more completely
that the address I sent in is what I think it is.

O, do you know when setByMatrix is called from w/in the rendering
pipeline?  I truly don't entirely understand what OSG operations
occur during the viewer.frame() sequence.


I think the viewer actually calls getInverseMatrix() on the current 
manipulator, but you'll have to double check. The manipulators update 
themselves (and the final matrix) based on events, see handle().


cheers
jp



...

Thank you!!!

Cheers, Allen

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






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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Suggestion: Add components in nodes (aggregation)

2009-10-29 Thread Ulrich Hertlein

Hi Sukender,

On 29/10/09 3:38 PM, Sukender wrote:

And once again, don't you think supporting metadata (Name, value) directly in 
the
osg::Object wouldn't be nice? Or could we code something like: if UserData is 
an
osg::Object (or another given type), read from/write to file using
UserData-serialize()/unserialize() in reader/writers?


Having the serialize/deserialize as part of the object isn't a good idea, because it 
doesn't allow you to deal with different formats, such as .osg and .ive?  This must be 
implemented in the respective plugin but for pure key/value pairs this could be added to 
the .osg and .ive plugins.


How about having a osg::KeyValue object derived from osg::Referenced so that it can be 
used as user-data?


That would also allow other plugins to return additional information, like an image loader 
to pass additional information (like description, fps, colourspace, and such) back to the 
application in a standard format.


On the other hand there is the problem with typing the contained data and name 
collisions...

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


Re: [osg-users] Errors on svn trunk (now: osgAnimation and virtual inheritance)

2009-10-29 Thread Cedric Pinson
Hi,

I found a fix to remove the ambiguous call. I will commit when checked
everything is correct.

Cheers,
Cedric 

-- 
+33 659 598 614  Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


On Thu, 2009-10-29 at 10:17 -0400, Jean-Sébastien Guay wrote:
 Hi Paul,
 
  I'd recommend we not use this code style in OSG, if we can avoid it. It 
  makes the code harder to understand. Can the class that derives from 
  NodeCallback use the has a pattern instead?
 
 Only Cedric can answer that and perhaps refactor the code so that it 
 doesn't use virtual inheritance.
 
 Unless Robert makes the call that the code is fine, that he's OK with 
 keeping it like that, and that he wants to disable the VC++ warning 
 instead. Which is a perfectly fine option as long as all the pros and 
 cons are weighed.
 
 Robert? Cedric? Any chance you can join this discussion?
 
 J-S


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Suggestion: Add components in nodes (aggregation)

2009-10-29 Thread Sukender
Hi Ulrich,

I agree putting serialization in the object breaks the reader/writer 
phylosophy. This is why the idea of Meta/Component/osg::KeyValue is nice. And I 
think this could be a few lines.

However I disagree with the name collisions problem: this should be an 
user-dependant implementation. Maybe some users won't care at all if names 
overlap? Core OSG may provide a few convenience features to help track 
duplicates, but not much more I think.

And what do you mean by the problem with typing the contained data?

Cheers,

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- Ulrich Hertlein u.hertl...@sandbox.de a écrit :

 Hi Sukender,
 
 On 29/10/09 3:38 PM, Sukender wrote:
  And once again, don't you think supporting metadata (Name, value)
 directly in the
  osg::Object wouldn't be nice? Or could we code something like: if
 UserData is an
  osg::Object (or another given type), read from/write to file using
  UserData-serialize()/unserialize() in reader/writers?
 
 Having the serialize/deserialize as part of the object isn't a good
 idea, because it 
 doesn't allow you to deal with different formats, such as .osg and
 .ive?  This must be 
 implemented in the respective plugin but for pure key/value pairs this
 could be added to 
 the .osg and .ive plugins.
 
 How about having a osg::KeyValue object derived from osg::Referenced
 so that it can be 
 used as user-data?
 
 That would also allow other plugins to return additional information,
 like an image loader 
 to pass additional information (like description, fps, colourspace,
 and such) back to the 
 application in a standard format.
 
 On the other hand there is the problem with typing the contained data
 and name collisions...
 
 Cheers,
 /ulrich
 ___
 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] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-29 Thread Michael Weber
Hi,

I forgot to say, that right now I don't care about the roll of the model. But 
the point is that it is not even heading in the right direction. Thats my top 
concern right now, but I just don't get it...

Michael

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





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


Re: [osg-users] multiple root graphs?

2009-10-29 Thread Cory Riddell
Paul Martz wrote:
 Cory Riddell wrote:
 I want to create a graph where some nodes have more than one parent,
 but
 every parent node doesn't necessary have a non-backtracking path
 back to
 the root node. Does this make sense? How about some bad ascii art:

 A
 |
 B  C
 | /
 D

 A has been designated as the root but there is a node C that
 isn't a
 child of that root. Is this possible?

 Unless you've hidden some deeper question within your question, the
 answer is to simply do this:
   A-addChild( B );
   B-addChild( D );
   C-addChild( D );

Well, I haven't actually tried it yet, but Gordon says none of the
traversal routines will ever see C. This makes sense to me. Is it wrong?

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


Re: [osg-users] Rotating models with respect to CoordinateSystemNode / EllipsoidModel

2009-10-29 Thread Svanur Palsson

Hi

You might want to use osg::Matrix::makeLookAt( to, from, upVector ) 
instead of osg::Quat::makeRotate.


Best regards,
Svanur


On 10/29/2009 03:24 PM, Michael Weber wrote:

Hi,

I forgot to say, that right now I don't care about the roll of the model. But 
the point is that it is not even heading in the right direction. Thats my top 
concern right now, but I just don't get it...

Michael

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





___
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] Suggestion: Add components in nodes (aggregation)

2009-10-29 Thread Ulrich Hertlein

Hi Sukender,

On 29/10/09 4:09 PM, Sukender wrote:

And what do you mean by the problem with typing the contained data?


The key/value map I have in mind only contains strings, but it would be nice to have typed 
data as well, like float.


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


Re: [osg-users] multiple root graphs?

2009-10-29 Thread Paul Martz

Cory Riddell wrote:

Unless you've hidden some deeper question within your question, the
answer is to simply do this:
  A-addChild( B );
  B-addChild( D );
  C-addChild( D );


Well, I haven't actually tried it yet, but Gordon says none of the
traversal routines will ever see C. This makes sense to me. Is it wrong?


But, the question you asked was in your original post was: how to create 
it and is it possible to create it? I think my code snippet answered 
that. :-)


Anyhow, I think Gordon over-generalized. You could use a CompositeViewer 
with multiple views, for example, one rendering the scene graph from 
root node A and one rendering from root node C. You could also write a 
NodeVisitor that uses the TRAVERSE_PARENTS traversal mode. So there are 
many cases where it's meaningful and useful in OSG to have multiple root 
nodes.


Ultimately, the question I'd direct back to you is: what are you trying 
to do, and why do you think that multiple root nodes would help?

  -Paul

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


Re: [osg-users] Errors on svn trunk (now: osgAnimation and virtual inheritance)

2009-10-29 Thread Cedric Pinson
Hi All,

I add code that remove the warning. Could you have a try on windows and
report if it's ok ?

Cheers,
Cedric

-- 
+33 659 598 614  Cedric Pinson mailto:cedric.pin...@plopbyte.net
http://www.plopbyte.net


On Thu, 2009-10-29 at 16:05 +0100, Cedric Pinson wrote:
 Hi,
 
 I found a fix to remove the ambiguous call. I will commit when checked
 everything is correct.
 
 Cheers,
 Cedric 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Suggestion: Add components in nodes (aggregation)

2009-10-29 Thread Sukender
The mini-system I developped contains a generic type T. For now, I support 
int, double, string, and date (I need a boost::local_time structure).

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- Ulrich Hertlein u.hertl...@sandbox.de a écrit :

 Hi Sukender,
 
 On 29/10/09 4:09 PM, Sukender wrote:
  And what do you mean by the problem with typing the contained
 data?
 
 The key/value map I have in mind only contains strings, but it would
 be nice to have typed 
 data as well, like float.
 
 Cheers,
 /ulrich
 ___
 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] [build] how to build basicGeometry example?

2009-10-29 Thread Thomas Maier
Hi,

thanks for the help. I am on debian there it seemed i must use lower-case 
find_package(osg), not OSG.

the line 
target_link_libraries(testProjectMain ${OSG_LIBRARY} ${OPENTHREADS_LIBRARY})

works with OpenThreads , but ${OPENTHREADS_LIBRARY} it cannot find


Thank you!

Cheers,
Thomas

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





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


Re: [osg-users] Errors on svn trunk (now: osgAnimation and virtual inheritance)

2009-10-29 Thread Paul Martz

Cedric Pinson wrote:

I add code that remove the warning. Could you have a try on windows and
report if it's ok ?


Builds cleanly on VS 2005.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466



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


Re: [osg-users] Rotating models with respect toCoordinateSystemNode / EllipsoidModel

2009-10-29 Thread Wojciech Lewandowski

Hi Michael,

I met at least few people who were using models in different coordinate 
frames so your results may vary. But assuming that your model is pretty 
standard: where forward points toward Y+, right points toward X+ and top 
points toward Z+, this piece of code could work for you.



osg::Matrixd ModelPositionCallback::calculatePositionMatrix(
  const osg::EllipsoidModel* ellipsoid,
  const osg::Vec3d newPosition, // in global coords (origin in ellipsod 
center)
  const osg::Vec3d oldPosition) // in global coords (origin in ellipsod 
center)

{
   // Math below may fail in Polar areas ( I hope you don't care bout them 
now)


   // First compute movement in coord system tangent to ellipsoid in 
oldPosition

   // Axes of this local coordinate system match world directions:
   //+X points towards east direction
   //+Y points towards north direction
   //+Z points toward  up direction
   osg::Matrixd localToWorld, worldToLocal;

  ellipsoid-computeLocalToWorldTransformFromXYZ( 
newPosition[0],newPosition[1],newPosition[2], localToWorld );

   worldToLocal = Matrix::inverse( localToWorld );

   osg::Vec3d newPosInNewPosLocalCoordSystem = osg::Vec3d( 0,0,0 ); // == 
newPosition * worldToLocal;

   osg::Vec3d oldPosInNewPosLocalCoordSystem = oldPosition * worldToLocal;

   osg::Vec3d moveInNewPosLocalCoordSystem = 
newPosInNewPosLocalCoordSystem - oldPosInNewPosLocalCoordSystem;


   // now the question is how your model is oriented does model nose point 
toward X+ or Y+ or (i hope its not Z+)?

#if 0
   // compass geographical heading measured clockwise from north is 
(radians):
   double heading = atan2( moveInNewPosLocalCoordSystem[0], 
moveInNewPosLocalCoordSystem[1] );

#else
   // but we rather need heading angle measured anticlockwise from X+ and 
it would be (note swapped coords )
   double heading = atan2( moveInNewPosLocalCoordSystem[1], 
moveInNewPosLocalCoordSystem[0] );

#endif

   // usually pitch in local tangent space can be computed like this 
(radians):

   double pitch = atan2( moveInNewPosLocalCoordSystem[2],
  hypot( moveInNewPosLocalCoordSystem[0], 
moveInNewPosLocalCoordSystem[1] ) );


#if 1 // I recommend to start initially with 0 pitch to be on safer side at 
the beginig - undef it later

   pitch = 0.0;
#endif

   // roll cannot be computed using odlPos and newPos only so I assume 0 
degrees

   double roll = 0.0;

   // Now it all depends on your model coordinate frame:
   // I am assuming your model nose points toward Y+ and its roof points 
toward Z+
   // Above means we need first to rotate its nose around Z+ by -90 degrees 
from Y+ to match X+ orientation


   osg::Matrix turnRight90DegreesClockwise =
   osg::Matrix::rotate( osg::DegreesToRadians( -90.0 ), osg::Vec3d( 
0,0,1 ) );


   osg::Matrix rotateToMatchLocalHeading =
osg::Matrix::rotate( heading, osg::Vec3d( 0,0,1 ) );// 
around Z+


   osg::Matrix rotateToMatchLocalPitch =
osg::Matrix::rotate( pitch, osg::Vec3d( 1,0,0 ) ); // 
around X+


   osg::Matrix rotateToMatchLocalRoll =
osg::Matrix::rotate( roll, osg::Vec3d( 0,1,0 ) );// around 
Y+


   // So the matrix without pitch and roll would be like this:
   osg::Matrixd matrix = turnRight90DegreesClockwise *
rotateToMatchLocalRoll *
rotateToMatchLocalPitch *
rotateToMatchLocalHeading *
localToWorld;

   return matrix;
}

HTH,  It comes from my head, I have not tested this. There is a chance I 
forgot something really important ;-)  But it should be clear eanough to 
understand the steps.

Wojtek Lewandowski

- Original Message - 
From: Michael Weber osgfo...@tevs.eu

To: osg-users@lists.openscenegraph.org
Sent: Thursday, October 29, 2009 2:45 PM
Subject: Re: [osg-users] Rotating models with respect toCoordinateSystemNode 
/ EllipsoidModel



Well, my programm is pretty much like the osgsimulation example. But 
instead of a aircraft which flies a constant route I use a model which 
flies an arbitrary trajectory.


For the positioning of the model I just use makeTranslate with the new 
X,Y,Z coordinates, which works as expected.


Now I try to rotate my model that way that it heads towards the direction 
it is flying. For the rotation I use makeRotate with the new position 
and the previous position (taken from here 
(http://forum.openscenegraph.org/viewtopic.php?p=16587#16587)).


But somehow it works not as expected. The model always looks somewhere 
else. So I suppose either I use the makeRotate in a wrong way or the 
rotation somehow depends on the position within the EllipsoidModel (maybe 
some conversion from world to local coordinates or vice versa?)


Any ideas?

Michael

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





___

Re: [osg-users] How should I organize the scene graph to handle 2 million points and lines?

2009-10-29 Thread Angus Lau
Hi,

Thank you for your help. I would like to show as many lines and points as 
possible at one time. Since some lines and points are clustered together, I am 
thinking about using LOD, PagedLOD, Impostor, or something similar to make 
culling and drawing take less time, but my viewer is actually an inspection 
tool. It is better to show as much details as possible. My viewer needs to 
support Pan, Zoom, Orbit, and Select.

The position of the lines and points are static but their colors are used for 
selection. My viewer allows the user to select one or more lines and points by 
changing their color. Right now, I am grouping chunks of lines in some 
osg::Geometry nodes and storing their colors in the color arrays. When the user 
select a line, for example, I will change the color of the line in the color 
array. Even though the grouping improve the viewer performance a lot, unrelated 
lines or points are now grouped together, making the scene graph inflexible to 
be used in other ways. Also, is changing the color to show the selection a bad 
idea? Other ways of showing the selected lines and points are fine, as long as 
I can improve the performance and the memory usage.

The lines and points also take up a lot of memory ( 1GB) in the scene graph. 
Large memory allocation may also be the cause of a long loading time for the 
data. Is there a way to reduce the memory usage for the scene graph?



Thank you!

Cheers,
Angus

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





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


Re: [osg-users] Rotating models with respect toCoordinateSystemNode/ EllipsoidModel

2009-10-29 Thread Wojciech Lewandowski

Let me fix broken formatting in former post:

osg::Matrixd ModelPositionCallback::calculatePositionMatrix(
  const osg::EllipsoidModel* ellipsoid,
  // in global coords (origin in ellipsod center)
  const osg::Vec3d newPosition,
  // in global coords (origin in ellipsod center)
  const osg::Vec3d oldPosition)

{
   // Math below may fail in Polar areas
   // ( I hope you don't care about them now)

   // First compute movement in coord system
   // tangent to ellipsoid in newPosition
   // Axes of this local coordinate system match world directions:

   //+X points towards east direction
   //+Y points towards north direction
   //+Z points toward  up direction
   osg::Matrixd localToWorld, worldToLocal;

  ellipsoid-computeLocalToWorldTransformFromXYZ
 ( newPosition[0],newPosition[1],newPosition[2],
   localToWorld );

   worldToLocal = Matrix::inverse( localToWorld );

   osg::Vec3d newPosInNewPosLocalCoordSystem =
  osg::Vec3d( 0,0,0 ); // == newPosition * worldToLocal;

   osg::Vec3d oldPosInNewPosLocalCoordSystem =
  oldPosition * worldToLocal;

   osg::Vec3d moveInNewPosLocalCoordSystem =
 newPosInNewPosLocalCoordSystem -
 oldPosInNewPosLocalCoordSystem;

   // now the question is how your model is oriented ?
   // does model nose point towards X+ or Y+ or (i hope its not Z+)?
   // I will further assume towards Y+
#if 0
   // compass geographical heading measured clockwise
   // from north is this (radians):
   double heading = atan2( moveInNewPosLocalCoordSystem[0],
  moveInNewPosLocalCoordSystem[1] );
#else
   // but we rather need heading angle measured
   // anticlockwise from X+ and it would be (note swapped coords)
   double heading = atan2( moveInNewPosLocalCoordSystem[1],
  moveInNewPosLocalCoordSystem[0] );
#endif

   // usually pitch in local tangent space can be computed
   // like this (radians):
   double pitch = atan2( moveInNewPosLocalCoordSystem[2],
   hypot( moveInNewPosLocalCoordSystem[0],
   moveInNewPosLocalCoordSystem[1]  
));


#if 1
   // I recommend to start initially with 0 pitch
   // to be on safer side at the beginig - undef it later
   pitch = 0.0;
#endif

   // roll cannot be computed using odlPos and newPos only
   // so I assume 0 degrees
   double roll = 0.0;

   // Now it all depends on your model coordinate frame:
   // I am assuming your model nose points toward Y+ and
   // its roof points toward Z+
   // Above means we need first to rotate its nose around Z+
   // by -90 degrees from Y+ to match X+ orientation

   osg::Matrix turnRight90DegreesClockwise =
   osg::Matrix::rotate( osg::DegreesToRadians( -90.0 ),
osg::Vec3d( 0,0,1 ) );

   osg::Matrix rotateToMatchLocalHeading =
osg::Matrix::rotate( heading,
 osg::Vec3d( 0,0,1 ) );

   osg::Matrix rotateToMatchLocalPitch =
osg::Matrix::rotate( pitch,
 osg::Vec3d( 1,0,0 ) );

   osg::Matrix rotateToMatchLocalRoll =
osg::Matrix::rotate( roll,
 osg::Vec3d( 0,1,0 ) );

   // So the matrix would be like this:
   osg::Matrixd matrix = turnRight90DegreesClockwise *
rotateToMatchLocalRoll *
rotateToMatchLocalPitch *
rotateToMatchLocalHeading *
localToWorld;

   return matrix;
}


WL

- Original Message - 
From: Wojciech Lewandowski lewandow...@ai.com.pl

To: osg-users@lists.openscenegraph.org
Sent: Thursday, October 29, 2009 6:41 PM
Subject: Re: [osg-users] Rotating models with respect
toCoordinateSystemNode/ EllipsoidModel



Hi Michael,

I met at least few people who were using models in different coordinate
frames so your results may vary. But assuming that your model is pretty
standard: where forward points toward Y+, right points toward X+ and top
points toward Z+, this piece of code could work for you.


osg::Matrixd ModelPositionCallback::calculatePositionMatrix(
  const osg::EllipsoidModel* ellipsoid,
  const osg::Vec3d newPosition, // in global coords (origin in ellipsod
center)
  const osg::Vec3d oldPosition) // in global coords (origin in ellipsod
center)
{
   // Math below may fail in Polar areas ( I hope you don't care bout them
now)

   // First compute movement in coord system tangent to ellipsoid in
oldPosition
   // Axes of this local coordinate system match world directions:
   //+X points towards east direction
   //+Y points towards north direction
   //+Z points toward  up direction
   osg::Matrixd localToWorld, worldToLocal;

  ellipsoid-computeLocalToWorldTransformFromXYZ(
newPosition[0],newPosition[1],newPosition[2], localToWorld );
   worldToLocal 

Re: [osg-users] TerrainManipulator Questions

2009-10-29 Thread Allen Saucier
Hi JP,

thanks so much!  I found a partial solution and I'm trying to understand why 
it works. hahahaha

but here's what I found:
1. I have 3 nodes in my scene @ startup: terrain, light, and a sphere wrapping 
my terrain.  All built/added to root node in that order.
2. the intersect routine found 3 points of intersection; once I choose the 3rd 
point, the manipulator allowed me to go-down-to the terrain!!!  Which is what 
I originally wanted.

O, I also had to duplicate the TerrainManipulator class, rename it and use it 
as my base class of CSceneMatrixManipulator because I had to over-ride the 
intersect() method to get it to do what I wanted it to do.  intersect() is not 
virtual in the base TerrainManipulator and every time I tried to alter it in a 
subclass of TM, my subclasse's method was never called.

Now I just have to figure out how to access the node from the intersect 
point, get it's name  verify I'm working with the terrain node and all will be 
great.  :D

Here's my code for giggles.

**
bool CSceneMatrixManipulator::intersect(const osg::Vec3d start, 
  const osg::Vec3d end, osg::Vec3d intersection) const
{
  std::coutMy Intersect\n;
osg::ref_ptrosgUtil::LineSegmentIntersector lsi = new 
osgUtil::LineSegmentIntersector(start,end);

osgUtil::IntersectionVisitor iv(lsi.get());
iv.setTraversalMask(_intersectTraversalMask);

_node-accept(iv);
if (lsi-containsIntersections())
{
  std::multiset  
osgUtil::LineSegmentIntersector::LineSegmentIntersector::Intersection 
::iterator itr=lsi-getIntersections().begin();
  std::cout # Intersects:= lsi-getIntersections().size()  
std::endl;
//  intersection = 
lsi-getIntersections().begin()-getWorldIntersectPoint(); // ori 102909 gas
  // When used w/ a SKY DOME/Sphere taht acts as a sky dome, need to skip
  //  that vertex point and goto the terrain beneath it, which should be 
the 
  //  next intersection point/vertex. gas 102909
  //
  itr++;
  if (itr!=lsi-getIntersections().end())
  {
std::cout got 2nd intersect point\n;
intersection = itr-getWorldIntersectPoint();
  }
  else
intersection = 
lsi-getIntersections().begin()-getWorldIntersectPoint();
  return true;
}
return false;
} // intersect

**

... 

Thanks again JP!

Cheers,
Allen

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





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


Re: [osg-users] runtime bug when loading obj model in OpenSceneGraph 2.8.2

2009-10-29 Thread Nguyen Tien Dat
Thanks. I'll do that.
Dat

On Thu, Oct 29, 2009 at 2:58 AM, Ulrich Hertlein u.hertl...@sandbox.de wrote:
 On 29/10/09 12:27 AM, Nguyen Tien Dat wrote:

 texture. Do you need to compare all properties of each material in
 order to find duplicate?

 Everything except the name ;-D
 Cheers,
 /ulrich
 ___
 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] How to take out and manipulate an object from an obj model

2009-10-29 Thread Nguyen Tien Dat
Dear all,
I have an obj model of a supermarket that contains thousand of
objects. I load the model into the scene graph as:
osg::Node* loadedModel = osgDB::readNodeFile(supermarket_new.obj);
Now I would like to take an object from the whole scene (a coke
bottle, for example) and manipulate it. I would imagine that if I can
scan though all the children of the node, and find one (by name for
example), then I can take the node and change the transform matrix to
manipulate it. But I don't know how.
So my question is:
- Is this possible to do what I want in OSG?
- If the answer is yes, could you tell me how?
Thanks,
Dat
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPPU] I have an OSG app to which I would like to add a second render pass...

2009-10-29 Thread Wyatt B. S. Earp
Hi,


I have an OSG app to which I would like to add a second render pass.  I render 
to a fbo hdr texture and I want to use a 2nd pass to process this texture, then 
write out to another hdr texture, then display.  Is this the sort of thing that 
osgPPU is meant for?  My app isn't a GPGPU app it is a visual render app.

Thank you!

Cheers,
Wyatt

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





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


[osg-users] Change to Optimizer OptimizationOptions

2009-10-29 Thread Paul Martz
Hi Robert -- The code submission by Wojciech and I for MSFBO has opened 
a small can of worms on declaring bits and bitmasks. I hope you can 
weigh in and put an end to the debate.


Originally, my submission followed the Optimizer's OptimizationOptions 
pattern of declaring bit values in an enum, but declaring the bitmask 
variable as an unsigned int.


In Wojciech's modified submission, he changed the bitmask variable to a 
signed int, with the reasoning that enum values are also signed ints, 
and this eliminates the need for a typecast to get rid of compiler warnings.


This caused me to weigh in with the workaround of declaring the bit 
values as static const unsigned int, and keeping the bitmask unsigned. 
But this goes against the OSG precedent set with the Optimizer.


The ensuing discussion has covered the merits, or lack thereof 
(depending on the poster) of declaring bitmasks as signed or unsigned.


What this really boils down to is: If we decide that the MSFBO 
bit/bitmask declarations should be different from the Optimizer pattern 
for bits and bitmasks, then we should change the Optimizer to follow the 
new standard, and also do the same for any other classes that followed 
the Optimizer's current pattern.


If you could post with do it this way or do it that way, I (for one) 
could get back to work and stop prodding everyone with my code style 
opinions. :-)


Thanks,
--
Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466

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


[osg-users] GL3 / GLES2 symbols

2009-10-29 Thread Paul Martz
Hi Robert -- I'm building against the GL3 header now, and many symbols 
are used in OSG that are deprecated in GL3, such as some of the TexGen 
symbols. So I checked to see what you do for the GLES2 case, and I found 
the following in the TexGen header:


#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
#define GL_OBJECT_LINEAR0x2401
#define GL_EYE_LINEAR   0x2400
#define GL_SPHERE_MAP   0x2402
#define GL_TEXTURE_GEN_S0x0C60
#define GL_TEXTURE_GEN_T0x0C61
#define GL_TEXTURE_GEN_R0x0C62
#define GL_TEXTURE_GEN_Q0x0C63
#endif

If I understand correctly, these are currently non-functional. You've 
just added the definitions so that you can compile and link, and you'll 
add TexGen later (presumably with the ShaderGen utility). Is that correct?


Should I do the same for GL3?
--
Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ http://www.skew-matrix.com/
+1 303 859 9466

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


[osg-users] VPBMaster Help

2009-10-29 Thread Jacob Armstrong

Robert,

 

Thanks again for your responses to my earlier posts. I've followed your 
suggestion and am in the process of setting up VPBMaster on my local PC, but 
I've still got the osgdem process running in a lab working on the 1879 bitmaps 
that I fed it 3 days ago, just to see what happens. I have to admit I've still 
got some faith in osgdem getting the job done, because a former co-worker of 
mine has used it in the past to generate samples of the Database I'm currently 
processing and he went up to 9 levels with this samples, to render them at 2 
Meters Per Pixel (I'm guessing it went to 9 levels because the last file 
generated was Test_L8_X248_Y66_subtile.ive and I know that it starts at Level 
0). This run took a few hours and resulted in the generation of 12,110 .ive 
files.

 

I feel like I should explain what I'm trying to accomplish with your tool, to 
justify my low-level questions. I work for a Flight Simulation company and am 
trying to generate a Tactical Map to be used on a Windows Machine. The Map 
contains an area of land approximately 1000kmx1000km, and we've decided to 
render them at a max resolution of 2MPP, supporting zoom in capability to 2MPP, 
and zoom out until the entire map is contained within the viewing window 
(approx. 1/2 of a 19 monitor with a screen resolution of 1280x1024). We had a 
sort of in-house OpenGL expert working on this for the past few months, and 
he recently left the company to be closer to family in another state. I'm the 
lucky guy who was chosen to pick up this task from him and become the new 
in-house expert. As I'm taking this task to uncharted territory, I'm running 
into issues that my former co-worker didn't quite anticipate. While he 
predicted that osgdem would process more than 10 levels-worth of .ive files, I 
don't think he anticipated the amount of time this would take. The process has 
been running for 79 hours now, and I've been checking the screen output 
frequently to see if I can get a feel for what's going on. I see that it's 
jumping back and forth between Levels 7, 8, and 9, and from looking at your 
code, this seems to make sense to me. It looks like your code divides the 
levels up into quadrants, and then evaluates each quadrant starting with the 
bottom left, then moving to bottom right, top left, and then top right. I also 
believe it goes down as far as it has to ('til it reaches the desired MPP), and 
then works its way back up using recursion. My guess is that it must do all of 
this processing before dataset-writeDestination() gets called, which I'm 
also guessing is the point when the .ive file generation/output will begin. 
This is the only explanation I could come up with for why no files have been 
generated after 79 hours. You said in an earlier response that osgdem isn't 
built to run through 9 levels, but that makes me wonder what is supposed to 
happen if I try? I've done some calculations, and it looks like if the process 
runs smoothly without interruption, it will complete in 4 more days, generating 
349,525 and will take up only 52GB of disk space. This is quite remarkable (as 
we originally anticipated 132GB-worth of output data), and I really hope that 
it will work out for us, however you've already stated that it's too much data 
for osgdem to handle.

 

As I stated above, I've looked into setting up vpbmaster as you suggested, but 
it seems to me like it would only feed my input to osgdem, still requiring 10 
levels-worth of .ive generation, so I'm not sure what would be the benefit of 
using vpbmaster. However, I'm certainly open to suggestions, so I would love to 
get that going. I've downloaded the source for VPBMaster, GDal, and libsquish, 
but unfortunately I find myself stuck when trying to build the load. I'm 
getting all kinds of errors with include files and .lib files and environment 
variables. I've already got OpenSceneGraph and it's dependencies built, so I'm 
wondering why I'm getting related errors. The only thing I can think of is that 
I don't have the directory structure set up properly. I'm having no luck 
finding any online documentation/instructions regarding the actual set-up of 
VPBMaster. Could you please help me figure out how to get it set up, and then 
I'd gladly pursue it as an alternative to using osgdem directly?

 

Again, I really appreciate the help you've provided and the time you've spent 
addressing my issues. I'm very impressed with your tools and the support that 
you personally provide to their users. We obviously want to leverage the 
abilities and powers of osgdem, and I believe we can develop a very nice 
Tactical Map if I could just get over the last couple hurdles.

 

Thanks again for your support!

Jake Armstrong

 

 

 

 

 
  
_
New Windows 7: Find the right PC for you. Learn more.

[osg-users] How do I simulate motion?

2009-10-29 Thread Ash Pat
Hi,

I'm trying to simulate a rigid body motion (translation and rotation) based on 
some Physics. Basically I have a number of bodies and a solve returns new 
positions for these bodies. I'd like to update the MatrixTransform associated 
with the bodies' nodes for each step which I'm hoping will show the motion.

Here's a snippet of a very simple example I tried.
pXform is a MatrixTransform 
pViewer is derived from osgViewer::Viewer and QGLWidget


Code:

for (int pos = 0; pos  80; pos+=10)
{
mat.set( 1, 0, 0, 0,
 0, 1, 0, 0,
 0, 0, 1, 0,
 0, pos, 0, 1);
pXform-setMatrix(mat);
pViewer-frame();
}



I'm seeing only the final position. How do I force the render for each step? I 
thought the frame() method would do it but it's not happening.

Any suggestions would be much appreciated.

Thanks!

Regards,
Ash.

PS: By the way, I used the [code] tag for the code snippet. Why are there weird 
'?' like characters where I had spaces?

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





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


Re: [osg-users] How do I simulate motion?

2009-10-29 Thread Jean-Sébastien Guay

Hi Ash,


for (int pos = 0; pos  80; pos+=10)


Here you're simulating 8 frames (0 to less than 80, in steps of 10, so 0 
to 70). On modern systems, depending on your geometry and your vsync 
settings, 8 frames should go by in about 0.13 seconds (if you have vsync 
on and are at a refresh rate of 60hz, and have a simple scene that does 
not break frame) or even less (if you have vsync disabled and have a 
very simple scene). So it's kind of normal that you only see the last 
frame, what you're actually seeing is all 8 frames too fast to see and 
then the render stops at the last frame.


To make a more significant test, try something like:

float frame = 0.0f;
while (!pViewer-done())
{
// set the matrix so that the object turns in circles,
// for example :
mat.setTrans(sin(osg::DegreesToRadians(frame)),
 cos(osg::DegreesToRadians(frame)),
 0.0);
pXform-setMatrix(mat);

frame++;
pViewer-frame();
}

(note, untested)

This will make the object go in a circle at a rate of about 1 degree per 
frame, which is a movement you'll be able to see, and it will loop 
around... the while (!pViewer-done()) means that the viewer will run 
until you press Esc (or close the window) which sets the viewer's done 
condition to true.


You can mess around with the increment to get different speeds, or even 
modify the speed based on the frame time so that it moves the same 
amount per second independently of frame rate. That's left as an 
exercise to the reader :-)


See the Quick Start Guide (free download) and the OSG wiki for more 
examples and information.


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] TerrainManipulator Questions

2009-10-29 Thread J.P. Delport

Hi,

Allen Saucier wrote:

Hi JP,

thanks so much!  I found a partial solution and I'm trying to
understand why it works. hahahaha

but here's what I found: 1. I have 3 nodes in my scene @ startup:
terrain, light, and a sphere wrapping my terrain.  All built/added to
root node in that order. 2. the intersect routine found 3 points of
intersection; once I choose the 3rd point, the manipulator allowed me
to go-down-to the terrain!!!  Which is what I originally wanted.

O, I also had to duplicate the TerrainManipulator class, rename it
and use it as my base class of CSceneMatrixManipulator because I had
to over-ride the intersect() method to get it to do what I wanted it
to do.  intersect() is not virtual in the base TerrainManipulator and
every time I tried to alter it in a subclass of TM, my subclasse's
method was never called.

Now I just have to figure out how to access the node from the
intersect point, get it's name  verify I'm working with the terrain
node and all will be great.  :D


Search for LineSegmentIntersector in osgkeyboardmouse and you will get 
an idea of how this can be done.


jp



Here's my code for giggles.

** bool CSceneMatrixManipulator::intersect(const osg::Vec3d
start, const osg::Vec3d end, osg::Vec3d intersection) const { 
std::coutMy Intersect\n; 
osg::ref_ptrosgUtil::LineSegmentIntersector lsi = new

osgUtil::LineSegmentIntersector(start,end);

osgUtil::IntersectionVisitor iv(lsi.get()); 
iv.setTraversalMask(_intersectTraversalMask);


_node-accept(iv); if (lsi-containsIntersections()) { std::multiset

osgUtil::LineSegmentIntersector::LineSegmentIntersector::Intersection
::iterator itr=lsi-getIntersections().begin(); std::cout #
Intersects:= lsi-getIntersections().size()  std::endl; //
intersection =
lsi-getIntersections().begin()-getWorldIntersectPoint(); // ori
102909 gas // When used w/ a SKY DOME/Sphere taht acts as a sky dome,
need to skip //  that vertex point and goto the terrain beneath it,
which should be the //  next intersection point/vertex. gas 102909 
// itr++; if (itr!=lsi-getIntersections().end()) { std::cout got

2nd intersect point\n; intersection = itr-getWorldIntersectPoint();
 } else intersection =
lsi-getIntersections().begin()-getWorldIntersectPoint(); return
true; } return false; } // intersect

**

...

Thanks again JP!

Cheers, Allen

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






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





--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] How do I simulate motion?

2009-10-29 Thread J.P. Delport

Hi,

your code only renders 8 frames, so you probably just miss the first 7.

try something like:
while (1) {
pos+=10;
if (pos80) pos=0;
...
}

to make an endless loop and you should then see stuff move.

jp

Ash Pat wrote:

Hi,

I'm trying to simulate a rigid body motion (translation and rotation) based on 
some Physics. Basically I have a number of bodies and a solve returns new 
positions for these bodies. I'd like to update the MatrixTransform associated 
with the bodies' nodes for each step which I'm hoping will show the motion.

Here's a snippet of a very simple example I tried.
pXform is a MatrixTransform 
pViewer is derived from osgViewer::Viewer and QGLWidget



Code:

for (int pos = 0; pos  80; pos+=10)
{
mat.set( 1, 0, 0, 0,
 0, 1, 0, 0,
 0, 0, 1, 0,
 0, pos, 0, 1);
pXform-setMatrix(mat);
pViewer-frame();
}



I'm seeing only the final position. How do I force the render for each step? I 
thought the frame() method would do it but it's not happening.

Any suggestions would be much appreciated.

Thanks!

Regards,
Ash.

PS: By the way, I used the [code] tag for the code snippet. Why are there weird 
'?' like characters where I had spaces?

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





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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] How should I organize the scene graph to handle 2 million points and lines?

2009-10-29 Thread J.P. Delport

Hi Angus,

Angus Lau wrote:

Hi,

Thank you for your help. I would like to show as many lines and
points as possible at one time. Since some lines and points are
clustered together, I am thinking about using LOD, PagedLOD,
Impostor, or something similar to make culling and drawing take less
time, but my viewer is actually an inspection tool. It is better to
show as much details as possible. My viewer needs to support Pan,
Zoom, Orbit, and Select.


firstly let me say there is no magic recipe, you will have to experiment.

grouping objects that are physically close would help with culling. OSG 
uses the bounding sphere to cull. Then again, if all your objects are 
always visible, there is no need for culling...


LOD could help by causing less draw for objects you are not interested 
in viewing in full detail, but are still in the FOV. PagedLOD would only 
help if you are not viewing your whole scene at any single moment, e.g. 
when you data cannot possibly fit into GPU mem, you view a subset.


You could try occlusion optimisations...



The position of the lines and points are static but their colors are
used for selection. My viewer allows the user to select one or more
lines and points by changing their color. Right now, I am grouping
chunks of lines in some osg::Geometry nodes and storing their colors
in the color arrays. When the user select a line, for example, I will
change the color of the line in the color array. Even though the
grouping improve the viewer performance a lot, unrelated lines or
points are now grouped together, making the scene graph inflexible to
be used in other ways. Also, is changing the color to show the
selection a bad idea? Other ways of showing the selected lines and
points are fine, as long as I can improve the performance and the
memory usage.


Yes, there is a trade-off between grouping and having control over fine 
grained state.


There are many ways... Instead of changing the colour array, you could 
try create multiple colour arrays and swap them (idea is to no upload 
data to the GPU every time). You could try 1D textures and swap. You 
could try shaders. You could just draw new lines/points showing 
selection. Have a look at compositeviewer cow.osg and click on the 
cow, it uses scribe effect.




The lines and points also take up a lot of memory ( 1GB) in the
scene graph. Large memory allocation may also be the cause of a long
loading time for the data. Is there a way to reduce the memory usage
for the scene graph?


You could try to share data as much as possible. You could potentially 
unreference data on the CPU side once it is uploaded.


Lots more tips here:
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/34498
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/45351
http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/31579
http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/47379

jp





Thank you!

Cheers, Angus

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






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





--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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