Re: [osg-users] CullingSet::computePixelSizeVector and AutoTransform

2011-08-16 Thread J.P. Delport

Hi,

I've probably asked the questions below at the wrong time of year. 
Anyone have any ideas/comments?


thanks
jp

On 06/07/2011 11:39, J.P. Delport wrote:

Hi all,

I'm having some issues with AutoTransform (scale to screen) and wide
aspect viewports. To reproduce do something like:

export OSG_WINDOW=0 0 800 600
osgautotransform

Then zoom out until only Autoscale with no min, max limits is visible.
Then make the aspect of the window larger/wider. You will see that the
size of the text gets smaller.

I've followed that AutoTransform uses CullStack-pixelSize() (to
determine its scale) and that this uses
CullingSet::computePixelSizeVector().

I can't quite follow the code in computePixelSizeVector, but noticed
that the scaleRatio depends on both horizontal and vertical scales, but
AFAIK OSG automatically adjusts the projection matrix so that only
vertical scale matters. If I change:

float scaleRatio =
0.7071067811f/sqrtf(scale_00.length2()+scale_10.length2());

into

float scaleRatio = 0.5/sqrtf(scale_10.length2());

then the osgautotransform example behaves like I would expect, i.e. the
text stays the same size no matter what the window aspect. I'm not sure
this is a solution though.

So my questions:
- What does the output of computePixelSizeVector represent? Can I write
in a matrix multiplation form? MVP*vec?
- Will it work for ortho projections?

thanks
jp

BTW, the text getting smaller for wide aspect is also present in the
osgtext example for the pixel_size_on_screen line.



--
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.


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


Re: [osg-users] [3rdparty] Osgearth with c++

2011-08-16 Thread Tha Pear
Hey,

You were right, it was unable to find the correct dlls.
I found I had not yet built the debug dlls of osgearth and was trying to run my 
own application in debug. Causing it to search for those debug dlls, whilst 
only the release dlls were available.

Thanks for the help,
ThaPear

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





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


[osg-users] Help required with OcclusionQueryNode

2011-08-16 Thread Revanth Reddy
Hi,

I guess I posted this in the wrong section previously. So sorry for the repost.

My application loads a scenegraph where all children are OcclusionQueryNodes 
and no geometry. Based on the spatial location of the camera I load and attach 
the geometry to the respective OQNode and set the Queries enabled for that 
OQNode. So at any time only a few OQNodes of my scenegraph have children 
attached and queries enabled. 

My problem is I am only able to render the scene when all the OQNodes have 
children. Nothing is visible even if one OQNode has no children. Can someone 
help me get past this ?
 
... 

Thank you!

Cheers,
Revanth

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





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


Re: [osg-users] QT-OSG problem

2011-08-16 Thread Thomas Borsos
Hi all!

I am currently working on an application, that includes

- an OSGViewer window, with a scene
- a QT window, where I would like to adjust parameters of the scene in the 
other window (in real time).

Both windows are handled in a different thread.

The problem is, that if I make a window of any type (QT or GTK) parallel to the 
OSG scene, some elements in the OSG scen just dissapear.

So, my questions are:

- Can anyone tell me a reason, why isn't the whole scene displayed? (I have 
already put together the simplest scene to exclude the most error sources)
- Is there any method, to run a QT window in a separate thread parallel to an 
OSG window?
- Is there any OSG-QT source code example for putting more (than one) OSGViewer 
in one QT window? How well can it be modified for my purposes?
- Did I make any mistakes?

Thank you very much in advance.

Thomas

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




Attachments: 
http://forum.openscenegraph.org//files/qtosgtar_177.gz


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


Re: [osg-users] QT-OSG problem

2011-08-16 Thread Werner Modenbach
Hi Thomas,

as far as I know Qt does not support painting in several threads.
Preparation of scene data in a separate thread is no problem. But the painting 
process must be the GUI-Thread.

