Re: [osg-users] [osgPlugins] OpenFlight-Plugin - How to store individual object in seperate geode?

2009-04-07 Thread Bulkhead
Hi Brede,

Thanks very much for the info. Yup, with osgconv, I managed to compare the 
source flt database and the coverted osg format. Seems like the objects are 
already merged in the flt database. So I guess I have to find a way to modify 
the source before loading it to osg  [Wink] 

Once again, thanks for your help.

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





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


Re: [osg-users] [osgPlugins] OpenFlight-Plugin - How to store individual object in seperate geode?

2009-04-06 Thread Brede Johansen
Hi Bulkhead,

I don't know about a reference manual but you have the source.  The
Optimizer header file is a good reference.
Yes, you typically create a custom visitor and set the permitted
optimization for the objects (node,stateset, drawable etc.) in question.
For the option parameter I would probably start with 0 before fine tuning.


To Paul:
Next time ;-)
I'm trying to keep up with the development of OSG.  You never know when it
may come in handy.


Regards
Brede


On Mon, Apr 6, 2009 at 6:04 AM, Bulkhead wgy...@gmail.com wrote:

 Hi Brede,

 Thanks for the reply.

 I did a search on the setPermissibleOptimizationsForObject() fucntion and
 read your posting on osg-users mail-archive, and yup, I think very high
 chance that this will solve my problem  [Wink]

 But unfortunately, I couldn't find any reference on how to use this
 function. The first parameter is an osg::Object pointer. Should I pass in
 every geode (using a geodeVisitor)? As for the second parameter, it will be
 all the optimization options, except MERGE_GEOMETRY?

 Also please advise if there's any reference manual that I can refer to? The
 one on osg wiki page doesn't give much info.

 Thanks in advanced.

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





 ___
 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] OpenFlight-Plugin - How to store individual object in seperate geode?

2009-04-06 Thread Bulkhead
Hi Brede,

Just some updates. I have glanced through the codes for the openflight plugin, 
and not sure if this is correct.

Using the preserveObject option, the openflight Object record will be stored 
in a osg::Group node. All the faces will be stored as osg::Geode under the 
respective group node. Is this correct?

By iterating through the groups, and collecting the geodes in each group, I 
managed to retrieve the land from my openflight terrain file. However, the 
buildings are still being grouped based on the texture (i.e. building with same 
texture are stored under the same group node). Is this how the openflight 
structure organize the record? Is it feasible to seperate these buildings?

Thanks in advanced.

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





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


Re: [osg-users] [osgPlugins] OpenFlight-Plugin - How to store individual object in seperate geode?

2009-04-06 Thread Brede Johansen
Bulkhead,

If you use osgconv to compare your OpenFlight structure with the OSG
structure (.osg) don't forget to set the environment variable
OSG_OPTIMIZER=OFF.  With the preserve??? reader options they should be
almost identical.

The reason OpenFlight faces becomes Geode+Drawable is because a drawable
can't store flight comments and billboard information.  If I remember
correct a long time ago the drawables couldn't even store the face id
because the drawables didn't have the name attribute.


Brede

On Mon, Apr 6, 2009 at 11:59 AM, Bulkhead wgy...@gmail.com wrote:

 Hi Brede,

 Just some updates. I have glanced through the codes for the openflight
 plugin, and not sure if this is correct.

 Using the preserveObject option, the openflight Object record will be
 stored in a osg::Group node. All the faces will be stored as osg::Geode
 under the respective group node. Is this correct?

 By iterating through the groups, and collecting the geodes in each group, I
 managed to retrieve the land from my openflight terrain file. However, the
 buildings are still being grouped based on the texture (i.e. building with
 same texture are stored under the same group node). Is this how the
 openflight structure organize the record? Is it feasible to seperate these
 buildings?

 Thanks in advanced.

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





 ___
 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] [osgPlugins] OpenFlight-Plugin - How to store individual object in seperate geode?

2009-04-03 Thread Bulkhead
Hi,

I'm new to the modelling world, and any help/advice is very much appreciated.

I'm using osg openflight plugin to load an flt terrain file. The terrain 
consists of a piece of land, and many buildings. What I am trying to achieve is 
loading the entire piece of land as one geode, and every building as individual 
geode.

After I have loaded the terrain into osg format, I noticed that the 
osgUtil::Optimizer will group some of the buildings that share the same texture 
into a single geode.

In order not to mess up with the original plugin codes (for ease of upgrading 
in the future), I disable the optimization by passing preserveFace option to 
the osgDB::readNodeFile() API, and invoke the optimizer in my loader codes. I 
have tried with different combinations of optimizer options, but couldn't find 
a combination that can produce the desired result  :( 

Here is the list of options that I have tried with:
SHARE_DUPLICATE_STATE
STATIC_OBJECT_DETECTION
MERGE_GEOMETRY (disabling this will blow my loader  [Embarassed] )
MERGE_GEODES
REMOVE_REDUNDANT_NODES
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS
SPATIALIZE_GROUPS
COPY_SHARED_NODES
TESSELLATE_GEOMETRY

Any suggestions? Am I in the correct direction? Or should I develop a visitor 
for this purpose?

Thank you in advanced  :) .

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





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


Re: [osg-users] [osgPlugins] OpenFlight-Plugin - How to store individual object in seperate geode?

2009-04-03 Thread Brede Johansen
Hi,

You can disable optimization of nodes with
Optimizer::setPermissibleOptimizationsForObject(const osg::Object* object,
unsigned int options)


Regards,
Brede


On Fri, Apr 3, 2009 at 11:06 AM, Bulkhead wgy...@gmail.com wrote:

 Hi,

 I'm new to the modelling world, and any help/advice is very much
 appreciated.

 I'm using osg openflight plugin to load an flt terrain file. The terrain
 consists of a piece of land, and many buildings. What I am trying to achieve
 is loading the entire piece of land as one geode, and every building as
 individual geode.

 After I have loaded the terrain into osg format, I noticed that the
 osgUtil::Optimizer will group some of the buildings that share the same
 texture into a single geode.

 In order not to mess up with the original plugin codes (for ease of
 upgrading in the future), I disable the optimization by passing
 preserveFace option to the osgDB::readNodeFile() API, and invoke the
 optimizer in my loader codes. I have tried with different combinations of
 optimizer options, but couldn't find a combination that can produce the
 desired result  :(

 Here is the list of options that I have tried with:
 SHARE_DUPLICATE_STATE
 STATIC_OBJECT_DETECTION
 MERGE_GEOMETRY (disabling this will blow my loader  [Embarassed] )
 MERGE_GEODES
 REMOVE_REDUNDANT_NODES
 FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS
 SPATIALIZE_GROUPS
 COPY_SHARED_NODES
 TESSELLATE_GEOMETRY

 Any suggestions? Am I in the correct direction? Or should I develop a
 visitor for this purpose?

 Thank you in advanced  :) .

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





 ___
 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