Re: [osg-users] osgconv.exe textures getting mangled

2017-01-03 Thread Rambabu Repaka
Hi,How to avoid the Fatal nb colors error in texture images.

... 

Thank you!

Cheers,
Rambabu

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





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


Re: [osg-users] osgconv.exe textures getting mangled

2017-01-03 Thread Rambabu Repaka
Hi,4 Texture images are loading  remaining texture images are not loading to 
the model what i have to do ?

... 

Thank you!

Cheers,
Rambabu

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





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


[osg-users] How to draw 3D cylinder and 3D band?

2017-01-03 Thread Daven Hem
Happy New Year, everybody!

I’m Daven Hem, OSG beginner in Cambodia.
I want to draw 3D cylinder and 3D band which is made from centered line.
I have two problems I have to solve with OpenSceneGraph.

Create a 3D line which is defined by N vertices.
-   Create a 3D cylinder which is defined by 3D line.
Its section is radial. Users can change the radius of its section.
-   Create a 3D band which is defined by 3D line.
Its section is rectangular. Users can change width and height of its 
section.
In some cases, its section is also line. Users can change only width.

These 3D cylinder and band are created along the 3D line. 3D line should be 
laid center in these geometry.
Just for your information, the green solid geometry is 3D band, and you see 3D 
cylinder in the middle of that in the following screenshot.

Thank you!

Cheers,
Daven

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




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


Re: [osg-users] Draw vertex as Circle with color given by some Vec4 array

2017-01-03 Thread Trajce Nikolov NICK
Hi Bruno,

As I am recalling how this is to be done is something like this:

Let say you want to pass colors as vertex attributes:

const size_t vertexAttribLocation = 5;

osg::Vec4Array* colors = new ...
osg::Geometry* geometry = new ...

geometry->setVertexAttribArray(vertexAttribLocation
,colors,osg::Array::BIND_PER_VERTEX);

osg::Program* program = new ...
program->addBindAttribLocation("colors", vertexAttribLocation );

and then in your GLSL you just call it by the name "colors"

#version 120
attribute vec4 colors;
void main(void) 

you do the same for the radius and you may do it for the vertices itself
although based on your GLSL version you can use gl_Vertex too

Hope this helps
Nick



On Mon, Jan 2, 2017 at 11:10 PM, Bruno Oliveira <
bruno.manata.olive...@gmail.com> wrote:

> Hi Nick,
> thanks for your answer. I read the osgvertexattributes.cpp example and did
> not quite get it at first. Do you know if there are any further
> documentation or snippets I could read?
>
> Or maybe if you have quick snippets it could spare me some valuable time.
>
> 2017-01-02 20:56 GMT+00:00 Trajce Nikolov NICK <
> trajce.nikolov.n...@gmail.com>:
>
>> Hi Bruno,
>>
>> yes, you can pass VertexAttributes to the program and look them up in the
>> shader. You can pass the centers as Vec3Array, Vec4Array for colors and
>> probably encode the radius into float array or the vertex.w() from the
>> vertex array.
>>
>> Do a search through the examples for how to set up your program with
>> VertexAttributes ... Ping me if you if troubles, I might be able to give
>> some snippets
>>
>> Cheers,
>> Nick
>>
>> On Mon, Jan 2, 2017 at 8:21 PM, Bruno Oliveira <
>> bruno.manata.olive...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>>
>>> I have an array of 3d points that I want to render in a scene. I want to
>>> render them as circles, centered on each point coordinates, with a given
>>> radius and a color that is given by a color array I have in memory.
>>>
>>> For now, I am creating a node for each point, that consists of a
>>> PrimitiveSet (polygon) that I iterate around the point center. (Check code
>>> below).
>>>
>>>
>>> Now I know this can be done with Shaders. I can draw the circle directly
>>> in the fragment shader with this example (http://www.geeks3d.com/201307
>>> 05/shader-library-circle-disc-fake-sphere-in-glsl-opengl-glslhacker/).
>>>
>>> But I need to pass the vertex centers and respective colors. Is it
>>> possible to pass a osg::Vec3Array* with vertex centers and a
>>> osg::Vec4Array* of colors directly to a Shader, so that I can , in a single
>>> compiled Shader program, handle all point positions and colors?
>>>
>>> Here is teh code for drawing the circle, I use this for each vertex:
>>>
>>> osg::Vec3Array* getArray(const float radius, const int points, const
>>> osg::Vec3& center) {
>>> auto array = new osg::Vec3Array();
>>> const float ratio = (float(2.0*osg::PI) / float(points));
>>> for (int i = 0; i < points; i++) {
>>> const float angle = float(i) * ratio;
>>> array->push_back(osg::Vec3(
>>> center.x() + radius*cosf( angle ),
>>> center.y() + radius*sinf( angle ),
>>> center.z())
>>> );
>>> }
>>> return array;
>>> }
>>>
>>> osg::Geometry* getGeometry(const float radius, const int points, const
>>> osg::Vec3& center) {
>>> osg::Geometry* geom = new osg::Geometry();
>>>
>>> geom->setVertexArray(getArray(radius, points, center));
>>> geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,
>>> 0, points));
>>>
>>> return geom;
>>> }
>>>
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>> cenegraph.org
>>>
>>>
>>
>>
>> --
>> trajce nikolov nick
>>
>> ___
>> 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
>
>


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


