Daniel Lecklider | 29 Jun 02:52 2016

[osgPlugins] Need help with setting/calculating normals

Hi,

First of all I am new to OSG so forgive me if I am making any mistakes.

I am creating a plugin for a proprietary 3d model format that we use at my work. These model files only contain
grid points and unsorted primitives such as TRI's and QUADs.

Currently when I create the model I am not setting normals since non are provided by the file format. So I used
the smoothing visitor to calculate the normals for me. However when I do this I get weird white spots all
over model when I rotate it and look at it.

It seems like this really occurs when there is a 2d shape that is outjutting into 3d space. (Essentially has
no or almost no width).

Is there any way I can calculate the proper normals, even though they are not given? Or is there any way to fix
this rendering issue.

And do not worry about the models color, each section has its own section to denote different things for our clients.

Thank you!

Cheers,
Daniel

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

Attachments: 
http://forum.openscenegraph.org//files/osg2_109.png
(Continue reading)

Philipp Meyer | 29 Jun 13:18 2016
Picon

Get current Billboard ModelView matrix?

Hi,

is it possible to retrieve the current modelView matrix of a billboard node?
For matrix transforms, one can simply use ->getMatrix() and multiply that with the current view matrix.

I noticed that there is a method called "computeMatrix", but I'm a little bit confused in how to use it. What
exactly are the "pos_local" and "eye_local" parameters?

My goal is to retrieve the final modelView matrix of the billboard node (including all parent transforms).

Thank you!

Cheers,
Philipp

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

Dmitriy Ogaltsev | 28 Jun 10:27 2016
Picon

Problem with osg::Dragger::handle

Hi,

