Re: [osg-users] [osgPlugins] Implementing ReaderWriter in a class within application binary

2010-09-19 Thread Robert Osfield
Hi Thomas,

In svn/trunk there is support for extensible native binary format, the
serialization scheme that underpins this also support reading/writing
to ascii and xml format as well.  This will of be part of the 2.9.9
I'll make next week.  The author of this work is Wang Rui, and he's
wirtten a number of posts of the list about it, as well as post an
explanation on the wiki so go have a search for background reading.
You'll also find examples of how to set up serializers in the
src/osgWrappers/serializers/* directories.

In previous stable versions of the OSG (i.e. 2.8.3 and before) there
is only the .ive native binary, but this isn't extensible so doesn't
support serialization of your own classes.

Robert.


On Fri, Sep 17, 2010 at 9:54 PM, Thomas Dickerson elfprinc...@gmail.com wrote:
 Hey everyone,
 Is it possible for osgDB to load classes implementing ReaderWriter 
 functionality out of my application binary, or must they be stored in a 
 separate .so in the plugin directory? If so, are there any special directions 
 I need to follow to get this working?

 Secondly, what is proper behavior for a plugin implementing only readNode 
 functionality? Do I leave writeNode unimplemented? Or should I implement 
 writeNode, but only return a WriteResult with a particular error status?

 Many thanks,
 Thomas

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





 ___
 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] Blending Multiple Texture on one triangle mesh with coordinate control

2010-09-19 Thread Robert Osfield
Hi Brian,

To do multi-texturing you simple need to assign a texture coordinate
array per texture unit you want to address, with a texture coord per
vertex.  So if you want two texture's you'll need to assign two
texture arrays.  The method to use is
osg::Geometry::setTextureCoordArray(unit, array).   Then you need to
set up with textures to use, which you use
osg::StateSet::setTextureAttributeAndModes(myTexture,
osg::StateAttribute::ON);

A good example of geometry setup can be found in osggeometry, this
doesn't do multi-texturing, but it does provide an code segment that
sets up the StateSet and Geometry for a single texture, this code
segment can easily be extended to do multi-texturing with the above
suggestions.  Another example that will be useful is osgmultitexture,
this does multi-texturing, but rather than use another texture coord
array it use tex gen to generate the coordinates.

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


[osg-users] Hint for appropriate export format?

2010-09-19 Thread Werner Modenbach
My application is creating a scene with standard Geodes (vertex arrays, normal 
arrays etc.)

I would like to export the 3D structure for further processing in external 
programs like ansys or to convert it in external converter programs into 
appropriate formats.

I was advised to use IGES as export format but I think it is rarely supported 
nowadays. What about VRML?

Is anybody out there who can give me some info for at least having a starting 
point?

Thanks for any hint and also many thanks to the osg team for the great work!

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


Re: [osg-users] Get objects nodes in *.obj file

2010-09-19 Thread John Kush
Hi,

There are 3 objects  in *.obj file. Is it possible to get their nodes in OSG in 
order to set different transformations?



Thank you!

Cheers,
John

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





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


[osg-users] Mac OSX and osgversion

2010-09-19 Thread Daryl Lee
Hi,

I just began familiarizing myself with OSG, and immediately ran into an 
installation problem.  I downloaded the OSG version 2.8.0 Mac OSX installer, 
since it was the most recent version with a Mac installer.  It seemed to 
install okay, and the two-pyramid starter project worked perfectly in XCode.  
But at the command line the programs osgversion, osglogo, and osgviewer 
(sections 1.2.5 and 1.3 of the Quick Start Guide) were all reported as not 
found.   I also ran find / -name osgversion and they failed to show up there, 
as well.  So are these three commands not implemented for the Mac?  If I 
rebuild a current version from source, will they be there?  (I'm not afraid to 
do that if it offers promise for benefit.)

Thank you!

Cheers,
Daryl

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





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


[osg-users] The problem of translucent dialog with MFC+OSG

2010-09-19 Thread Hunjun Lu
Hi,everyone

I have a program with VS2005+OSG2.8.2, use MFC SDI to display OSG 3D scene. 
When pick a certain object in 3D world, I want use a modeless dialog to show 
the infomation.
In the function of OnInitDialog, I do something below:

Code:
BOOL CDlgDataView::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE);// Set small icon

#define LWA_COLORKEY 0x0002
#define WS_EX_LAYERED 0x0008 

typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, 
COLORREF crKey, BYTE bAlpha, DWORD dwFlags); 

lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes; 

COLORREF maskColor=RGB(0,0,0);
HMODULE hUser32 = GetModuleHandle(user32.dll);
SetLayeredWindowAttributes = 
(lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32,SetLayeredWindowAttributes);
 


SetWindowLong(this-GetSafeHwnd(), GWL_EXSTYLE, 
GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE)|WS_EX_LAYERED); 

SetLayeredWindowAttributes(this-GetSafeHwnd(), maskColor, 192, 
LWA_COLORKEY); 
FreeLibrary(hUser32);

 return TRUE;  // return TRUE unless you set the focus to a 
control

}




when the information is on the top of the main window, it can not be seen.
How can I solve this problem?Thanks!

Cheers,
Hunjun

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




Attachments: 
http://forum.openscenegraph.org//files/transparence_191.jpg


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


Re: [osg-users] Hint for appropriate export format?

2010-09-19 Thread Trajce (Nick) Nikolov
Hi Werner,

the OpenFlight writer seam to work good, and lately there were improvements
posted for the 3ds as well. The first one format is pretty well supported in
the vis-sim, the later is well supported in 3D in general

-Nick


On Sun, Sep 19, 2010 at 4:34 PM, Werner Modenbach 
werner.modenb...@texion.eu wrote:

 My application is creating a scene with standard Geodes (vertex arrays,
 normal
 arrays etc.)

 I would like to export the 3D structure for further processing in external
 programs like ansys or to convert it in external converter programs into
 appropriate formats.

 I was advised to use IGES as export format but I think it is rarely
 supported
 nowadays. What about VRML?

 Is anybody out there who can give me some info for at least having a
 starting
 point?

 Thanks for any hint and also many thanks to the osg team for the great
 work!

 Werner
 ___
 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] [osgPlugins] Implementing ReaderWriter in a class within application binary

2010-09-19 Thread Thomas Dickerson
Hi Robert,

Thank you for the time you take to make your response, and the level of 
information you included in it. Unfortunately I think you may have 
misunderstood my original question. I was not inquiring about the possibility 
of serializing my own classes into the native binary format, but rather I was 
wishing to know whether a class that implements the ReaderWriter functionality 
(i.e. the readNode and writeNode methods present in all osgDB plugins) for a 
new format must be compiled into an external plugin (.so), or whether it can be 
incorporated directly into my application code, and compiled as part of my 
application binary. The instructions I was able to find on the wiki regarding 
plugin implementation is a bit sketchy, and only covered the possibility of 
helping the osgDB locate ReaderWriter plugins that are actually stored as 
external plugins and not compiled into my application.

Additionally I was wondering what proper plugin etiquette is for plugins that 
read a format, but do not also write to it. I noticed some plugins 
conditionally return a 
Code:
WriteResult(WriteResult::FILE_NOT_HANDLED);


My question on this second issue is whether it is better manners for my 
ReaderWriter class to implement a writeNode function that ALWAYS returns 
FILE_NOT_HANDLED, or whether it is best to just leave the function 
unimplemented.

Thanks,
Thomas

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





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


[osg-users] DatabasePager and CompileContext

2010-09-19 Thread Guy Volckaert
Hi,

I think there are a few problems with compiling GL objects with the 
DatabasePager (in OSG 2.8.2). The following topic sums it up pretty well:  


http://forum.openscenegraph.org/viewtopic.php?t=1032start=0postdays=0postorder=aschighlight=compilecontext

So far, I was able to compile all the GL object from a compile context (by 
calling DisplaySettings::setCompileContextsHint(true)). However, my scene 
appears all white. It seems that the texture objects are not created, or are 
created but invalid from the rendering context.

Any ideas?

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





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


Re: [osg-users] DatabasePager and CompileContext

2010-09-19 Thread Guy Volckaert
I noticed a huge discrepency between loading an FLT with and without the 
DatabasePager. 

Before loading any database model, the number of TextureObject created is 16.

When I load a model via readNode(), the number of TextureObjects created 
increases to 112 (for 96 textures objects for the model itself). 

However, when I load the same model from within the DatabasePager thread, then 
I get 173 TexureObjects created (157 TextureObjects for the model itself).

Essentially, I noticed that loading tiles from within the DatabasePager 
requires lots more texture memory (confirmed by using glDebugger).

Note: The StateSetManager is used the in the same manner for both cases.

Any ideas?

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





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


[osg-users] DatabasePager and TextureObjects

2010-09-19 Thread Guy Volckaert
I noticed a huge discrepency between loading an FLT with and without the 
DatabasePager. 

Before loading any database model, the number of TextureObject created is 16. 

When I load a model via readNode(), the number of TextureObjects created 
increases to 112 (for 96 textures objects for the model itself). 

However, when I load the same model from within the DatabasePager thread, then 
I get 173 TexureObjects created (157 TextureObjects for the model itself). 

Essentially, I noticed that loading tiles from within the DatabasePager 
requires lots more texture memory (confirmed by using glDebugger). 

Note: The StateSetManager is used the in the same manner for both cases. 

Any ideas?

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





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


[osg-users] No dynamic Model load

2010-09-19 Thread Theo Diefenthal
Hi,

we made a little driving simulator with different levels and we have a problem 
with dynamic loaded models from the ReaderWriter.

We'd like to load all models when the level is changed and the scenegraph is 
created. After loading the models into the scenegraph, the simulation should 
start.

When we just create the root node and attach it to our camera, the simulation 
starts and updates a few frames while the models still are loading.
Models which are not in the camera's field of vision when the level starts, are 
loaded, when tey are in the field of vision for the first time. This makes our 
simulation have a litte framerate per second for a moment

We tried to enable CACHING_ALL as ReaderWriter options and disabled the 
Optimizer for the graph, but it still doesn't work.


So do you have any suggestions how can we load all objects at the point the 
scenegraph is created? Do we have to set any property to the viewer/camera?

We are using osg 2.8.3.

Thank you!

Cheers,
Theo

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





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


Re: [osg-users] [build] Problem Building OSG 2.8.2 with CMake 2.8 and VS2008

2010-09-19 Thread Elliott Dicus
Hello,

Well, I realized I could use the precompiled version of osg for osgART... :-* 
(That worked great!)

I'd still like to know what I was doing wrong if anyone has any answers!

Good luck to anyone else using osg and osgART! :D

Thanks again,
Elliott

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





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