OpenSceneGraph | OpenSceneGraph git repository | Build Tool library
kandi X-RAY | OpenSceneGraph Summary
kandi X-RAY | OpenSceneGraph Summary
Welcome to the OpenSceneGraph (OSG).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of OpenSceneGraph
OpenSceneGraph Key Features
OpenSceneGraph Examples and Code Snippets
Community Discussions
Trending Discussions on OpenSceneGraph
QUESTION
I want to read a 3D Model through OSG and learn the 3D model information about vertices, normals and texture coordinates etc.
I do not understand the code below (complete tutorial from here ). why are we using prset->index(ic)
as an index? I am confused. (* verts)
is the vertex array but what is the prset->index(ic)
?
ANSWER
Answered 2021-Mar-24 at 13:39If your drawable uses indexed primitives, you need to de-reference the triangle vertices looking into the indices array, as you might re-use shared vertices of the vertex array. Something like this.
QUESTION
I'm trying to do simple mesh viewer using OpenSceneGraph and I want to use Conan for dependencies. The compilation is working well in both debug and release mode (I'm compiling on Windows for now with msvc toolchain).
As soon as I try to load any kind of mesh, the osgDB::readNodeFiles just fail. Looks like the plugin are not linked to the final binary. I checked in the Conan's package, the plugin list of .lib exists and are supposed to be linked I guess. What could I miss ?
There is my conanfile.txt :
...ANSWER
Answered 2021-Mar-01 at 09:19I found the solution. I'm compiling statically the program, the plugins are linked to the final binary but the plugin registry look for a dynamic library (osgdb_obj.dll for example).
If you have the same problem, you have to register manually the plugin :
QUESTION
I'd like to show my Qt Quick content on a virtual screen inside my OpenSceneGraph scene.
The approach I'm using right now is highly inefficient:
- Render Qt Quick to the offscreen surface using FBO (FrameBufferObject)
- Download pixels with QOpenGLFramebufferObject::toImage()
- Upload pixels to the OSG
So it's GPU-CPU-GPU transfer. Source code
A proper solution should somehow utilize existing FBO and be able to transfer data solely inside the GPU.
There are two options exist:
- Create FBO on the Qt side and use its texture on the OSG side
- Create FBO on the OSG side and feed it to the Qt Quick renderer
The Qt part is OK. And I'm completely lost with the OSG. Could anyone provide me with some pointers?
...ANSWER
Answered 2020-Oct-08 at 19:57Finally made it.
General idea:
Render QtQuick to texture using FBO - there are some examples over the internet available.
Use this texture inside OpenSceneGraph
The whole thing includes several tricks.
Context SharingTo perform certain graphics operations, we must initialize OpenGL global state, also known as context.
When a texture is created, context stores it's id. Ids are not globally unique, so when another texture is created within another context, it may get the same id, but with different resource behind it.
If you just pass your texture's id to another renderer (operating within different context), expecting it to show your texture, you end up showing another texture or black screen or crash.
The remedy is context sharing, which effectively means sharing ids.
OpenSceneGraph and Qt abstractions are not compatible, so you need to tell OSG not to use its own context abstraction. This is done by calling setUpViewerAsEmbeddedInWindow
Code:
QUESTION
We are currently trying to have our app verified in order to distribute it outside of the app store. We are including OpenSceneGraph libraries as well as Qt frameworks in the app bundle.
This is how we did it so far:
Signed executable in Contents/MacOS folder
Signed libraries and Qt frameworks
Signed App.app folder
zipped .app and submitted for Notarization
The executable, libraries and frameworks signing is done manually with the codesign command, and to sign the whole .app we do the following:
codesign --force --verify --verbose=3 --options runtime --timestamp --entitlements App.entitlements -s "Developer ID Application: Our Dev Id" App.app
When we send the zipped .app to be notarized we usually get a quick reply informing us that the notarization was successful, but if we try to run
spctl --verbose --assess --type execute -v App.app
we get the following error:
App.app: rejected (unsealed contents present in the root directory of an embedded framework)
Also inspecting the json file with the notarization output we notice the same error, but it is marked as a warning and checking it with codesign no error is returned.
After a bit of digging we realized that the issue is related to the Qt frameworks: as a counterproof, we tried to submit the same app without the Qt frameworks and this time when the bundle was successfully notarized spctl accepted it too. Consequently, we eliminated the all symlinks in the root directory, moved the .prl files into the Resources/ folder, and created an alias to A/ in the Versions/ subfolder as suggested in several forum posts, but we have not been able to have spctl accept our bundle with the Qt frameworks. Now at the root of each framework there is just the Versions folder and nothing else (we checked with ls-lha to be sure)
What are we missing in this? Is there a way to at least get some hint on where is the unsealed content which is upsetting the verification tool?
Thank you in advance
...ANSWER
Answered 2020-Feb-03 at 13:43In the end, turns out macdeployqt
was the way to go, because it automatically arranges the Frameworks in a way that makes it possible to sign the bundle with no error.
Our problem with some framework not being added by macdeployqt
disappeared when we upgraded from Qt 5.12.2 to Qt 5.14.1
QUESTION
I'm a newbie on OpenSceneGraph and 3D development.
I have a dxf file that contains a bunch of 3DPOLYLINES (with different colors). So far I have been able to read and display them on a viewer, but I haven been able to change the color of the rendered lines. I believe that I'm not understanding properly the graph relationships.
I'm modifying this example and using the "Quick Start Guide" as reference.
A code snippet of what I have:
...ANSWER
Answered 2019-Oct-28 at 18:59I got help to my problem from the OSG forum, credits to Chris Hanson to point me in to the right direction and Gordon Tomlison's OSG Samples for the actual solution.
The code of the visitor (header):
QUESTION
I'm trying to build OpenModelica from Git using docker-compose. I've downloaded all the dependencies that they have listed here. Now I'm using their build instructions as a RUN
statement, and getting an error when I launch /.configure
. The full sequence of commands to execute is
ANSWER
Answered 2019-Jul-23 at 11:53The error
checking for libraries directory... configure: error: no
suggests that the folder libraries from submodule OpenModelica/OMLibraries is missing.
How did you clone the OpenModelica repository? You need to clone it recursively with all submodules.
QUESTION
I use OpenSceneGraph and I want to use some features of OpenGL 3.3 and the Core profile. I compiled OpenSceneGraph with the option -DOPENGL_PROFILE=GL3
. I got the features I wanted, however, some features of OSG do not work anymore, as lighting with osg::Light
, osg::LineWidth
, osg::LineStipple
on so on.
I know that OSG is mainly built uppon GL2 features, and that Fixed Function Pipeline is not available in core profile, but I expected for "basic" features as light or lines to work.
It the support of those features in Core profile is planned? Or do I have to implement shaders myself? Or are there any existing implementation?
...ANSWER
Answered 2019-Apr-17 at 09:00Lighting and stippling are GL2/legacy features. When you go GL3/Core, you lose all ability to do those things without writing your own shaders.
While OSG could try to automatically do those things for you, in practice, you would only use that ability for a VERY short time before you had to bypass it and just write your own shaders. Look into the ShaderGen Visitor which you can manually execute on your graph to help do some of this for you: https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgUtil/ShaderGen.cpp
The data for lights, etc, can be pushed down to the scenegraph as Uniforms which can then be used by your shader.
QUESTION
I am writing an QtQuick application, mainly in QML, but I have some parts that use OpenGL more directly (an OpenSceneGraph scene). For some reasons, I want to use OpenGL version >= 3.3, but Qt only choose a 3.0 implementation. My code is:
main.cpp
:
ANSWER
Answered 2019-Apr-15 at 13:40One way of doing it is to set the default QSurfaceFormat before the app.exec()
.
QUESTION
Apologies if this is a trivial problem.
I'm trying to pass a multimap that has been put together with one class in a library to another class in that library in order to further manipulate the data there.
The code relates to a GUI written by other people and the classes here relate to two different tools in the GUI.
Very roughly speaking my code and what I'm after here is like this
...ANSWER
Answered 2019-Apr-01 at 11:27The C++ private
members cannot be accessed by other (non friend) classed.
The first solution it would be to keep mMap private (not polite to work on other classes members) and offer assessors over it.
QUESTION
I'm trying to get OpenSceneGraph set up on visual studio so I can run through some tutorials and I believe my issue is that I do not know how to correctly set up the environment on visual studios and get the program to look at the library files correctly.
The code in question is just for a osg smart pointer demonstration
...ANSWER
Answered 2019-Jan-19 at 16:26You need to link against the .lib, not the .dll. The dll path must be in your PATH to work or in the same folder as the executable.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OpenSceneGraph
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page