- Werner -

 Hi all!
 
 I am currently working on an application, that includes
 
 - an OSGViewer window, with a scene
 - a QT window, where I would like to adjust parameters of the scene in the
 other window (in real time).
 
 Both windows are handled in a different thread.
 
 The problem is, that if I make a window of any type (QT or GTK) parallel to
 the OSG scene, some elements in the OSG scen just dissapear.
 
 So, my questions are:
 
 - Can anyone tell me a reason, why isn't the whole scene displayed? (I have
 already put together the simplest scene to exclude the most error sources)
 - Is there any method, to run a QT window in a separate thread parallel to
 an OSG window? - Is there any OSG-QT source code example for putting more
 (than one) OSGViewer in one QT window? How well can it be modified for my
 purposes? - Did I make any mistakes?
 
 Thank you very much in advance.
 
 Thomas
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=42074#42074
 
 
 
 
 Attachments:
 http://forum.openscenegraph.org//files/qtosgtar_177.gz
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-- 
TEXION Software Solutions

TEXION GmbH -  Rotter Bruch 26a  -  D 52068 Aachen - HRB 14999 Aachen
Fon: +49 241 475757-0, Fax: +49 241 475757-29, web: http://www.texion.eu

Geschäftsführer/Managing Director: Werner Modenbach
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] QT-OSG problem

2011-08-16 Thread Tom Pearce
Hi Thomas,

I think a bit more information would be useful.  Werner is correct about Qt 
paint events in that all QWidgets must be created in the QApplication thread 
and cannot be moved to any other threads.  If you're trying to use osg to 
render into a Qt-based window, this will be an issue.  However, it sounds like 
you have a completely separate osgViewer window.  In this case, you are doing 
exactly what we do in the project I work on - and it works fine.

Your description that some elements disappear isn't enough information for me 
to get an idea of what is happening.  Are these elements QWidgets, or something 
else?  I'm afraid where I am at the moment I don't have the tools to open your 
attached code, if you post some relevant code snippets in a message or just 
describe your application in more detail I may be able to help though. 

If you do Qt stuff in Qt gui windows, and have a scene graph of all non-qt 
stuff rendered in an osgViewer window, you should be totally fine - you just 
need to handle how you're updating your scene based on gui input in a 
threadsafe way. 


Cheers,
Tom

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





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


Re: [osg-users] QT-OSG problem

2011-08-16 Thread Martin Scheffler
I'm currently working on a better qt render thread integration that solves all 
these problems. It is already possible to open render windows from the render 
thread (using a qt blocking queued connection). Resize, minimize, close etc are 
communicated using signal-slot connections. The only requirement is that the 
render thread is a QThread.
 I am currently cleaning stuff up and searching for a weird bug, when that is 
done I will submit the stuff.

Cheers,
Martin

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





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


[osg-users] osg::Image Serialization

2011-08-16 Thread Jeremy Moles
Hello everyone; this is probably a question only a few people could
possibly, answer (Robert, Wang), but here goes:

I have created a derived osg::Image class (osgCairo::Image), and this
has worked just fine for the last few years. However, I want to add
strong serialization support for my nodekits, and I'm finding
customizing an Images behavior in the serialization code is quite
difficult.

Images are treated as special kinds of Objects, so any custom behavior
you might add confuses the base serializers, and there doesn't appear to
be any way to avoid this.

My question is: should the serialization backend be modified to support
osg::Image subclasses, or should programmers be encouraged NOT to derive
from osg::Image directly and instead create contains-a objects
instead?

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


Re: [osg-users] osg::Image Serialization

2011-08-16 Thread Jeremy Moles
On Tue, 2011-08-16 at 12:42 -0400, Jeremy Moles wrote:
 Hello everyone; this is probably a question only a few people could
 possibly, answer (Robert, Wang), but here goes:
 
 I have created a derived osg::Image class (osgCairo::Image), and this
 has worked just fine for the last few years. However, I want to add
 strong serialization support for my nodekits, and I'm finding
 customizing an Images behavior in the serialization code is quite
 difficult.
 
 Images are treated as special kinds of Objects, so any custom behavior
 you might add confuses the base serializers, and there doesn't appear to
 be any way to avoid this.
 
 My question is: should the serialization backend be modified to support
 osg::Image subclasses, or should programmers be encouraged NOT to derive
 from osg::Image directly and instead create contains-a objects
 instead?

As an addendum, this may simply be a misuse on my part.

Perhaps if someone is deriving from osg::Image, that person should also
consider creating a custom image type and, thus, writing an osgPlugin
for their image type to do the various kinds of extra stuff they need to
do.

For example, in osgCairo, though I may actually be using PNG data, I
could create a .cairo file type which will force my custom loader
instead of the default loader (which will allow me to do things like
pre-multiply the alpha, which Cairo expects internally).

Just thinking out loud here. :)

 ___
 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] osg::Image Serialization

