Re: [osg-users] mygui integration (for Wang Rui)

2015-11-11 Thread Trajce Nikolov NICK
Thanks Wang,

actually I figured it out.  I study the code and yes, I am seeing the
Drawable calling the rendering method (doOneFrame()). However, the
OpenGLRenderManager in it's override of begin() is calling glClear() so no
matter I was doing mygui was keeping clearing the background even if there
was no background widget, so I had to override all of these to make it
work. Your suggestion can do the job but no blending of widgets with the
OSG scene, since these glClear

But, thanks a lot 

Cheers,
Nick

On Thu, Nov 12, 2015 at 1:55 AM, Wang Rui  wrote:

> Hi Trajce,
>
> This should be easy because MyGUI window is encapsulated in derived
> osg::Drawable class and displayed in a HUD camera. You may simply set the
> camera ortho matrix to a different value like (0.0, 0.4, 0.0, 0.4) to have
> OSG scene as background.
>
> Wang Rui
>
> -- Original --
> *From: * "Trajce Nikolov NICK";;
> *Date: * Wed, Nov 11, 2015 04:43 AM
> *To: * "OpenSceneGraph Users";
> *Subject: * Re: [osg-users] mygui integration (for Wang Rui)
>
> Hi Wang,
>
> did you had luck to have osg scene as a background (the osg blusish
> background with a model)? Any hints for this?
>
> Thanks a lot!
>
> Nick
>
> On Tue, Nov 10, 2015 at 7:45 AM, Trajce Nikolov NICK <
> trajce.nikolov.n...@gmail.com> wrote:
>
>> Thanks Wang for the fast reply ... I will ..
>>
>> Cheers,
>> Nick
>>
>> On Tue, Nov 10, 2015 at 1:55 AM, Wang Rui  wrote:
>>
>>> Hi Trajce,
>>>
>>> The osgmygui example is compiled against MyGUI 3.01 and will look for
>>> resource.xml file in current working directory to locate MyGUI media files.
>>> The template of resource.xml can be found at /CMake/Templates,
>>> which should also be installed to /bin automatically.
>>>
>>> Sorry for my inactivity these days, and feel free to use and commit to
>>> the osgRecipes project. :-)
>>>
>>> Wang Rui
>>>
>>> -- Original --
>>> *From: * "Trajce Nikolov NICK";;
>>> *Date: * Tue, Nov 10, 2015 03:01 AM
>>> *To: * "OpenSceneGraph Users";
>>> *Subject: * [osg-users] mygui integration (for Wang Rui)
>>>
>>> Hi Wang,
>>>
>>> I am looking at your work with mygui and I was wondering where do you
>>> host the referenced config .xml files to run the sample. Please let me know
>>>
>>> Thanks as always !
>>>
>>> Nick
>>>
>>> p.s. I hope the community will not mind for posting this to the user
>>> list :-)
>>>
>>> --
>>> trajce nikolov nick
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>
>>
>> --
>> trajce nikolov nick
>>
>
>
>
> --
> trajce nikolov nick
>
> ___
> 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] github not synchronized

2015-11-11 Thread Jason Beverage
So is Github going to be the new official home of osg?

On Tue, Nov 10, 2015, 5:12 AM philippe renon 
wrote:

> Thanks a bunch :)
>
>
> > I've provided Robert with the necessary security tokens to take over the
> > openscenegraph user account on github. Things should go smoothly from now
> > on.
> ___
> 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] using 3Ds Model in osgFX::BumpMapping and the Texture UV Coords for diffuse are not loaded

2015-11-11 Thread Tobias Rick
For everyone who wants to use a bump map shader in osg you can find a working 
code in the lines below.

The source file:

> 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> #include 
> #include 
> #include 
> #include 
> 
> int main(int argc, char **argv) {
> 
>   // Root
>   osg::Group* bumpRoot = new osg::Group();
> 
>   // Model with bump mapping
>   osg::Geometry* bumpModel = new osg::Geometry();
>   bumpModel = (osg::Geometry*) 
> osgDB::readNodeFile("Models/model_scifi_roadway_00straight.3ds");
> 
>   // Model stateset to activate bump mapping shader
>   osg::StateSet* bumpState = new osg::StateSet();
>   bumpState = bumpModel->getOrCreateStateSet();
> 
>   // Stateset shader program
>   osg::Program* bumpMapProgramObject = new osg::Program;
> 
>   // Set shader
>   osg::Shader* bumpVertexObject = new osg::Shader(osg::Shader::VERTEX);
>   osg::Shader* bumpFragmentObject = new 
> osg::Shader(osg::Shader::FRAGMENT);
> 
>   std::string bumpVertexFileName = 
> osgDB::findDataFile("Shading/newbump.vert");
>   bumpVertexObject->loadShaderSourceFromFile(bumpVertexFileName.c_str());
>   std::string bumpFragmentFileName = 
> osgDB::findDataFile("Shading/newbump.frag");
>   
> bumpFragmentObject->loadShaderSourceFromFile(bumpFragmentFileName.c_str());
> 
>   bumpMapProgramObject->addShader(bumpVertexObject);
>   bumpMapProgramObject->addShader(bumpFragmentObject);
> 
>   // Set textures
>   osg::Texture2D *normal = new osg::Texture2D();
>   osg::Texture2D *diffuse = new osg::Texture2D();
> 
>   const char* normal_texture = 
> "Textures/Normal/texture_scifi_roadway_00normal.png";
>   const char* diffuse_texture = "Textures/texture_scifi_roadway_00.png";
> 
>   osg::Image *normal_image = osgDB::readImageFile(normal_texture);
>   osg::Image *diffuse_image = osgDB::readImageFile(diffuse_texture);
> 
>   normal->setImage(normal_image);
>   normal->setDataVariance(osg::Object::DYNAMIC);
>   normal->setFilter(osg::Texture::MIN_FILTER, 
> osg::Texture::LINEAR_MIPMAP_LINEAR);
>   normal->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
>   normal->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
>   normal->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);
>   normal->setResizeNonPowerOfTwoHint(false);
>   normal->setMaxAnisotropy(8.0f);
> 
>   diffuse->setImage(diffuse_image);
>   diffuse->setDataVariance(osg::Object::DYNAMIC);
>   diffuse->setFilter(osg::Texture::MIN_FILTER, 
> osg::Texture::LINEAR_MIPMAP_LINEAR);
>   diffuse->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
>   diffuse->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
>   diffuse->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);
>   diffuse->setResizeNonPowerOfTwoHint(false);
>   diffuse->setMaxAnisotropy(8.0f);
> 
>   // Set texture matrix
>   osg::TexMat* texMat = new osg::TexMat;
>   osg::Vec3d texPosition(0.0, 0.0, 0.0);
>   osg::Vec3d texAngles(0.0, 0.0, 0.0);
>   osg::Vec3d texScale(2.0, 2.0, 2.0);
>   osg::Matrixd texRot;
>   texRot.makeRotate(
>   osg::DegreesToRadians(texAngles.x()), osg::Vec3(1, 0, 0),
>   osg::DegreesToRadians(texAngles.y()), osg::Vec3(0, 1, 0),
>   osg::DegreesToRadians(texAngles.z()), osg::Vec3(0, 0, 1));
>   
> texMat->setMatrix(osg::Matrix::scale(texScale)*texRot*osg::Matrix::translate(texPosition));
> 
>   const int TEXTURE_UNIT_BUMP = 1;
>   const int TEXTURE_UNIT_DIFFUSE = 0;
> 
>   // Add bump map to model stateset
>   // normalTexture in newbump.frag as uniform sampler2D normalTexture
>   // diffuseTexture in newbump.frag as uniform sampler2D diffuseTexture
>   bumpState->addUniform(new osg::Uniform("normalTexture", 
> TEXTURE_UNIT_BUMP));
>   bumpState->addUniform(new osg::Uniform("diffuseTexture", 
> TEXTURE_UNIT_DIFFUSE));
>   bumpState->setAttributeAndModes(bumpMapProgramObject, 
> osg::StateAttribute::ON);
>   // State set options
>   bumpState->setTextureAttributeAndModes(TEXTURE_UNIT_DIFFUSE, diffuse, 
> osg::StateAttribute::ON);
>   bumpState->setTextureAttributeAndModes(TEXTURE_UNIT_DIFFUSE, texMat, 
> osg::StateAttribute::ON);
>   bumpState->setTextureAttributeAndModes(TEXTURE_UNIT_BUMP, normal, 
> osg::StateAttribute::ON);
>   bumpState->setTextureAttributeAndModes(TEXTURE_UNIT_BUMP, texMat, 
> osg::StateAttribute::ON);
>   //bumpState->setTextureMode(0, GL_TEXTURE_2D, osg::StateAttribute::ON);
>   //bumpState->setTextureMode(1, GL_TEXTURE_2D, osg::StateAttribute::ON);
>   //bumpState->setGlobalDefaults();
>   //bumpState->setMode(GL_LIGHTING, osg::StateAttribute::ON);
>   //bumpState->setMode(GL_BLEND, osg::StateAttribute::ON);
>   bumpState->setMode(GL_CULL_FACE, osg::StateAttribute:

Re: [osg-users] mygui integration (for Wang Rui)

2015-11-11 Thread Wang Rui
Hi Trajce,


This should be easy because MyGUI window is encapsulated in derived 
osg::Drawable class and displayed in a HUD camera. You may simply set the 
camera ortho matrix to a different value like (0.0, 0.4, 0.0, 0.4) to have OSG 
scene as background.


Wang Rui


-- Original --
From:  "Trajce Nikolov NICK";;
Date:  Wed, Nov 11, 2015 04:43 AM
To:  "OpenSceneGraph Users"; 

Subject:  Re: [osg-users] mygui integration (for Wang Rui)



Hi Wang,

did you had luck to have osg scene as a background (the osg blusish background 
with a model)? Any hints for this?


Thanks a lot!


Nick


On Tue, Nov 10, 2015 at 7:45 AM, Trajce Nikolov NICK 
 wrote:
Thanks Wang for the fast reply ... I will .. 

Cheers,
Nick


On Tue, Nov 10, 2015 at 1:55 AM, Wang Rui  wrote:


Hi Trajce,


The osgmygui example is compiled against MyGUI 3.01 and will look for 
resource.xml file in current working directory to locate MyGUI media files. The 
template of resource.xml can be found at /CMake/Templates, which 
should also be installed to /bin automatically.


Sorry for my inactivity these days, and feel free to use and commit to the 
osgRecipes project. :-)