I have bug in draggers with click left and right mouse buttons at the same time. I'm using OSG version 3.4.0.
Please look function handle in Dragger.cpp (I can't paste the link).

We have two flags (activationPermitted and _draggerActive).
When we press left mouse button, then dragger will set _activationMouseButtonMask and _draggerActive to true.
Then we press right mouse button -> Condition (activationPermitted || _draggerActive) is true ->
Processing PUSH for RMB -> update all states for dragger.
With this logic of dragger is not working correctly.

And after release right mouse button - the following code will be executed:

Code:

if (_draggerActive && ea.getEventType() == osgGA::GUIEventAdapter::RELEASE)
{
setDraggerActive(false);
_pointer.reset();
}

Dragger will set _draggerActive to false, but left mouse button is still pressed. 

Thank you!

Cheers,
Dmitriy

------------------
Read this topic online here:
(Continue reading)

Philipp Meyer | 28 Jun 11:34 2016
Picon

Render to osg::TextureRectangle fails?

Hi,

im using several RTT Cameras in my scene. So far, I have only rendered to osg::Texture2D and that worked
fine, however, I need to render to NPOD textures now so that will no longer work.

For that, I changed my render target to a osg::TextureRectangle and left everything else pretty much
unchanged. I'm displaying the texture using a custom QUAD. 

Unfortunately I only see a black texture when using TextureRectangle instead of Texture2D. I checked the
osg prerender example and noticed that I need to use un-normalized texture coordinates for my QUAD in this
case, however, to my own surprise that didn't fix the issue either.

Does anyone have an idea whats wrong?

Some relevant code bits:

Texture creation:

Code:
osg::ref_ptr<osg::Texture> osgHelper::createDefaultRttTexture(int width,
		int height, GLenum sourceFormat, GLenum sourceType,
		GLint internalFormat) {

	osg::ref_ptr<osg::Texture> tex;

	auto texImg = osgHelper::make_osgref<osg::Image>();
	texImg->setInternalTextureFormat(internalFormat);
	texImg->allocateImage(width, height, 1, sourceFormat, sourceType);

	if (isPowerOfTwo(width) && isPowerOfTwo(height)) {
(Continue reading)

Ravi Mathur | 27 Jun 23:17 2016
Picon

OSX/X11 graphics context not updating after window resize

Hi all,

I have an interesting problem to which I found a strange solution. I don't know why the solution works, and
I'd like to know if anyone here could shed some light.

I have an OSG-based visualization API that is designed for use from within any user-provided GUI toolkit.
All OpenGL rendering is done in a separate thread; the developer just needs to provide SetGLContext and
SwapBuffers callback functions. Simple enough, and it works great with several GUI toolkits on Windows
and Mac.

I recently started testing its use on OSX with an OpenMotif-based GUI toolkit called Winteracter. The
problem I ran across happens when I get a resize message. I process the message in the OpenGL thread using a
GUIEventHandler, which changes the appropriate viewport. However, while the viewport size does
change, its origin does not shift to match the resized window's corner! So basically if I increase the
window size, the newly exposed portions are left blank even though the rendered image does seem to get
bigger, as if OSG thinks everything resized correctly. See the attached picture for an example.

After a lot of tinkering, I found that I can fix the problem if I call glXMakeCurrent to release and
immediately reattach the context. This happens in the OpenGL thread when it's processing the resize event.

So, does anyone know WHY this solution (hack) works? Interestingly, everything works correctly if I use
OSG's own X11-based viewer. It's only if I use Winteracter's OpenMotif-based window management to
create a window that the resize issue happens.

Thanks!
Ravi

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67865#67865
(Continue reading)

Théo Nassour | 27 Jun 16:06 2016
Picon

Multi touch with WPF

Hi,

I want to know if Someone has an exemple of making osg Multi-touch work under a WPF control ?

Thank you!

Cheers,
Théo

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

_______________________________________________
osg-users mailing list
osg-users <at> lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
John Lee | 27 Jun 11:48 2016

how to detect if an object bounding box collision with the camera frustum?

Hi,

how to detect if an object bounding box collision with the camera frustum?
I wonder if someone can suggest me how to do such check?

Thank you!

Cheers,
John

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

Tung Nguyen | 24 Jun 12:43 2016
Picon

[osgPlugins] [OSG Exporter problem] Export skinning model with biped animation to OSG format

Hi,

I'm newbie in 3dsMax and want to export an human model with animation, I created a biped and skinning to
model, create some animation and make it run, in 3ds max, i can see the model moving with linked biped
inside, but when i export to IVE format, just biped moving, model not move following the biped, i cant know
what wrong, i use OpenSceneGraph Max Exporter from Farshid Lashkari.

I found in some topic a thing call osgAnimation, but i dont know how to use it.

You can see some picture captured in this link
Model in 3ds max
[Image: http://i1351.photobucket.com/albums/p794/vuhuonggiang01/3_zps8xx2hzc8.jpg ]
[Image: http://i1351.photobucket.com/albums/p794/vuhuonggiang01/2_zps5plaqksb.jpg ]
[Image: http://i1351.photobucket.com/albums/p794/vuhuonggiang01/1_zpslljlqnhi.jpg ]
Model after export to IVE, i used OSGViewer to view model.
[Image: http://i1351.photobucket.com/albums/p794/vuhuonggiang01/4_zpssbexyrno.jpg ]
[Image: http://i1351.photobucket.com/albums/p794/vuhuonggiang01/5_zpsjdufskvv.jpg ]

I really really need help for this, many thank.

Cheers,
Tung

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

John Lee | 27 Jun 08:30 2016

how to judge if an object is in the frustum?

Hi,

I don't know how to judge if an object is in the frustum? I want to get which node is in the frustum.

Thank you!

Cheers,
John

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

Nickolai Medvedev | 26 Jun 14:43 2016
Picon

Re: GLFW + OSG

Hi, all!

Well, if nobody responded, it is my test with GLFW3.

Thank you!

Cheers,
Nickolai

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

Attachment (osgGLFW3.rar): application/x-rar-compressed, 2395 bytes
Hi, all!

Well, if nobody responded, it is my test with GLFW3.

Thank you!

Cheers,
Nickolai

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

(Continue reading)

Jordi Torres | 24 Jun 22:19 2016
Picon
Gravatar

Re: osgQt Coverity Scan reported issue, Qt experts please chip in.

Hi Jan,

El 24/6/2016 21:46, "Jan Ciger" <jan.ciger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escribió:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> On 24/06/16 20:32, Robert Osfield wrote:
> > If you have a github account you should be able to login in with
> > this account.  Alternatively you can create your own account for
> > Coverity.
>
> I have logged in with my Github account, but unless someone adds me to
> the OpenSceneGraph project, I don't have access to the reports.
>
> >

You can add yourself to the project as an observer/defect viewer. Otherwise you also can ask for permissions as a contributor. Me or Robert will add you as soon as you ask for it.

Cheers.

> > Attach is a screen snaptshot of the source browser.  The source I
> > also included in my previous post.
>
> >
> > I've looked at the relevant code, copy and pasted below for
> > reference. The issue looks to be related to mixing an int key value
> > with the enum's defined in osgGA::GUIEventAdapter.  I presume the
> > key value is coming in from a Qt event, though I'm not 100% clear
> > on this as I'm not the author of this code, no have Qt expertise.
>
> Yes, the problem is that the key is being passed into the function as
> an instead of enum. It is coming from QEvent (line 136 of the same
> file). The code is taking the Qt events and passing them to the OSG
> event handling system using custom Qt events (a kludge necessary to
> work around some Qt issues).
>
> To fix the problem the comparison should be done using the Qt key
> codes instead:
>
> Change:
> osgGA::GUIEventAdapter::KEY_Shift_L  to  Qt::Key_Shift
> osgGA::GUIEventAdapter::KEY_Shift_R to Qt::Key_Shift as well
>
> osgGA::GUIEventAdapter::KEY_Control_L to Qt::Key_Control
> osgGA::GUIEventAdapter::KEY_Control_R to Qt::Key_Control
>
> osgGA::GUIEventAdapter::KEY_Alt_L to Qt::Key_Alt
> osgGA::GUIEventAdapter::KEY_Alt_R to Qt::Key_AltGr
>
> osgGA::GUIEventAdapter::KEY_Meta_L to Qt::Key_Meta
> osgGA::GUIEventAdapter::KEY_Meta_R to Qt::Key_Meta
>
>
> I don't think Qt makes distinction between left/right shift, control
> and meta (windows) keys unless you use the native scan code, which is
> platform-specific.
>
> You can find the full list here:
> http://doc.qt.io/qt-5/qt.html#Key-enum
>
> Best regards,
>
> Jan
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iD8DBQFXbY4sn11XseNj94gRAsTqAJ9mZ7BWmhrfNKNPSbjlw97UPMVb8QCfVuzK
> 3exJN3eTbdmqx1pwgwPHeYw=
> =Hs+F
> -----END PGP SIGNATURE-----
> _______________________________________________
> osg-users mailing list
> osg-users <at> lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

<div>
<p dir="ltr">Hi Jan,</p>
<p dir="ltr">El 24/6/2016 21:46, "Jan Ciger" &lt;<a href="mailto:jan.ciger@...">jan.ciger@...</a>&gt; escribi&oacute;:<br>
&gt;<br>
&gt; -----BEGIN PGP SIGNED MESSAGE-----<br>
&gt; Hash: SHA1<br>
&gt;<br>
&gt; Hello,<br>
&gt;<br>
&gt; On 24/06/16 20:32, Robert Osfield wrote:<br>
&gt; &gt; If you have a github account you should be able to login in with<br>
&gt; &gt; this account.&nbsp; Alternatively you can create your own account for<br>
&gt; &gt; Coverity.<br>
&gt;<br>
&gt; I have logged in with my Github account, but unless someone adds me to<br>
&gt; the OpenSceneGraph project, I don't have access to the reports.<br>
&gt;<br>
&gt; &gt;</p>
<p dir="ltr">You can add yourself to the project as an observer/defect viewer. Otherwise you also can ask for permissions as a contributor. Me or Robert will add you as soon as you ask for it.</p>
<p dir="ltr">Cheers. </p>
<p dir="ltr">&gt; &gt; Attach is a screen snaptshot of the source browser.&nbsp; The source I<br>
&gt; &gt; also included in my previous post.<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; I've looked at the relevant code, copy and pasted below for<br>
&gt; &gt; reference. The issue looks to be related to mixing an int key value<br>
&gt; &gt; with the enum's defined in osgGA::GUIEventAdapter.&nbsp; I presume the<br>
&gt; &gt; key value is coming in from a Qt event, though I'm not 100% clear<br>
&gt; &gt; on this as I'm not the author of this code, no have Qt expertise.<br>
&gt;<br>
&gt; Yes, the problem is that the key is being passed into the function as<br>
&gt; an instead of enum. It is coming from QEvent (line 136 of the same<br>
&gt; file). The code is taking the Qt events and passing them to the OSG<br>
&gt; event handling system using custom Qt events (a kludge necessary to<br>
&gt; work around some Qt issues).<br>
&gt;<br>
&gt; To fix the problem the comparison should be done using the Qt key<br>
&gt; codes instead:<br>
&gt;<br>
&gt; Change:<br>
&gt; osgGA::GUIEventAdapter::KEY_Shift_L&nbsp; to&nbsp; Qt::Key_Shift<br>
&gt; osgGA::GUIEventAdapter::KEY_Shift_R to Qt::Key_Shift as well<br>
&gt;<br>
&gt; osgGA::GUIEventAdapter::KEY_Control_L to Qt::Key_Control<br>
&gt; osgGA::GUIEventAdapter::KEY_Control_R to Qt::Key_Control<br>
&gt;<br>
&gt; osgGA::GUIEventAdapter::KEY_Alt_L to Qt::Key_Alt<br>
&gt; osgGA::GUIEventAdapter::KEY_Alt_R to Qt::Key_AltGr<br>
&gt;<br>
&gt; osgGA::GUIEventAdapter::KEY_Meta_L to Qt::Key_Meta<br>
&gt; osgGA::GUIEventAdapter::KEY_Meta_R to Qt::Key_Meta<br>
&gt;<br>
&gt;<br>
&gt; I don't think Qt makes distinction between left/right shift, control<br>
&gt; and meta (windows) keys unless you use the native scan code, which is<br>
&gt; platform-specific.<br>
&gt;<br>
&gt; You can find the full list here:<br>
&gt; <a href="http://doc.qt.io/qt-5/qt.html#Key-enum">http://doc.qt.io/qt-5/qt.html#Key-enum</a><br>
&gt;<br>
&gt; Best regards,<br>
&gt;<br>
&gt; Jan<br>
&gt;<br>
&gt; -----BEGIN PGP SIGNATURE-----<br>
&gt; Version: GnuPG v2<br>
&gt;<br>
&gt; iD8DBQFXbY4sn11XseNj94gRAsTqAJ9mZ7BWmhrfNKNPSbjlw97UPMVb8QCfVuzK<br>
&gt; 3exJN3eTbdmqx1pwgwPHeYw=<br>
&gt; =Hs+F<br>
&gt; -----END PGP SIGNATURE-----<br>
&gt; _______________________________________________<br>
&gt; osg-users mailing list<br>
&gt; <a href="mailto:osg-users@...">osg-users <at> lists.openscenegraph.org</a><br>
&gt; <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br></p>
</div>

Gmane