2011-08-16 Thread Robert Osfield
Hi Jeremy,

I would have though it would be appropriate to support subclassing of
osg::Image in the serializers.  I'll defer to Rui to answer the
specifics of how we might go about this.

Robert.

On Tue, Aug 16, 2011 at 5:42 PM, Jeremy Moles jer...@emperorlinux.com wrote:
 Hello everyone; this is probably a question only a few people could
 possibly, answer (Robert, Wang), but here goes:

 I have created a derived osg::Image class (osgCairo::Image), and this
 has worked just fine for the last few years. However, I want to add
 strong serialization support for my nodekits, and I'm finding
 customizing an Images behavior in the serialization code is quite
 difficult.

 Images are treated as special kinds of Objects, so any custom behavior
 you might add confuses the base serializers, and there doesn't appear to
 be any way to avoid this.

 My question is: should the serialization backend be modified to support
 osg::Image subclasses, or should programmers be encouraged NOT to derive
 from osg::Image directly and instead create contains-a objects
 instead?

 ___
 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] [build] CMake fails to build for iOS from trunk

2011-08-16 Thread Joe Howse
Hi,

I am attempting to build OSG for iOS 4.3 using the latest source from trunk.  
My build environment is CMake 2.8.5 on Mac OS X 10.7 Lion, with all OSG 
dependencies installed via MacPorts.

My CMake build environment works for other projects, ex. OGRE for iOS.

To build OSG, I am using CMake like this:


Code:
cmake -G Xcode \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING=-ftree-vectorize -fvisibility-inlines-hidden 
-mno-thumb -arch armv6 -pipe -no-cpp-precomp -miphoneos-version-min=3.1 
-mno-thumb \
-D BUILD_OSG_APPLICATIONS:BOOL=OFF \
-D OSG_BUILD_FRAMEWORKS:BOOL=OFF \
-D OSG_WINDOWING_SYSTEM:STRING=IOS \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_OSX_ARCHITECTURES:STRING=armv6;armv7 \
-D 
CMAKE_OSX_SYSROOT:STRING=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk
 \
-D OSG_GL1_AVAILABLE:BOOL=OFF \
-D OSG_GL2_AVAILABLE:BOOL=OFF \
-D OSG_GLES1_AVAILABLE:BOOL=ON \
-D OSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
-D OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=ON \
-D OSG_GL_LIBRARY_STATIC:BOOL=OFF \
-D OSG_GL_MATRICES_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
-D DYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-D DYNAMIC_OPENTHREADS:BOOL=OFF \
my\path\to\OSG



CMake fails with the following CMakeError.log:


Code:
Compiling the CXX compiler identification source file CMakeCXXCompilerId.cpp 
failed.
Compiler: /usr/bin/g++ 
Build flags: 
-ftree-vectorize;-fvisibility-inlines-hidden;-mno-thumb;-arch;armv6;-pipe;-no-cpp-precomp;-miphoneos-version-min=3.1;-mno-thumb
Id flags: -c

The output was:
255
llvm-g++-4.2: error trying to exec 
'/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2': execvp: No such 
file or directory


Determining if the C compiler works failed with the following output:
Change Dir: /Users/Joe/SDKs/OpenSceneGraph/trunk/build/iOS/CMakeFiles/CMakeTmp

Run Build Command:/Applications/CMake\ 2.8-5.app/Contents/bin/cmakexbuild 
-project CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec 
-configuration Debug
** BUILD FAILED **


The following build commands failed:
Check dependencies
(1 failure)
=== BUILD NATIVE TARGET cmTryCompileExec OF PROJECT CMAKE_TRY_COMPILE WITH 
CONFIGURATION Debug ===
Check dependencies
target specifies product type 'com.apple.product-type.tool', but there's no 
such product type for the 'iphoneos' platform



As the log indicates, CMake is looking for:


Code:
/usr/llvm-gcc-4.2/bin/arm-apple-darwin11-llvm-g++-4.2



which does not exist.  (Also, iOS 4.3 corresponds to Darwin 10, not Darwin 11.) 
 For comparison, note that the following does exist:


Code:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-g++-4.2



I tried using a symlink to trick CMake into using the latter file.  However, in 
that case, CMake fails with the following CMakeError.log:


Code:

Compiling the CXX compiler identification source file CMakeCXXCompilerId.cpp 
failed.
Compiler: /usr/bin/g++ 
Build flags: 
-ftree-vectorize;-fvisibility-inlines-hidden;-mno-thumb;-arch;armv6;-pipe;-no-cpp-precomp;-miphoneos-version-min=3.1;-mno-thumb
Id flags: 

The output was:
1
ld: library not found for -lcrt1.3.1.o
collect2: ld returned 1 exit status


Determining if the C compiler works failed with the following output:
Change Dir: /Users/Joe/SDKs/OpenSceneGraph/trunk/build/iOS/CMakeFiles/CMakeTmp

Run Build Command:/Applications/CMake\ 2.8-5.app/Contents/bin/cmakexbuild 
-project CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec 
-configuration Debug
** BUILD FAILED **


The following build commands failed:
Check dependencies
(1 failure)
=== BUILD NATIVE TARGET cmTryCompileExec OF PROJECT CMAKE_TRY_COMPILE WITH 
CONFIGURATION Debug ===
Check dependencies
target specifies product type 'com.apple.product-type.tool', but there's no 
such product type for the 'iphoneos' platform



Please advise.

Thanks very much,

Joe[/code]

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





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


Re: [osg-users] SIGGRAPH 2011 OpenSceneGraph BOF

2011-08-16 Thread David Glenn
Greetings all who attended!

I had allot of fun and got allot of my 3.0 questions cleared up.
Thanks for attending J-S and thanks for John for M.C.ing  this BOF and the 
simulation BOF that I tried to attend before I got interrupted.
 
Nice to see you all and putting a face on some of you on the Forum.

I hope you all come to SIGGRAPH next year in my neighborhood! L.A. is a fun 
town to visit! 

FYI: Vancouver was allot of fun too in it's own way! I loved Tim Hortons - 
better than McDees! 
... 

Thank you!

D Glenn


D Glenn (a.k.a David Glenn) - Moving Heaven and Earth!

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





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


Re: [osg-users] Attempting X11 (lib issue) and Windows (GLfloat issue) compiles forOSG in Cygwin

2011-08-16 Thread Brian Keener
Skai Ware wrote:
 Hi Brian,
  Compiling OSG 3 with cygwin is perhaps today not feasible due
 to the objectives from cygwin team to remove the WIN32 define. 
 Have you tried to cmake OSG with
 cmake . -DCMAKE_LEGACY_CYGWIN_WIN32=1
 

Well that makes the X11 version perfectly with standard Cygwin 
installed and my one change to cmakelists.txt in osgViewer source.

Still cannot get it to build though with opengl32 and glu and build a 
non X11 but Windows version.  I get a lot of _gl. Undefined 
functions.

thanks

bk


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


Re: [osg-users] osg::Image Serialization

2011-08-16 Thread Wang Rui
Hi Jeremy and Robert,

In fact the osg::Image class can be derived and it is possible to
write serializers for the subclasses. In
osgWrappers/serializers/osg/ImageStream.cpp you will find an example
which has no difference from other serializers. I'm not sure if this
could work for osgCairo images, but I think a subclass that doesn't
change osg::Image's basic functionalities can work fine with
serializers at present.

After reviewing the source code, I think it also possible to replace
the readImage() and writeImage() in Input/OutputStream classes with an
Image serializer, too. I can't remember why I use special
reader/writer functions to handle images. Maybe it is only a
plagiarism of old osgDB::Input/Output class' methods. :-P

Cheers,

Wang Rui


2011/8/17 Jeremy Moles jer...@emperorlinux.com:
 Hello everyone; this is probably a question only a few people could
 possibly, answer (Robert, Wang), but here goes:

 I have created a derived osg::Image class (osgCairo::Image), and this
 has worked just fine for the last few years. However, I want to add
 strong serialization support for my nodekits, and I'm finding
 customizing an Images behavior in the serialization code is quite
 difficult.

 Images are treated as special kinds of Objects, so any custom behavior
 you might add confuses the base serializers, and there doesn't appear to
 be any way to avoid this.

 My question is: should the serialization backend be modified to support
 osg::Image subclasses, or should programmers be encouraged NOT to derive
 from osg::Image directly and instead create contains-a objects
 instead?

 ___
 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 get number of points and faces while osg reading in 3D models?

2011-08-16 Thread long yan
when i use:

node = osgDB::readNodeFile(cow.osg);


how can i get the number of points and faces in this model?

who can tell me ? Thanks a lot!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org