Wang Rui


-- Original --
From:  "Trajce Nikolov NICK";;
Date:  Tue, Nov 10, 2015 03:01 AM
To:  "OpenSceneGraph Users"; 

Subject:  [osg-users] mygui integration (for Wang Rui)



Hi Wang,

I am looking at your work with mygui and I was wondering where do you host the 
referenced config .xml files to run the sample. Please let me know


Thanks as always !


Nick


p.s. I hope the community will not mind for posting this to the user list :-)


-- 
trajce nikolov nick

 







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





-- 
trajce nikolov nick

 
 




-- 
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] [build] using 3Ds Model in osgFX::BumpMapping and the Texture UV Coords for diffuse are not loaded

2015-11-11 Thread Tobias Rick
I never thought, that I can say this. But I resolved my problem. Thank you 
Scrawl for your tip using an own shader. I used the shaders from 
http://fabiensanglard.net/bumpMapping/index.php (Vertex shader + Fragment 
shader) and modified it in addition from 
http://forum.openscenegraph.org/viewtopic.php?p=38982#38982 and this works fine 
also with a TexMat :)

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





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


Re: [osg-users] xrandr version

2015-11-11 Thread Robert Osfield
On 11 November 2015 at 16:55, Gianni Ambrosio 
wrote:

> Hi Robert,
> I removed the xrandr version check just for a try.
>
> Some old RedHat and CentOS distributions (at least 5.9) uses an xrandr
> version 1.1.1.
>
> I also verified that width, height and refreshRate are correct even with
> xrandr 1.1.1.


Could you find official docs of xrandr that confirm that this version and
everything after it support the OSG's needs?

One of my concerns is that RedHat have a custom version of xrandr that
back-ported features into.

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


Re: [osg-users] xrandr version

2015-11-11 Thread Gianni Ambrosio
Hi Robert,
I removed the xrandr version check just for a try.

Some old RedHat and CentOS distributions (at least 5.9) uses an xrandr version 
1.1.1.

I also verified that width, height and refreshRate are correct even with xrandr 
1.1.1.

Regards,
Gianni

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





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


Re: [osg-users] xrandr version

2015-11-11 Thread Robert Osfield
Hi Gianni,

I don't recall the decision making process w.r.t the xrandr 1.2 version
check, it'll have been quite a few years back.  My guess that was the
minimum version that looked appropriate at the time.