Re: [osg-users] Check if sampler2D is valid in fragment shader

2017-01-03 Thread Alberto Luaces
"Rômulo Cerqueira" writes:

> Hi Sebastian,
>
> I have used the last openscenegraph stable package in ubuntu (version
> 3.2.3 - https://launchpad.net/ubuntu/+source/openscenegraph), and
> there is no setDefine() method in osg::StateSet (only for 2.4 and
> newer). There is a different way?
>

Hi Rômulo, you also have OSG 3.4 available in Yakkety (current stable)
under a slightly different name:

https://launchpad.net/ubuntu/+source/openscenegraph-3.4

-- 
Alberto

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


Re: [osg-users] Check if sampler2D is valid in fragment shader

2017-01-03 Thread Rômulo Cerqueira
Hi,


> 
> I can create a minimal example if you're stuck with this. 
> 


I will appreciate this, please.
... 

Thank you!

Cheers,
Rômulo

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





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


Re: [osg-users] osgconv.exe textures getting mangled

2017-01-03 Thread Jan Ciger
On Tue, Jan 3, 2017 at 1:49 PM, Rambabu Repaka 
wrote:

> Hi,Iam using osg 3.5.1 version Textures are not loading to the model it is
> showing  Warning: [ReaderWriterOBJ::convertElementListToGeometry] Some
> faces from geometry '' were reversed by the plugin.I converted the model
> into .osgb format but textures are not adding to the model.
>

Do you have the textures correctly applied to your model? I.e. you need the
.mtl file with your .obj and the texture needs to be in the path specified
in the .mtl

Second, the error message about reversed faces means that your model has
inconsistent winding order (clockwise vs anticlockwise). You should check
that because it could mean that your normals will be wrong and faces get
removed/culled by backface culling, making the model either disappear or
have "holes".

Conversion to .osgb won't help you any, because the converter uses the same
obj loader as the viewer. So if it doesn't work with the viewer, it won't
work after the conversion neither.

Regards,

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


Re: [osg-users] About raining

2017-01-03 Thread Jan Ciger
On Tue, Jan 3, 2017 at 1:57 PM, Rambabu Repaka 
wrote:

> Hi,How to do Wet on the ground when raining in osg ?
>


Ehm, I am not quite sure what do you mean, but I assume that you want to
render wet ground. A big of googling would find this, for example:
https://www.fxguide.com/featured/game-environments-partc/

That should get you started. You will need to write your shaders to provide
the effect you are after. OSG is a scenegraph and doesn't contain every
possible visual effect - but it will let you implement it relatively easily.

If you don't want/can't write this yourself, I suggest you look at engines
like Unity3D or Unreal for your project instead - both have a lot of
plugins and a marketplace where you can buy pre-made tools for almost
anything you want.

Regards,

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


Re: [osg-users] Check if sampler2D is valid in fragment shader

2017-01-03 Thread Sebastian Messerschmidt

Hi, yes there is:

Simply assign one Program with shaders handling texturing and the 
non-texturing variant at the appropriate state-sets. Be sure to share 
the programs (don't create a new one per instance) to keep performance up.


I can create a minimal example if you're stuck with this.

Cheers
Sebastian

Hi Sebastian,

I have used the last openscenegraph stable package in ubuntu (version 3.2.3 - 
https://launchpad.net/ubuntu/+source/openscenegraph), and there is no 
setDefine() method in osg::StateSet (only for 2.4 and newer). There is a 
different way?

Cheers,
Rômulo

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





___
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] Check if sampler2D is valid in fragment shader

2017-01-03 Thread Christian Buchner
Pragmatic shader composition was added to the repository around Feb 13,
2015, and most likely into OSG 3.4 and newer only.

A link to the relevant thread started by Robert Osfield is here:
http://markmail.org/message/mjxjn4vujpvz3wfz#query:+page:1+mid:vogwv7uwhoefcln6+state:results


2017-01-03 14:48 GMT+01:00 Rômulo Cerqueira :

> Hi Sebastian,
>
> I have used the last openscenegraph stable package in ubuntu (version
> 3.2.3 - https://launchpad.net/ubuntu/+source/openscenegraph), and there
> is no setDefine() method in osg::StateSet (only for 2.4 and newer). There
> is a different way?
>
> Cheers,
> Rômulo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69840#69840
>
>
>
>
>
> ___
> 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] Check if sampler2D is valid in fragment shader

2017-01-03 Thread Rômulo Cerqueira
Hi Sebastian,

I have used the last openscenegraph stable package in ubuntu (version 3.2.3 - 
https://launchpad.net/ubuntu/+source/openscenegraph), and there is no 
setDefine() method in osg::StateSet (only for 2.4 and newer). There is a 
different way?

Cheers,
Rômulo

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





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


[osg-users] About raining

2017-01-03 Thread Rambabu Repaka
Hi,How to do Wet on the ground when raining in osg ?

... 

Thank you!

Cheers,
Rambabu

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





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


Re: [osg-users] osgconv.exe textures getting mangled

2017-01-03 Thread Rambabu Repaka
Hi,My Texture image files are in .png and .jpeg format.

... 

Thank you!

Cheers,
Rambabu

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





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


Re: [osg-users] osgconv.exe textures getting mangled

2017-01-03 Thread Rambabu Repaka
Hi,Iam using osg 3.5.1 version Textures are not loading to the model it is 
showing  Warning: [ReaderWriterOBJ::convertElementListToGeometry] Some faces 
from geometry '' were reversed by the plugin.I converted the model into .osgb 
format but textures are not adding to the model.

... 

Thank you!

Cheers,
Rambabu

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





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


[osg-users] code for merging tri strips in a cache friendly way

2017-01-03 Thread Christian Buchner
When loading .obj files (e.g. exported from Blender) into OSG - especially
those that are exported with the "group by material" option - you might
find a lot of individual tri strips in the resulting OSG geometry.

Here is a piece of code (a node visitor) that will join these tri strips
into a single large strip, taking into account cache locality aspects: The
tri strips are sorted by their median vertex index before joining. This can
be useful to improve the performance of hardware instancing.

Some C++11 language features may be used in the code (range based for and
others). Feel free to modify/use/improve on this code.

Christian

/**
 * A visitor that merges triangle strip drawables by creating some
degenerate triangles.
 */
class TriStripMergeVisitor : public osg::NodeVisitor
{
public:

TriStripMergeVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}

virtual void apply(osg::Node& node)
{
traverse(node);
}

virtual void apply(osg::Geode& node)
{
for(unsigned int i=0;i(&drawable);
if (geo != NULL) apply(*geo);
}

virtual void apply(osg::Geometry& geometry)
{
osg::Geometry::PrimitiveSetList &psl =
geometry.getPrimitiveSetList();

// count the number of tri strips
int num_tristrips = 0;
unsigned int total_indices = 0;
std::vector< std::pair, unsigned int> >
tristrips;
bool first = true;
for (auto &ps : psl)
{
osg::DrawElements *de =
dynamic_cast(ps.get());
if (de != NULL)
{
if (de->getMode() == osg::PrimitiveSet::TRIANGLE_STRIP)
{
num_tristrips++;
std::vector indices;
unsigned int num_indices = de->getNumIndices();
if (!first) total_indices += 2;
total_indices += num_indices;
indices.reserve(num_indices);
for (unsigned int i=0; i < num_indices; i++)
indices.push_back(de->index(i));

std::vector sorted_indices(indices);
std::sort(sorted_indices.begin(), sorted_indices.end());
int median_index =
sorted_indices[sorted_indices.size()/2];
tristrips.emplace_back(indices, median_index);
first = false;
}
}
}

// merge all tri-strips in a cache-friendly manner
if (num_tristrips >= 2)
{
std::sort(tristrips.begin(), tristrips.end(),
[](std::pair, unsigned int> &a,
std::pair, unsigned int> &b) {
return b.second > a.second;
});

std::vector< unsigned int > joined_tristrips;
joined_tristrips.reserve(total_indices);
first = true;
for (auto ts : tristrips)
{
if (!first)
{
joined_tristrips.push_back(joined_tristrips.back());
joined_tristrips.push_back(ts.first.front());
}
joined_tristrips.insert(joined_tristrips.end(),
ts.first.begin(), ts.first.end());

first = false;
}

unsigned int max_element =
*std::max_element(joined_tristrips.begin(), joined_tristrips.end());
osg::ref_ptr new_de;
if (max_element < 256)new_de = new
osg::DrawElementsUByte(osg::PrimitiveSet::TRIANGLE_STRIP,
joined_tristrips.size());
else if (max_element < 65536) new_de = new
osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP,
joined_tristrips.size());
else  new_de = new
osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLE_STRIP,
joined_tristrips.size());
for (unsigned int i=0; i < joined_tristrips.size(); i++)
new_de->setElement(i, joined_tristrips[i]);

osg::Geometry::PrimitiveSetList new_psl;
new_psl.push_back(new_de);

// append all non tri strip geometry
for (auto &ps : psl)
{
osg::DrawElements *de =
dynamic_cast(ps.get());
if (!(de != NULL && de->getMode() ==
osg::PrimitiveSet::TRIANGLE_STRIP))
 new_psl.push_back(ps);
}

geometry.setPrimitiveSetList(new_psl);
}
}
};
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Collada and OSG

2017-01-03 Thread Uma Devi Selvaraj
Hi,

I would like to know which version of collada need to be integrate with 
OSG. I have installed collada 2.4.4. I tried to integrate osg and collada. I am 
getting linking issue. I have provided necessary cmake option. I am using 
vs2015.


daeReader.obj : error LNK2019: unresolved external symbol "char const * const 
ColladaDOM141::COMMON_PROFILE_INPUT_JOINT" 
(?COMMON_PROFILE_INPUT_JOINT@ColladaDOM141@@3PEBDEB) referenced in function 
"private: bool __cdecl osgDAE::daeReader::processDocument(class 
std::basic_string,class std::allocator 
> const &)" 
(?processDocument@daeReader@osgDAE@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>daeRSkinning.obj : error LNK2001: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_JOINT" 
(?COMMON_PROFILE_INPUT_JOINT@ColladaDOM141@@3PEBDEB)
1>daeWGeometry.obj : error LNK2001: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_JOINT" 
(?COMMON_PROFILE_INPUT_JOINT@ColladaDOM141@@3PEBDEB)
1>daeReader.obj : error LNK2019: unresolved external symbol "char const * const 
ColladaDOM141::COLLADA_TYPE_CHANNEL" 
(?COLLADA_TYPE_CHANNEL@ColladaDOM141@@3PEBDEB) referenced in function "private: 
bool __cdecl osgDAE::daeReader::processDocument(class 
std::basic_string,class std::allocator 
> const &)" 
(?processDocument@daeReader@osgDAE@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>daeReader.obj : error LNK2019: unresolved external symbol "char const * const 
ColladaDOM141::COLLADA_TYPE_INSTANCE_RIGID_BODY" 
(?COLLADA_TYPE_INSTANCE_RIGID_BODY@ColladaDOM141@@3PEBDEB) referenced in 
function "private: bool __cdecl osgDAE::daeReader::processDocument(class 
std::basic_string,class std::allocator 
> const &)" 
(?processDocument@daeReader@osgDAE@@AEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>daeRAnimations.obj : error LNK2019: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_IN_TANGENT" 
(?COMMON_PROFILE_INPUT_IN_TANGENT@ColladaDOM141@@3PEBDEB) referenced in 
function "private: class osgDAE::daeReader::ChannelPart * __cdecl 
osgDAE::daeReader::processSampler(class ColladaDOM141::domChannel *,class 
std::map,class std::allocator > > &)" 
(?processSampler@daeReader@osgDAE@@AEAAPEAVChannelPart@12@PEAVdomChannel@ColladaDOM141@@AEAV?$map@PEAVdaeElement@@VdomSourceReader@osgDAE@@U?$less@PEAVdaeElement@@@std@@V?$allocator@U?$pair@QEAVdaeElement@@VdomSourceReader@osgDAE@@@std@@@5@@std@@@Z)
1>daeRAnimations.obj : error LNK2019: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_INPUT" 
(?COMMON_PROFILE_INPUT_INPUT@ColladaDOM141@@3PEBDEB) referenced in function 
"private: class osgDAE::daeReader::ChannelPart * __cdecl 
osgDAE::daeReader::processSampler(class ColladaDOM141::domChannel *,class 
std::map,class std::allocator > > &)" 
(?processSampler@daeReader@osgDAE@@AEAAPEAVChannelPart@12@PEAVdomChannel@ColladaDOM141@@AEAV?$map@PEAVdaeElement@@VdomSourceReader@osgDAE@@U?$less@PEAVdaeElement@@@std@@V?$allocator@U?$pair@QEAVdaeElement@@VdomSourceReader@osgDAE@@@std@@@5@@std@@@Z)
1>daeWAnimations.obj : error LNK2001: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_INPUT" 
(?COMMON_PROFILE_INPUT_INPUT@ColladaDOM141@@3PEBDEB)
1>daeRAnimations.obj : error LNK2019: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_INTERPOLATION" 
(?COMMON_PROFILE_INPUT_INTERPOLATION@ColladaDOM141@@3PEBDEB) referenced in 
function "private: class osgDAE::daeReader::ChannelPart * __cdecl 
osgDAE::daeReader::processSampler(class ColladaDOM141::domChannel *,class 
std::map,class std::allocator > > &)" 
(?processSampler@daeReader@osgDAE@@AEAAPEAVChannelPart@12@PEAVdomChannel@ColladaDOM141@@AEAV?$map@PEAVdaeElement@@VdomSourceReader@osgDAE@@U?$less@PEAVdaeElement@@@std@@V?$allocator@U?$pair@QEAVdaeElement@@VdomSourceReader@osgDAE@@@std@@@5@@std@@@Z)
1>daeWAnimations.obj : error LNK2001: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_INTERPOLATION" 
(?COMMON_PROFILE_INPUT_INTERPOLATION@ColladaDOM141@@3PEBDEB)
1>daeRAnimations.obj : error LNK2019: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_OUTPUT" 
(?COMMON_PROFILE_INPUT_OUTPUT@ColladaDOM141@@3PEBDEB) referenced in function 
"private: class osgDAE::daeReader::ChannelPart * __cdecl 
osgDAE::daeReader::processSampler(class ColladaDOM141::domChannel *,class 
std::map,class std::allocator > > &)" 
(?processSampler@daeReader@osgDAE@@AEAAPEAVChannelPart@12@PEAVdomChannel@ColladaDOM141@@AEAV?$map@PEAVdaeElement@@VdomSourceReader@osgDAE@@U?$less@PEAVdaeElement@@@std@@V?$allocator@U?$pair@QEAVdaeElement@@VdomSourceReader@osgDAE@@@std@@@5@@std@@@Z)
1>daeWAnimations.obj : error LNK2001: unresolved external symbol "char const * 
const ColladaDOM141::COMMON_PROFILE_INPUT_OUTPUT" 
(?COMMON_PROFILE_INPUT_OUTPUT@ColladaDOM1

Re: [osg-users] Draw Instanced intersections

2017-01-03 Thread Sebastian Messerschmidt

Hi Bruno,

There is simply no geometry in the scenegraph to intersect (or strictly 
speaking there is only one drawable)


Instancing takes away the load from the CPU to the GPU,which on the 
OSG-side means to put the instanced geometries into one drawable 
containing the instancing information.


You could use two scenes representing the rendered scene using the 
instances and another using  multiple drawables for intersection 
determination. If it is rather static, KD-Trees will help with 
performance on the intersection-set.



Apart from this, you could overwrite the intersections of DrawArrays 
with some method that takes instances into account, but that might get 
tricky as there are many different ways to realize instancing. I'd go 
with two scenes, using different node-masks for the intersection and the 
"draw"-scene, as it is the easiest approach.


Cheers
Sebastian




Hi, Oliveira,

there maybe many reasons that why no intersection. I cannot give you
advise without more information. u can check about examples within OSG
source code, e.g. "osgintersection".

--
Cheers,
---
TianZJ




At 2017-01-03 17:55:02, "Bruno Oliveira"
mailto:bruno.manata.olive...@gmail.com>> wrote:

Hi TianZJ, Thanks for the quick answer.

I checked the intersector, but intersector->getIntersections()
returns no intersections at all.



2017-01-03 9:32 GMT+00:00 tianzjyh mailto:tianz...@126.com>>:

Hi, Oliveira,
You can check the intersections of your intersector(e.g.
LineSegmentIntersector::Intersection), and you will find they
contain an "osg::NodePath", which means the whole path of the
node(e.g. matrix transform nodes upon the drawable instance).


--


Cheers,
---
TianZJ

At 2017-01-03 16:58:16, "Bruno Oliveira"
mailto:bruno.manata.olive...@gmail.com>> wrote:

Hello,

I'm implementing a draw instanced optimized scene. This is
for drawing a set of polygons.

Previously I was creating a drawable for each polygon, but
now I am using draw instancing. With one drawable per
polygon I can easily use osg intersectors for computing
scene intersections. But how can I perform scene
intersections with draw instanced objects and get, for
instance, intersected instance IDs?






___
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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Draw Instanced intersections

2017-01-03 Thread tianzjyh
Hi, Oliveira,


there maybe many reasons that why no intersection. I cannot give you advise 
without more information. u can check about examples within OSG source code, 
e.g. "osgintersection".


--

Cheers, 
---
TianZJ






At 2017-01-03 17:55:02, "Bruno Oliveira"  
wrote:

Hi TianZJ, Thanks for the quick answer.


I checked the intersector, but intersector->getIntersections() returns no 
intersections at all.





2017-01-03 9:32 GMT+00:00 tianzjyh :

Hi, Oliveira,
You can check the intersections of your intersector(e.g. 
LineSegmentIntersector::Intersection), and you will find they contain an 
"osg::NodePath", which means the whole path of the node(e.g. matrix transform 
nodes upon the drawable instance).



--





Cheers, 
---
TianZJ

At 2017-01-03 16:58:16, "Bruno Oliveira"  
wrote:

Hello,


I'm implementing a draw instanced optimized scene. This is for drawing a set of 
polygons.


Previously I was creating a drawable for each polygon, but now I am using draw 
instancing. With one drawable per polygon I can easily use osg intersectors for 
computing scene intersections. But how can I perform scene intersections with 
draw instanced objects and get, for instance, intersected instance IDs?






 


___
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] Draw Instanced intersections

2017-01-03 Thread Bruno Oliveira
Hi TianZJ, Thanks for the quick answer.

I checked the intersector, but intersector->getIntersections() returns no
intersections at all.



2017-01-03 9:32 GMT+00:00 tianzjyh :

> Hi, Oliveira,
> You can check the intersections of your intersector(e.g.
> LineSegmentIntersector::Intersection), and you will find they contain an
> "osg::NodePath", which means the whole path of the node(e.g. matrix
> transform nodes upon the drawable instance).
>
>
> --
>
>
> Cheers,
> ---
> TianZJ
>
> At 2017-01-03 16:58:16, "Bruno Oliveira" 
> wrote:
>
> Hello,
>
> I'm implementing a draw instanced optimized scene. This is for drawing a
> set of polygons.
>
> Previously I was creating a drawable for each polygon, but now I am using
> draw instancing. With one drawable per polygon I can easily use osg
> intersectors for computing scene intersections. But how can I perform scene
> intersections with draw instanced objects and get, for instance,
> intersected instance IDs?
>
>
>
>
>
> ___
> 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] Draw Instanced intersections

2017-01-03 Thread tianzjyh
Hi, Oliveira,
You can check the intersections of your intersector(e.g. 
LineSegmentIntersector::Intersection), and you will find they contain an 
"osg::NodePath", which means the whole path of the node(e.g. matrix transform 
nodes upon the drawable instance).



--





Cheers, 
---
TianZJ

At 2017-01-03 16:58:16, "Bruno Oliveira"  
wrote:

Hello,


I'm implementing a draw instanced optimized scene. This is for drawing a set of 
polygons.


Previously I was creating a drawable for each polygon, but now I am using draw 
instancing. With one drawable per polygon I can easily use osg intersectors for 
computing scene intersections. But how can I perform scene intersections with 
draw instanced objects and get, for instance, intersected instance IDs?

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


[osg-users] Draw Instanced intersections

2017-01-03 Thread Bruno Oliveira
Hello,

I'm implementing a draw instanced optimized scene. This is for drawing a
set of polygons.

Previously I was creating a drawable for each polygon, but now I am using
draw instancing. With one drawable per polygon I can easily use osg
intersectors for computing scene intersections. But how can I perform scene
intersections with draw instanced objects and get, for instance,
intersected instance IDs?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org