Just throwing away the version check is unlikely to be generally safe.
It'd only be safe if we could confirm that all versions of xrandr in
circulation supported the functionality that osgViewer's X11 code paths
require.  A better solution than just removing the check would be to find
the earliest version of xrandr that supports the features we need.

I'm curious, what system are you using for it to only have an old version
of xrandr?

Robert.



On 11 November 2015 at 16:07, Gianni Ambrosio 
wrote:

> Hi,
> I'm trying to get the screen refresh rate from
> GraphicsWindowX11::getScreenSettings(...). Looking at the code I realized
> the point is the xrandr version. In fact supportsRandr() methods require
> xrandr version at least 1.2. But since I found the line:
>
> OSG_NOTICE << "You must build osgViewer with Xrandr 1.2 or higher for
> setScreenSettings support!" << std::endl;
>
> I suspect my xrandr 1.1.1 whould be enough to just read the sceen refresh
> rate (and it works fine indeed if remove the xrandr version check!).
> Moreover the supportsRandr() check is used just in two methods that simply
> read the screen settings while in setScreenSettings(...)  it is not used at
> all.
>
> Now, in the actual code (I verified the OSG trunk), the xrand version
> check is really required?
>
> Regards,
> Gianni
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65602#65602
>
>
>
>
>
> ___
> 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] Intercepting Windows messages

2015-11-11 Thread Trajce Nikolov NICK
Hi Anders,

here is what I do for this on Windows

while (!viewer->done())
{

#if defined(_WIN32)
MSG msg;
if (::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
{
::GetMessage(&msg, NULL, 0, 0);

if (wins.size())
{
osgViewer::GraphicsHandleWin32 *hdl =
dynamic_cast(wins.at(0));
if(hdl)
{
WNDPROC fWndProc =
(WNDPROC)::GetWindowLongPtr(hdl->getHWND(), GWLP_WNDPROC);
if (fWndProc && hdl->getHWND())
{
::CallWindowProc(fWndProc,hdl->getHWND(),msg.message, msg.wParam,
msg.lParam);
}
}
}
}
#endif

On Wed, Nov 11, 2015 at 4:21 PM, Anders Backman  wrote:

> Hi.
>
> Trying the 3DConnexion SpaceNavigator with OSG. However I would like to
> stay away from VRPN and such dependencies...
>
> I was wondering how to best intercept Windows messages from the
> GraphicsWindowWin32 class.
>
> This class has a virtual method handleNativeWindowingEvent which I would
> like to override to catch custom messages from my device.
>
> Would it be possible to implement a derived class and have that
> instantiated instead of the standard osgViewer::GraphicsWindowWin32 one?
>
> Or is there a different method to listen to the  messages:
>
> ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
>
> Thanks,
> Anders
>
>
>
> --
> __
> Anders Backman, HPC2N
> 90187 Umeå University, Sweden
> and...@cs.umu.se http://www.hpc2n.umu.se
> Cell: +46-70-392 64 67
>
> ___
> 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


[osg-users] xrandr version

2015-11-11 Thread Gianni Ambrosio
Hi,
I'm trying to get the screen refresh rate from 
GraphicsWindowX11::getScreenSettings(...). Looking at the code I realized the 
point is the xrandr version. In fact supportsRandr() methods require xrandr 
version at least 1.2. But since I found the line:

OSG_NOTICE << "You must build osgViewer with Xrandr 1.2 or higher for 
setScreenSettings support!" << std::endl;

I suspect my xrandr 1.1.1 whould be enough to just read the sceen refresh rate 
(and it works fine indeed if remove the xrandr version check!).
Moreover the supportsRandr() check is used just in two methods that simply read 
the screen settings while in setScreenSettings(...)  it is not used at all.

Now, in the actual code (I verified the OSG trunk), the xrand version check is 
really required?

Regards,
Gianni

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





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


[osg-users] Intercepting Windows messages

2015-11-11 Thread Anders Backman
Hi.

Trying the 3DConnexion SpaceNavigator with OSG. However I would like to
stay away from VRPN and such dependencies...

I was wondering how to best intercept Windows messages from the
GraphicsWindowWin32 class.

This class has a virtual method handleNativeWindowingEvent which I would
like to override to catch custom messages from my device.

Would it be possible to implement a derived class and have that
instantiated instead of the standard osgViewer::GraphicsWindowWin32 one?

Or is there a different method to listen to the  messages:

( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )

Thanks,
Anders



-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org