Re: [osg-users] [osgViewer] ScreenCaptureHandler::handle() missing break statement

2012-12-05 Thread Robert Osfield
Hi Judson,


On 4 December 2012 18:07, Judson Weissert  wrote:

> The following problems occurred when I tried that:
>
> 1. It exposed the missing break statement issue that you have subsequently
> fixed.
> 2. The getUsage() function still reports 'S' as a viable command, and I
> currently use the HelpHandler for displaying viewer usage tips.
>
> My solution was to derive from ScreenCaptureCaptureHandler and override
> getUsage() in addition to calling setKeyEventToggleContinuousCapture() as
> you suggested above. Deriving and overriding is a good solution in a lot of
> cases, but then I have to be careful not to fall into a trap of copying OSG
> library code into my code base (since I want similar behavior).
>

Thanks for the explanation, all makes sense.  I've done a review of the
getUsage() implementations in src/osgViewer and they are inconsistent with
several suspect casts and no guards to switch off the help when the
associated keycode is 0.  To address this I've create a couple of extra
methods in the ApplicationUsage class to make it more convinient to pass in
keycodes and automatically handle the case where a keycode is zero - just
ignoring these entries so they won't appear in the on screen stats.

And svn update will get these changes.
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] multiple processors

2012-12-05 Thread Daniel Schmid
I'm kind of talking to myself here... and since 2010 there is no sign of Art 
Tevs... anybody saw him lately?

Well, if anybody cares, I found out a solution to have multiple processors with 
compositeviewer, each view can have its different osgPPU pipeline, etc.

1. All you need to add is a group node to your scene, that holds all the 
processors. 
2. then you need to add this little snippet of code to Processor.cpp in the 
traverse method:


Code:

void Processor::traverse(osg::NodeVisitor& nv)
{
if (!mCamera)
return;

// if not initialized before, then do it
if (mbDirty) init();

// if subgraph is dirty, then we have to resetup it
// we do this on the first visitor which runs over the pipeline because 
this also removes cycles
if (mbDirtyUnitGraph)
{
mbDirtyUnitGraph = false;

// first resolve all cycles in the set
ResolveUnitsCyclesVisitor rv;
rv.run(this);

// mark every unit as dirty, so that they get updated on the next call
MarkUnitsDirtyVisitor nv;
nv.run(this);

// debug information
osg::notify(osg::INFO) << 
"" << 
std::endl;
osg::notify(osg::INFO) << "BEGIN " << getName() << std::endl;

SetupUnitRenderingVisitor sv(this);
sv.run(this);

osg::notify(osg::INFO) << "END " << getName() << std::endl;
osg::notify(osg::INFO) << 
"" << 
std::endl;

// optimize subgraph
OptimizeUnitsVisitor ov;
ov.run(this);
}

[b]// make sure we render only our own camera
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
{
  osgUtil::CullVisitor* cv = dynamic_cast(&nv);
  if (cv)
  {
if (cv->getCurrentCamera() != getCamera())
{
  return;
}
  }
}
[/b]
// first we need to clear traversion bit of every unit
if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
{
CleanUpdateTraversedVisitor::sVisitor->run(this);
}

// if processor is propagated by a cull visitor, hence first clean the 
traverse bit
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
{
osg::notify(osg::DEBUG_INFO) << 
"" << 
std::endl;
osg::notify(osg::DEBUG_INFO) << "BEGIN FRAME " << getName() << 
std::endl;

CleanCullTraversedVisitor::sVisitor->run(this);
}

if (mbDirtyUnitGraph == false || nv.getVisitorType() == 
osg::NodeVisitor::NODE_VISITOR)
{
osg::Group::traverse(nv);
}

// check if we have units that want to be executed last, then do so
if (mbDirtyUnitGraph == false && nv.getVisitorType() == 
osg::NodeVisitor::CULL_VISITOR)
{
for (std::list::iterator it = mLastUnits.begin(); it != 
mLastUnits.end(); it++)
{
placeUnitAsLast(*it, false);
(*it)->accept(nv);
placeUnitAsLast(*it, true);
}
mLastUnits.clear();
}
}




3. You need to make sure your camera viewport of each view is set to an origin 
of 0/0. Control the position of the rendering viewport by setting the UnitOut 
viewport to the desired origin. 

This is due to a limitation of osgPPU, which copies to and from the render 
target always relative to a 0/0 origin.


Now Enjoy osgPPU and compositeViewer!

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





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


Re: [osg-users] [osgViewer] ScreenCaptureHandler::handle() missing break statement

2012-12-05 Thread Judson Weissert

Robert,

On 12/5/2012 5:16 AM, Robert Osfield wrote:
On 4 December 2012 18:07, Judson Weissert > wrote:


The following problems occurred when I tried that:

1. It exposed the missing break statement issue that you have
subsequently fixed.
2. The getUsage() function still reports 'S' as a viable command,
and I currently use the HelpHandler for displaying viewer usage tips.

My solution was to derive from ScreenCaptureCaptureHandler and
override getUsage() in addition to calling
setKeyEventToggleContinuousCapture() as you suggested above.
Deriving and overriding is a good solution in a lot of cases, but
then I have to be careful not to fall into a trap of copying OSG
library code into my code base (since I want similar behavior).


Thanks for the explanation, all makes sense.  I've done a review of 
the getUsage() implementations in src/osgViewer and they are 
inconsistent with several suspect casts and no guards to switch off 
the help when the associated keycode is 0.  To address this I've 
create a couple of extra methods in the ApplicationUsage class to make 
it more convinient to pass in keycodes and automatically handle the 
case where a keycode is zero - just ignoring these entries so they 
won't appear in the on screen stats.




Great! Thank you very much for the changes you have made, I really 
appreciate it.


Thanks again,

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


Re: [osg-users] Visibility of lines

2012-12-05 Thread Robert Osfield
Hi Jen,

I'll not dive into the details of how you are going about things as I
suspect it might be best to tackle things in a different way.

So.. could you explain from a higher level what you need to do and for what
purpose.  Please explain what exactly you mean by visible - just in the
view frustum or do you mean just contributes pixels to the final on
screen?  Are you away of the OpenGL occlusion querry feature?

Robert.

On 5 December 2012 11:28, Jen Hunter  wrote:

> Dear osg community,
>
> currently I need to find out which lines were visible in last drawn frame.
>
> My current approach is the following:
>
> (1) I use a NodeVisitor to check the loaded model for lines. I store the
> vertices of each line in a class LineData. Every LineData object is stored
> in a vector.
>
> (2) Knowing the lines I want to determine which of them were visible in
> the last view. I calculate the screen coordinates for each vertex of a line
> (vec = V * modelViewMatrix * projectionMatrix * windowMatrix).
>
> (3) Then I convert the z values of the screen coordinates to depth values
> using Znear*Zfar / (Zfar - vec.z()*(Zfar-Znear)).
>
> (4) After that I check the depth buffer of the last frame at the position
> of the screen coordinates and also extract the depth value using the
> formula from (3).
>
> (5) Then I substract both depth values and for the start and the end point
> of the line and if both results are under a specified threshold i count the
> line as visible.
>
> However, I think in theory it should be working this way, but the
> calculated number of visible lines is almost always wrong. I found out that
> for some calculated screen coordinates one dimension is one pixel off, so
> that I do not access the correct pixel in the depth buffer which is why the
> returned value of these is the zfar value and not the wanted depth.
>
>
> I attached some code and a model to show my problem. When you click at a
> point on the model the visible lines are calculated. While the camera is in
> home position the output of the visible lines on the command line is 4
> which is correct. When you move the camera and try different poses the
> number of calculated visible lines changes but almost never to the desired
> number which can be counted on the rendered image.
>
>
> Code:
>
> #include 
>
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
>
> #include 
> #include 
> #include 
> #include 
>
> osg::Matrix lastViewMatrix;
>
> struct CaptureCB : public osg::Camera::DrawCallback{
>
> CaptureCB(osg::ref_ptrimg1){
> image3D = img1;
> }
> virtual void operator()( osg::RenderInfo& ri ) const{
>
> image3D->readPixels( 0, 0,
> ri.getCurrentCamera()->getViewport()->width(),
> ri.getCurrentCamera()->getViewport()->height(), GL_DEPTH_COMPONENT,
> GL_FLOAT );
> osg::ref_ptr  osgCam = ri.getCurrentCamera();
> osgCam->attach(osg::Camera::DEPTH_BUFFER,image3D.get());
> lastViewMatrix = ri.getCurrentCamera()->getViewMatrix();
> }
> protected:
> osg::ref_ptrimage3D;
>
> };
>
> class LineData{
>
> public:
> LineData(){};
> ~LineData(){};
>
> osg::Vec3 start;
> osg::Vec3 end;
>
> void setLine(osg::Vec3 s, osg::Vec3 e){
> start = s;
> end = e;
>
> for(int i = 1; i < samplePointNr; i++){
> double t = (double)i/samplePointNr;
> osg::Vec3 p(start.x() * (1-t) + end.x() * t, start.y() *
> (1-t) + end.y() * t, start.z() * (1-t) + end.z() * t);
> samplePoints.push_back(p);
> }
> }
>
> bool operator == (const LineData& line2) const{
>
> if
> ((!start.valid())||(!end.valid())||(!line2.start.valid())||(!line2.end.valid()))
> return false;
>
> return ((start.x() == line2.start.x()) &&
> (start.y() == line2.start.y()) &&
> (start.z() == line2.start.z()) &&
> (end.x() == line2.end.x()) &&
> (end.y() == line2.end.y()) &&
> (end.z() == line2.end.z()));
> }
>
> void printValues(){
> std::cout<<"start: "< "<
> }
>
> double getEuclideanDistance(osg::Vec3 s,osg::Vec3 e){
> double dist = sqrt( pow(s.x() - e.x(), 2) + pow(s.y() - e.y(), 2)
> + pow(s.z() - e.z(), 2) );
> return dist;
> }
>
> private:
> int samplePointNr;
> std::vectorsamplePoints;
>
>
> };
>
> std::vectorlines;
> osg::ref_ptr image = new osg::Image;
>
> //Determine lines in the model
> class GetLinesVisitor : public osg::NodeVisitor{
>
> public:
>
> GetLinesVisitor():
> osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN){
> numberOfLines = 0;
> numberOfLinesDeleted = 0;
> }
>
> std::vector getLi

Re: [osg-users] Visibility of lines

2012-12-05 Thread Robert Osfield
On 5 December 2012 16:31, Robert Osfield  wrote:

> Are you away of the OpenGL occlusion querry feature?
>

Opps typo, "away" should be "aware".  Have a look at the osgocclusionquery
example for more details.

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


Re: [osg-users] [osgPPU] multiple processors

2012-12-05 Thread Art Tevs
Hi,

Art is here, he was always here :)

My current research and work is non-osg related, hence I unfortunately somehow 
stalled in producing updated. 

Daniel, could you post the code as a patch to the osgPPU version you use? I 
would then implement this into the code.


Cheers,
Art

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





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


[osg-users] [forum] Why I keep getting the crash

2012-12-05 Thread Zhou Zhang
Hi,

I am a newbie of the OpenSceneGraph. I am trying to create a sub class which 
inherets from teh osgManipulator::Dragger and mimic the similar behaviour of 
the osgManipulator::RotateCylinderDragger.
However, I always got crashes on the line computeNodePathToRoot(...) in the 
handle(...) function. The error hints that I forgot registering my new class 
somewhere. However, I checked source code of the RotateCylinderDragger and 
didn't find any way to do it.
Below is my code snippet. It always crashes after it execute the 
computeNodePathToRoot and return true in the end.

I am desparately waiting for some help on this issue now.
Any answers will be greatly appreciated.


bool ScaleRotateDragger::handle(const PointerInfo& pointer, const 
osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
{
   // Check if the dragger node is in the nodepath.
if (!pointer.contains(this)) return false;

switch (ea.getEventType())
{
// Pick start.
case (osgGA::GUIEventAdapter::PUSH):
{
// Get the LocalToWorld matrix for this node and set it for the 
projector.
osg::NodePath nodePathToRoot;
computeNodePathToRoot(*this,nodePathToRoot);
osg::Matrix localToWorld = 
osg::computeLocalToWorld(nodePathToRoot);
_projector->setLocalToWorld(localToWorld);

_startLocalToWorld = _projector->getLocalToWorld();
_startWorldToLocal = _projector->getWorldToLocal();

if (_projector->isPointInFront(pointer, _startLocalToWorld))
_projector->setFront(true);
else
_projector->setFront(false);

osg::Vec3d projectedPoint;
if (_projector->project(pointer, projectedPoint))
{
// Generate the motion command.
osg::ref_ptr cmd = new Rotate3DCommand();
cmd->setStage(MotionCommand::START);

cmd->setLocalToWorldAndWorldToLocal(_startLocalToWorld,_startWorldToLocal);

// Dispatch command.
dispatch(*cmd);

// Set color to pick color.
setMaterialColor(_pickColor,*this);

_prevWorldProjPt = projectedPoint * 
_projector->getLocalToWorld();
_prevRotation = osg::Quat();
_prevPtOnCylinder = _projector->isProjectionOnCylinder();

aa.requestRedraw();
}
return true; 
}

// Pick move.
case (osgGA::GUIEventAdapter::DRAG):

thx
... 


Thank you!

Cheers,
Zhou

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





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


Re: [osg-users] OpenSceneGraph for Beginners tutorial help requested

2012-12-05 Thread Seth Hays
Thanks for the feed back.

I tried the new CMakeList.txt file provided without much luck.  I changed it 
back and then double checked that I was using the release version (the version 
without the d's at the end) and that is correct.  I have the precompiled 
version for win x64 and my environment variable OSG_ROOT points to c:\osg

My bin lib and include files are c:\osg\bin, c:\osg\lib, and c:\osg\include 
respectively.  Now I am getting a new error however.


Code:

2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
class osg::Node * __cdecl osgDB::readNodeFile(class 
std::basic_string,class std::allocator 
> const &,class osgDB::Options const *)" 
(__imp_?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVOptions@1@@Z)
 referenced in function "class osg::Node * __cdecl osgDB::readNodeFile(class 
std::basic_string,class std::allocator 
> const &)" 
(?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: class osgDB::Options * __thiscall osgDB::Registry::getOptions(void)" 
(__imp_?getOptions@Registry@osgDB@@QAEPAVOptions@2@XZ) referenced in function 
"class osg::Node * __cdecl osgDB::readNodeFile(class 
std::basic_string,class std::allocator 
> const &)" 
(?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: static class osgDB::Registry * __cdecl osgDB::Registry::instance(bool)" 
(__imp_?instance@Registry@osgDB@@SAPAV12@_N@Z) referenced in function "class 
osg::Node * __cdecl osgDB::readNodeFile(class std::basic_string,class std::allocator > const &)" 
(?readNodeFile@osgDB@@YAPAVNode@osg@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: unsigned int __thiscall OpenThreads::Atomic::operator++(void)" 
(__imp_??EAtomic@OpenThreads@@QAEIXZ) referenced in function "public: 
__thiscall osg::ref_ptr::ref_ptr(class 
osg::Node *)" (??0?$ref_ptr@VNode@osg@@@osg@@QAE@PAVNode@1@@Z)
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: int __thiscall osg::Referenced::unref(void)const " 
(__imp_?unref@Referenced@osg@@QBEHXZ) referenced in function "public: 
__thiscall osg::ref_ptr::~ref_ptr(void)" 
(??1?$ref_ptr@VNode@osg@@@osg@@QAE@XZ)
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: void __thiscall osgViewer::Viewer::`vbase destructor'(void)" 
(__imp_??_DViewer@osgViewer@@QAEXXZ) referenced in function 
__unwindfunclet$_main$0
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
protected: virtual __thiscall osg::Object::~Object(void)" 
(__imp_??1Object@osg@@MAE@XZ) referenced in function _main
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: virtual __thiscall osgViewer::Viewer::~Viewer(void)" 
(__imp_??1Viewer@osgViewer@@UAE@XZ) referenced in function _main
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: virtual int __thiscall osgViewer::Viewer::run(void)" 
(__imp_?run@Viewer@osgViewer@@UAEHXZ) referenced in function _main
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: virtual void __thiscall osgViewer::Viewer::setSceneData(class osg::Node 
*)" (__imp_?setSceneData@Viewer@osgViewer@@UAEXPAVNode@osg@@@Z) referenced in 
function _main
2>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: __thiscall osgViewer::Viewer::Viewer(void)" 
(__imp_??0Viewer@osgViewer@@QAE@XZ) referenced in function _main




Do I need a special envrionment variable for the dll's?  I've tried to put them 
into the Working Directory under Debugging in the properties but that doesn't 
help.
Cheers,
Seth[/code]

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





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


[osg-users] [forum] Throttling OSG

2012-12-05 Thread Kenn Sebesta
I would like to stream OSG rendered data to some embedded hardware in order to 
do hardware in the loop testing of some image analysis algorithms. As my little 
gumstix can't handle high frame rates, there's really not much point in 
streaming them faster than the OMAP can handle. One of the advantages of this 
is that I could increase texture and detail without having to worry about 
losing frame lock.

Searching through the forums, it seems that all FPS questions have to do with 
the system running too slowly. The best I've come across is that limiting VSync 
will limit OSG. However, that seems kind of hackish, and I was hoping for a 
better way.

Is there an OSG command that will allow me to set a specific speed?

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





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


Re: [osg-users] setUseVertexAttributeAliasing and frame buffer objects not working together

2012-12-05 Thread Stuart Miller
I was able to fix it by making sure setUseVertexAttributeAliases and 
setUseModelViewAndProjectionUniforms were not called in my code, which is 
curious. I'm not sure the purpose of these methods if my shaders are already 
automatically parsed to comply with the OSG attribute model, since setting 
either of them to true causes things to break in very different ways.

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





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


Re: [osg-users] Memory usage

2012-12-05 Thread Nikos Babasakalis
Hi Ulrich,

Thank you very much for your answer and forgive me for 
taking too long to respond

I used two sets of data from the external application and saved 
the scene graph to corresponding osg files. Here are some statistics:

The first osg file is 138 MB and the scene graph has 2864009 vertices,
7852 points, 9968 line loops and 348619 line strips. When loaded
with osgviewer it has a memory footprint of 117 MB 

The second osg file is 126 MB and the scene graph has 800843 vertices,
3 points, 602 line loops and 186700 line strips. When loaded
with osgviewer the memory usage is 257 MB

No texturing is used in any of those graphs

Best Regards
Nikos

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





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


[osg-users] Hatch patterns

2012-12-05 Thread Nikos Babasakalis
Hi,

I would like to ask if there is a way for applying hatch patterns in
closed areas e.g polygons, triangles, quads

Thank you!

Cheers,
Nikos

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





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


Re: [osg-users] Uniforms per MasterCamera in a ThreadPerContext threading model

2012-12-05 Thread Anish Thomas
Hi Robert,

I did try that and the final rendering was messed up. The shader uniform that 
controls the color was changed in each view's cull traversal like so:

osgUtil::CullVisitor* cv = static_cast(&nv);
StateSet* ss = cv->getCurrentCamera()->getOrCreateStateSet();
Uniform* uColor = ss->getOrCreateUniform("u_colorStr", Uniform::FLOAT_VEC4);

And the colors so applied didn't affect the rendered geometry. I changed the 
uniform's name from something common like "u_color" to something unique like 
"u_colorStr" and the end result wasn't different.

Any ideas?

Cheers,
Anish

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





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


Re: [osg-users] select point from pointcloud

2012-12-05 Thread Markus Ikeda
Hi,

Thank you for your kind reply... 

Was out of office... I think I'll try that... 

Cheers,
Markus

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





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


[osg-users] readNodeFile returns null without CURL env variables?

2012-12-05 Thread Tim O'Leary
When I have OSG_CURL_PROXY and OSG_CURL_PROXYPORT set to valid values, the call 
to osgDB::readNodeFile( foo ) returns a valid pointer, and I'm able to load an 
*.osg model from my C: drive.

When I delete these environment vars, and re-run my project, the call to 
readNodeFile() returns NULL.  Nothing else has changed.  The path that I'm 
sending to readNodeFile is a valid *.osg file on my C: drive.

Presumably, when I delete the CURL env vars, the CURL plugin stops working, and 
OSG has no other way to load my *.osg file.  Is that a true statement?  Does 
this mean that I'm missing a plugin to handle non-CURL file I/O?

Thanks,
Tim

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





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


[osg-users] [osgPlugins] Changing CURL environment variables programmatically

2012-12-05 Thread Tim O'Leary
Is it possible to change CURL environment variables (e.g., OSG_CURL_PROXY) 
programmatically, or am I stuck with the same value until I restart my OSG 
application?

I would like to be able to change OSG_CURL_PROXY, and I'm trying to do this by 
calling (in Visual++) SetEnvironmentVariable("OSG_CURL_PROXY", "some_URL") but 
it doesn't appear to actually have any effect on OSG/CURL.  I have to shut down 
my OSG application, change the environment variable manually, then restart my 
OSG application.


Thanks,
Tim

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





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


Re: [osg-users] Correct way to deal with GLBufferObject

2012-12-05 Thread Ennio Barbaro
Hi,

I am trying to develop a simple OpenCL-OpenGL interop application using osg. I 
have no problem in doing this with glut. I am on a unix environment.
The steps i follow are:

1) Initialize cl context with these properties:

Code:

osgViewer::GraphicsWindowX11 * X11Wnd = 
dynamic_cast(theViewer.getCamera()->getGraphicsContext());

cl_context_properties prop[] = {
CL_GL_CONTEXT_KHR,(cl_context_properties)X11Wnd->getContext(),
CL_GLX_DISPLAY_KHR,(cl_context_properties)X11Wnd->getDisplay(),
0
};




2) Setup a test geometry, add some vertices, call 
setUseVertexBufferObject(true), call viewer.frame() to force the compilation of 
the gl objects.

3)

Code:

int cntxtid = 
theViewer.getCamera()->getGraphicsContext()->getState()->getContextID();
osg::BufferObject * buff = geo->getOrCreateVertexBufferObject();
osg::GLBufferObject * glbuff = buff->getGLBufferObject(cntxtid);
cl::BufferGL buffgl(cntx,CL_MEM_READ_WRITE,glbuff->getGLObjectID());



Even if getGLObjectID() returns a non-zero value, the call to cl::BufferGL() 
fails (CL_INVALID_GL_OBJECT).

I believe that the cause of the error could be:
1) Wrong initialization of the shared cl context (i.e. i pass an incorrect 
context/display to opencl).
2) The GL buffer has been created but glBufferData has not been called yet.
3) other? maybe multi-threading releated issues?

Thanks in advance for any help!

Cheers,
Sbabbi

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





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


Re: [osg-users] [osgPlugins] DDS Texture vanish with LINEAR_MIPMAP_LINEAR

2012-12-05 Thread Tim Rambau
I am using a nVidia GeForce GTX 580. And since 10 minutes also the latest 
driver.
The problem can be "solved" by converting to a dds with only 8 mipmaps or 
less...

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





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


[osg-users] Example request: render to renderbuffer attachments of FBO of main camera.

2012-12-05 Thread Edwin Rijpkema
Hi,

In our project we are building and interface between OSG and OpenCL. To remove 
all the overhead in this interface I want OSG to render to two renderbuffers 
that are attached to an FBO of the main camera. One renderbuffer is for GL_RGBA 
data, the other for GL_DEPTH_COMPONENT24 data.

Until now, I have not been successful to get any useful data in the 
renderbuffer attachments of the FBO. What I am looking for is a working and 
building example that renders to one ore more renderbuffer attachments to the 
FBO of the (preferably main) camera.

Best regards,

Edwin

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





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


[osg-users] Wand "Point & Shoot" Object in CAVE environment (Using osgUtil::LineSegmentIntersector ?)

2012-12-05 Thread R. Dustin Kahawita
Hello!

I'm in the process of putting together an application by which a user, holding 
a wand in a CAVE environment should be able to point and select an object at a 
variable distance in virtual space. This is to say that there will be multiple 
objects at various distances from the user, and depending on the orientation of 
the wand, if let's say it's "pointing vector" intersects with the object, then 
the object is selected after which the user can manipulate it. 

I've been able to get the Wand matrix position and orientation data via:

// Get wand data
gmtl::Matrix44f wandMatrix = mWand->getData();

However, I'm struggling to with how to determine if the "point vector" 
intersects with an object or not. I've looked into the OSG command 
osgUtil::LineSegmentIntersector but am not this will produce the results I'm 
aiming for. Is there a class/function already developed within OSG to do this? 

Any guidance would be greatly appreciated! Thank you kindly for your time!

Cheers,

Dustin K.

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





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


[osg-users] How bind event handler to node

2012-12-05 Thread Tracy Ma
I have added a 3d model(.osg format) as a node to scene ,and want to implement 
this:
When this node touched, popup a picture.

i'm a real newbie.

... 

Thank you!

Cheers,
Tracy

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





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


[osg-users] CUDA buffer

2012-12-05 Thread Vincent Wang
Hi,

I have a problem when using CUDA and OSG.
I can not create a new buffer in the updatecallback, or it can be created in 
the camera drawcallback but after copy data from CUDA result to the buffer, I 
can not use it as multitexcoords and can not get it out of the camera 
drawcallback.
Does any one doing like this? I really have not any idea with it.

Thank you!

Cheers,
Vincent

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





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


[osg-users] osgviewerIPhone runtime errors

2012-12-05 Thread David Aiken
Hi all,

I've built the OpenSceneGraph libraries and the osgviewerIPhone example for 
arm7/arm7s and IOS 6.0 with XCode 4.5 using the instructions under "Generating 
an iOS Xcode Project". The code was checked out from the SVN repository earlier 
today. The data in Version (i haven't built osgversion) is:

#define OPENSCENEGRAPH_MAJOR_VERSION3
#define OPENSCENEGRAPH_MINOR_VERSION0
#define OPENSCENEGRAPH_PATCH_VERSION1
#define OPENSCENEGRAPH_SOVERSION80

Running it on an iPad 2 it throws some errors. Seems it is not comfortable with 
ES 2.0:

++Before Converted source 

void main()
{
  gl_Position = ftransform();
  gl_FrontColor = gl_Color;
}


 Converted source 
uniform mat4 osg_ModelViewProjectionMatrix;
attribute vec4 osg_Color;
attribute vec4 osg_Vertex;

void main()
{
  gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
  gl_FrontColor = osg_Color;
}



Compiling VERTEX source:
1: uniform mat4 osg_ModelViewProjectionMatrix;
2: attribute vec4 osg_Color;
3: attribute vec4 osg_Vertex;
4: 
5: void main()
6: {
7:   gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
8:   gl_FrontColor = osg_Color;
9: }

VERTEX glCompileShader "" FAILED
VERTEX Shader "" infolog:
ERROR: 0:8: Use of undeclared identifier 'gl_FrontColor'

The code also attempts to load a 'hog.osg'. I've checked out 
OpenSceneGraph-Data but don't find this file either here or in the source tree. 
Tried copying 'cow.osg*' (seemed a fair trade :) into the bundle but so far I'm 
getting:

FindFileInPath() : USING 
/private/var/mobile/Applications/94D2B578-90DE-44D1-A900-99F343FAA028/osgviewerIPhone.app/cow.osg
No data loaded


Am i missing something? I'm just getting into the OSG source but thought 
someone might be kind enough to save me some work. If there are any other 
working IOS demos it would be appreciated too!

thanks

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




Attachments: 
http://forum.openscenegraph.org//files/log_126.txt


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


[osg-users] [osgPlugins] WindowManager on IOS?

2012-12-05 Thread David Aiken
Hi,

Has anyone managed to get one of the WindowManager examples running on IOS? 
I've pulled the source for osgwidgetwindow and osgwidgetnotebook into the 
osgviewerIPhone example but no luck. The WindowManager examples do work on OSX 
Lion.

Thanks
David

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





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


[osg-users] OpenCL and OSG interop

2012-12-05 Thread Carlos Reig
Hi,

I want to initializatze OpenCL using the OSG context (in Windows) in order to 
manipulate the OSG VBOs directly in the GPU.

For that, I need the OpenGL current context and the device context. When I had 
the code wrote directly in OpenGL I used the functions wglGetCurrentContext() 
and wglGetCurrentDC() for get it, but now I would to use the OSG api.

In this moment, I have a code that gets the opengl current context and the 
device context in the viewer realize method. But it doesn't work.

For use Viewer::realize I have to create a child class of GraphicsOperation and 
get all the parameters that I need.


Code:

class WindowsContextInfo : public osg::GraphicsOperation
public:

WindowsContextInfo():
osg::GraphicsOperation("WindowsContextInfo", false) {}

virtual void operator() (osg::GraphicsContext* gc) {
osgViewer::GraphicsHandleWin32* windowsGraphicContext = 
dynamic_cast (gc); 
hdc = windowsGraphicContext->getHDC();
wglContext = windowsGraphicContext->getWGLContext();
}

HDC hdc;
HGLRC wglContext;
};




In the main code, before doing viewer.realize() I attach the GraphicOperation 
to the viewer:


Code:

wci = new WindowsContextInfo;
viewer.setRealizeOperation(wci.get());
viewer.realize();




And, when I'm initializating OpenCL, I put the received parameters:


Code:

cl_context_properties props[] = {
CL_CONTEXT_PLATFORM,
(cl_context_properties) clPlatform,
CL_GL_CONTEXT_KHR,
(cl_context_properties) wci.wglContext,
CL_WGL_HDC_KHR,
(cl_context_properties) wci.hdc,
0
};




Anyone knows why I get an OpenCL context creation error? I will be grateful for 
any track.

Thank you!

Cheers,
Carlos

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





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


Re: [osg-users] Invert scene graph

2012-12-05 Thread Stéphane Bonardi
Dear all,

I'm still struggling with this problem. I've tried a few new things but the 
result is not satisfactory:

- I tried to do a "dynamic re-parenting" by changing the scene graph after each 
connection and disconnection but the script tends to become unstable after a 
while (segfault errors). Additionally, I was not able to properly input the 
world transformation to the new fixed node of the graph: for example, if P0 was 
fixed, the end effector P3 has been transformed due to the move of the 
different joints and when P3 becomes fixed and P0 free again, I need to apply 
the right rotation and translation so that P3 stays in its current position. 
Finally I think the performances of the script would not be good enough to 
scale this problem to multiple kinematic chains (for example a thousand of 
them) moving asynchronously.

- As suggested by Bryan, I also tried to keep the same graph structure but 
applying the inverse of the transformation. Nevertheless I was not able to 
simulate the behaviour I described in my first message: for example if Root ipo 
P0 ipo P1 ipo P2 ipo P3 and I want P3 to become the "fixed" node, I do not 
really see how I could use an inverse transformation to obtain such behaviour. 
It would be wonderful if I could have a small example to illustrate this idea.  
   

- I'm now trying to recompute "manually" the transformation for each node of 
the kinematic chain using a chain of matrix transforms. All the nodes are 
independent (only attached to the root) and they do not interact with each 
other. This solution is really tedious to implement and I have the feeling I'm 
missing the point of using a scene graph manager.

- I've also started looking into physic based simulation using osgBullet and 
applying constraints between the nodes.

I don't really know what would be the more appropriate way of solving this 
problem and I think I'm really missing some obvious solution. I would be much 
obliged if somebody could give me additional advice on this or a short working 
example (for example with 3 boxes).

Thanks a lot for your help.

Best regards,

Stéphane

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





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


[osg-users] Unhandled exception at 0x6F650A62 (msvcr100.dll) in *.exe: 0xC0000005: Access violation reading location 0x00454000.

2012-12-05 Thread Race Maine
Hi,

I am working with OpenSceneGraph, and I keep running into this violation issue 
that I would appreciate some help with. The problem is with the particular line 
below which happens to be the first in my main function.


Code:
 osg::ref_ptr bench = osgDB::readNodeFile("Models/test.IVE");



I have my models folder right in my directory. The error is as below.

Unhandled exception at 0x68630A6C (msvcr100.dll) in OSG3D.exe: 0xC005: 
Access violation reading location 0x00421000.

And this is where the problem seems to be coming up.


Code:
/** Read an osg::Node from file. 
  * Return valid osg::Node on success,
  * return NULL on failure.
  * The osgDB::Registry is used to load the appropriate ReaderWriter plugin
  * for the filename extension, and this plugin then handles the request
  * to read the specified file.*/
inline osg::Node*  readNodeFile(const std::string& filename)
{
return readNodeFile(filename,Registry::instance()->getOptions());
}




Please help me fix this problem. Any help will be appreciated. 
Thank you!
Cheers,
Race

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





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


[osg-users] Mix between Ortho and P

2012-12-05 Thread David Hornung
Hello,

how could I mix setProjectionMatrixAsOrtho2D()  and 
setProjectionMatrixAsPerspective ?

Explanation :
I am already able to play my video in Ortho2D Mod an draw semitransparent 
Objects in front of it (tag: Augmented Reality)

But now for the Objects i want to use setProjectionMatrixAsPerspectiv() so that 
the Video will play in Background as ortho2D and the Objects as Perspective. Is 
this possible? If yes, how ?

Thank you!

Cheers,
David

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





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


[osg-users] Draw in front of Video

2012-12-05 Thread David Hornung
Hi,

I am able to play a video with the osgmovie example. How is it now possilbe to 
draw objects in front of the video?


Thank you!

Cheers,
DavidHornung

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





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


[osg-users] Ideas

2012-12-05 Thread David Hornung
Hi,

I am new on openSceneGraph and want to develope a kind of Augmented Reality 
application and I want to know which components I should use for that

To have an idea of my intention look this www .pic-upload. 
de/view-16605389/Bildschirmfoto-3.png.html 

I play a video (from file or stream) and want to add a 3D Scene (with osg?!) on 
top of that video which show me information about a object. 

With which technique could I realize that? I don't want to use osgART because 
that would be much overhead like image processing I don't need.

Thank you!

Cheers,
DavidHornung

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





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


[osg-users] [osgPlugins] Does FBX (or any other) plugin supports ForceReadingImage ?

2012-12-05 Thread Felix Hu
I want to import an FBX model into osg, and I want osg to create an empty image 
if the referenced image file is not found or not supported by any plugin.

I wrote some code like this:


Code:
auto node = osgDB::readNodeFile("model.fbx", new 
osgDB::Options("ForceReadingImage=true"));




but this doesn't seem like to work, only valid images are loaded, no empty 
image created for thos not loaded.

so, what is the correct way to use ForceReadingImage in this case ?
is ForceReadingImage supported in any plugin other than osg2 ??
is this option a global thing or only osg2 ?
the document says "This is useful when converting from other formats. Image 
information won't be erased even without the external reference. "

How can I realize this ?

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





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


[osg-users] [build] Need help with Multithreaded-Debug(/MTd)

2012-12-05 Thread Ralf Zenker
Hi,

For a C++ Windows-MFC project at work i need OSG libs/dlls as 
Multithreaded-Debug(/MTd) and Multithreaded(/MT).
I have tried to compile it with these settings but some libs like osgDBd and 
osg80-osgGAd failed. There are several linking errors (LNK2005 - double 
definition) based on the std.

Maybe its bacause of the dependent 3rd party libs like zlib if they are not 
compiled with the same settings...?

Does anyone have already compiled libs with this settings or could give me a 
hint?

... 


Thank you!

Cheers,
Ralf

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





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


Re: [osg-users] [osgPlugins] FBX textures file names is UTF8

2012-12-05 Thread Felix Hu
Actually, the official Autodesk documents says the same:

http://download.autodesk.com/global/docs/fbxsdk2012/en_us/files/GUID-D3844B1D-4E74-4C64-AD79-14B00EB1FE4-42.htm


> FBX SDK uses UTF-8 strings internally.


and you should use KString and its macros to deal with strings in fbx sdk.

http://download.autodesk.com/global/docs/fbxsdk2012/en_us/files/GUID-6766AFC0-4F25-4436-A5EE-BCDAFC6CB58-34.htm

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





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


[osg-users] [osgPlugins] FBX textures file names is UTF8

2012-12-05 Thread Felix Hu
According to my tests, by exporting fbx files from 3DS Max,
the external texture file names stored in the fbx file is actually UTF-8.

It means, KFbxFileTexture::GetFileName returns an UTF-8 string,
if the string contains complex characters like Chinese/Janpanese/Korean etc,
osgDB::readImageFile() cant found the file.

I suggest the fbx plugin to convert the file name from UTF-8 to current
code page before passing it to readImageFile, its not always the corret CP,
but its the best we can try here.

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





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


Re: [osg-users] [osgPlugins] FBX textures file names is UTF8

2012-12-05 Thread Felix Hu
OK, I tried modify the file \src\osgPlugins\fbx\fbxMaterialToOsgStateSet.cpp 
and changed this function, it seems to work !

but I guess there are other places to change right ?
actually any string got from fbx sdk should be converted from utf8 to ansi 
before used in osg.


Code:
osg::ref_ptr
FbxMaterialToOsgStateSet::fbxTextureToOsgTexture(const KFbxFileTexture* fbx)
{
ImageMap::iterator it = _imageMap.find(fbx->GetFileName());
if (it != _imageMap.end())
return it->second;
osg::ref_ptr pImage = NULL;

// Warning: fbx->GetRelativeFileName() is relative TO EXECUTION DIR
//  fbx->GetFileName() is as stored initially in the FBX
char* fileName = NULL; KFbxUTF8ToAnsi(fbx->GetFileName(), fileName);
char* relativeFileName = NULL; 
KFbxUTF8ToAnsi(fbx->GetRelativeFileName(), relativeFileName);

if ((pImage = osgDB::readImageFile(osgDB::concatPaths(_dir, fileName), 
_options)) ||// First try "export dir/name"
(pImage = osgDB::readImageFile(fileName, _options)) ||  
  // Then try  "name" (if absolute)
(pImage = osgDB::readImageFile(osgDB::concatPaths(_dir, 
relativeFileName), _options)))// Else try  "current dir/name"
{
osg::ref_ptr pOsgTex = new osg::Texture2D;
pOsgTex->setImage(pImage.get());
pOsgTex->setWrap(osg::Texture2D::WRAP_S, 
convertWrap(fbx->GetWrapModeU()));
pOsgTex->setWrap(osg::Texture2D::WRAP_T, 
convertWrap(fbx->GetWrapModeV()));
_imageMap.insert(std::make_pair(fbx->GetFileName(), pOsgTex.get()));
return pOsgTex;
}
else
{
return NULL;
}

delete fileName;
delete relativeFileName;
}



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





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


Re: [osg-users] [osgPlugins] FBX textures file names is UTF8

2012-12-05 Thread Felix Hu
Well, I just found this option OSG_USE_UTF8_FILENAMES, so I guess my changes 
are not needed if this option is on, but still better when its off, so, may 
still worth considering.  :P

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





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


[osg-users] [vpb] error building VPB

2012-12-05 Thread Айдар Сайфулл
Hi, All!

Sorry my bad English.

I don't build VPB with VS2008.

Please, help me build virtualplanetbuilder 


Thank you!

Cheers,
Айдар

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





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


[osg-users] [build] Simple example link errors with cygwin

2012-12-05 Thread Micael Pedrosa
Hi,

I'm trying to run a simple app in windows with cygwin environment.

Code:

#include 

int main() {
  osgViewer::Viewer viewer;
  return 0;
}




My makefile:

Code:

CC=g++

#source, objects and executable
SOURCES=test.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=test

#pre-compile, compile and link flags
PFLAGS := -DNDEBUG
CFLAGS=-c -Wall
LDFLAGS=

#include, lib paths and libs 
INC_PATHS := -I/cygdrive/c/dev/sdk/osg_3.0.1/include
LIB_PATHS := -L/cygdrive/c/dev/sdk/osg_3.0.1/lib

LIBS := -losg -losgGA -losgDB -losgViewer -losgText -losgUtil -lOpenThreads

#compile and link commands
all: $(SOURCES) $(EXECUTABLE)
  rm *.o
  mv test.exe ./bin

clean:
  rm -f *.o
  rm -rf ./bin/*.*

$(EXECUTABLE): $(OBJECTS) 
  $(CC) $(LIB_PATHS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@

.cpp.o:
  $(CC) $(INC_PATHS) $(CFLAGS) $(PFLAGS) $< -o $@




Windows paths are correct, osgversion works fine and examples also with:
OpenSceneGraph Library 3.0.1

Now, everything seems to be correct but my "make all" output is:

Code:

make all 
g++ -I/cygdrive/c/dev/sdk/osg_3.0.1/include -c -Wall -DNDEBUG test.cpp -o test.o
g++ -L/cygdrive/c/dev/sdk/osg_3.0.1/lib  test.o -losg -losgGA -losgDB 
-losgViewer -losgText -losgUtil -lOpenThreads -o test
test.o:test.cpp:(.text+0x13d): undefined reference to 
`__imp___ZN9osgViewer6ViewerC1Ev'
test.o:test.cpp:(.text+0x14d): undefined reference to 
`osgViewer::Viewer::~Viewer()'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: test.o: 
bad reloc address 0x0 in section `.ctors'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: final link 
failed: Invalid operation
collect2: ld returned 1 exit status
make: *** [test] Error 1
Makefile:29: recipe for target `test' failed




Don't know what is missing!

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





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


[osg-users] OSG Wiki - what's going on?

2012-12-05 Thread Ryan Schneider
Hi,

I was looking at the OSG wiki today (at wiki [dot] openscenegraph [dot] com), 
and it's been taken over by ad-bots or something because the site is filled 
with hundreds of garbage articles. Is there an actively-maintained wiki 
somewhere else? If not, when is someone going to wrangle the other wiki back 
into a usable state?

Thank you!

Cheers,
Ryan

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





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


[osg-users] Problem capturing images while group getting displayed in Viewer

2012-12-05 Thread Carel Combrink
Hi,

I am trying to do the following:
Create a Group with children attached. One child is video coming from a 
camera/file and the rest are overlays that should be visible on the video. 
Sometimes there is a shader on  the video, depending on the video format (Mono8 
vs Mono16).

I then want to display the video on the screen using a View and while 
displaying, I want to record the displayed video to a buffer of Images. The 
recorded video must show the overlays that were visible at the time of the 
frame.

I have done the following (mostly from example applications, other libs and web 
searches): 
- I have code that set up my root Group with a few nodes added.
- One node is a Group that displays TextureRectangle (video feed from 
camera/file) 
- The other nodes are mostly overlays that I overlay on the video.
- I have a Viewer that is responsible for displaying this tree (video + 
overlays)
All of this is working fine. 

Now to record the displayed video to a buffer of images I do the following 
(Also from examples):
- I have a recorder class that takes the root node, and sets up a Camera for 
this recorder on the root. 
- I then set the setRenderTargetImplementation() to Camera::FRAME_BUFFER_OBJECT
- I then attach an Image as a Camera::BufferComponent and add the root node to 
the children of the camera (Camera::addChild()).
- Lastly I set a DrawCallback object using the setPostDrawCallback() function 
on the camera. 

Now the problem is:
The operator ()(osg::RenderInfo &) functor is never called on my DrawCallback 
object. I have an idea why this is not working (very limited knowledge of OSG): 
If I do not add the root to the camera, but instead add the Camera to the root 
Group (Group::addChild()) it does go into my functor, but all I record is blue 
images. So I need to add the root node to the camera so that it will have the 
Nodes to record, and add the camera to the root node, so that it will get 
updated when the view is drawn. But how do I do this without breaking the app 
due to the obvious circular dependency (I have tried)?

Or is there an alternative way for me to do this?

I have tried adding my DrawCallback object onto the Camera of the View to then 
write the pixels into an image in the functor, but when the size of the View 
changes (due to for example the app gets resized), I do not get the whole image 
anymore in my Image. Thus the reason why I am attempting to create a second 
camera (will this even work??).

Thank you!

Cheers,
Carel

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





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


[osg-users] Importing 3DS max in OSG

2012-12-05 Thread Valeriu Schneider
Hi,

Is there any simple method to import 3ds max/maya models into osg?

Thank you!

Cheers,
Valeriu

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





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


[osg-users] Tutorials

2012-12-05 Thread Valeriu Schneider
Hi,

Where can I learn OSG from? Something like books, tutorials etc.

Thank you!

Cheers,
Valeriu

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





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


[osg-users] Help: resizing a class that inherits osg::Canvas

2012-12-05 Thread Valeriu Schneider
Hi,

So, I have a class MessageWidget whose header looks like this:

Code:
   class MessageWidget : public osgWidget::Canvas, public 
immi::interfaces::MenuCallback 


Inside this class, there's a method which creates 3 widgets (all stored as 
members of the class), and adds them via the method addWidget. When the user 
clicks on a button, I remove one of the widgets via the method removeWidget. 
However, the main widget ( isn't resized automatically, nor does it work to use 
the resize method).

This is how the widget looks before adding the other widgets: 
[img] http://i.stack.imgur.com/JyU2d.jpg [/img] 
This is how the widget looks after adding 2 widgets: 
[img] http://i.stack.imgur.com/dNyNU.png [/img]
And then, when I remove the widget with the text, the main widget isn't 
resized: 
[img] http://i.stack.imgur.com/UiFIV.png [/img]

Any ideas of how I can resize the MessageWidget?  It has to be the same size as 
in the first picture.

Thank you!

Cheers,
Valeriu

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




Attachments: 
http://forum.openscenegraph.org//files/uifiv_139.png
http://forum.openscenegraph.org//files/dnynu_117.png
http://forum.openscenegraph.org//files/jyu2d_213.jpg


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


Re: [osg-users] Problem with osgCamera->setColorMask() or bug?

2012-12-05 Thread Mat Lab
Hi,

I got the same problem, then I looked more closely to the source code. I made a 
small change in osgUtil::SceneView.cpp (after line 1442, r13041) :


Code:

   _renderStage->drawPreRenderStages(_renderInfo,previous);
   
/* FIX BEGIN */
   osg::ColorMask* cmask2 = 0;
   if(_secondaryStateSet.valid())
   {
  cmask2 = 
static_cast(_secondaryStateSet->getAttribute(osg::StateAttribute::COLORMASK));
   }
   if(!cmask2 && _globalStateSet.valid())
   {
  cmask2 = 
static_cast(_globalStateSet->getAttribute(osg::StateAttribute::COLORMASK));
   }
   if(cmask2)
   {
  cmask->setMask(cmask2->getRedMask(), cmask2->getGreenMask(), 
cmask2->getBlueMask(),cmask2->getAlphaMask());
   }
   /* FIX END */
   
   _renderStage->draw(_renderInfo,previous);




It seems that the camera color mask (from camera->getStateSet()) is set to the 
_secondaryStateSet (if it is a slave camera) or _globalStateSet (if it is a 
master camera) of the SceneView... see osgViewer::Renderer() constructor. 

Cheers,
mat

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





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


[osg-users] Memory allocation problem with big models

2012-12-05 Thread Ale Maro
Hi all,

I am testing osg for my application. 
I need to visualize big models. For example I am loading a binary STL model 
with 33 millions triangles and I got a bad_alloc exception.
May be the problem is on the capacity limit of STL vectors.
I also tried to write my STL loader and split model during load creating 
different geodes (and grouping them) but I am still got the same error after 
calling "view->setSceneData( _scene )"
Is there a way to overcome this limitation?

Thank you!

Cheers,
Ale

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





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


[osg-users] Geometry sharing

2012-12-05 Thread Ale Maro
Hi,

I have my own data structure to manage mesh geometry. Is there a way share it 
with OSG to avoid vertex list duplication?

Thank you!

Cheers,
Ale

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





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


[osg-users] Skybox blocks out other model data

2012-12-05 Thread Paul Heraty
Hi,

I have an OSG app setup where I load in a relatively large model. The bounding 
sphere is centered at 0,0,0 with a radius of 5.

I have copied the skybox code from the osgvertexprogram, and set the radius of 
the sphere to 100,000.

However, when I run the app now, All I see is the skybox. If I change the state 
to see un-filled polygons, I can see the model data as well as the sky box, so 
it seems the skybox is over-writing the model data. The stats 's' also shows 
that all of the model data polygons are being processed and drawn.

So my question is, why is my skybox overwriting my model pixels? I've followed 
the code exactly as per the osgvertexprogram. 

Any ideas please?

Thank you!

Cheers,
Paul

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





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


[osg-users] osgb to obj conversion missing textures

2012-12-05 Thread Tisham Dhar
Hi,

I am attempting to perform a 2D spatial filter on some osgb files. i.e. drop 
any faces in the geometry outside a fence. I have implemented the same on OBJ 
files, so I am attempting to convert the osgb to OBJ, filter them and convert 
back to osgb. This however fails to write out textures, so not convenient. Also 
apart from the main Geometry geode, the scene in each source osgb also contains 
a few PagedLOD's. The hacked up solution so far is to export osgb to OBJ and 
osgx with option "WriteImageHint=WriteOut".

I was hoping to track down a geometry visitor which will cull the faces of 
interest.

Thank you!

Cheers,
Tisham

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





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


Re: [osg-users] Retrobooster playable demo

2012-12-05 Thread Terry Welsh
Hi Jan,
Thanks for all the tips and the article. I wanted to use an RPM and
DEB for this release because I really like the way Linux can resolve
dependencies for packaged software. Unfortunately, making packages is
hard to get right and there is much room for error. If I was making
something open source I'd definitely try to go through distro
maintainers. When I get some more time I want to look harder at tools
like MojoSetup, Makeself, and Nixstaller. They get a lot of use by
other indie game developers.
--
Terry Welsh
www.reallyslick.com

>
> On 12/04/2012 12:59 AM, Terry Welsh wrote:
>>  I love developing on Linux, but
>> windowing and packaging seem to be big issues. I supposed it's because
>> of the scattered nature of Linux (many distros with many desktop
>> managers, and packaging systems).
>
> Actually, the way to go is to prepare something that can be distributed
> and then work with the packagers of the distros instead of trying to
> supply your own "installer". They will handle the packaging, integration
> with various desktop environments within their distro and even
> distribution for you.
>
> The ideal case is when your application is open source - then make sure
> that the build system is sane (i.e. something similar to the ./configure
> && ./make && make install) and you should be set.
>
> If you application is not open source, then it is tad more complex. If
> you are still allowing free redistribution, then the above still
> applies, but you need to prepare something that is easy to install and
> actually runs on the target distro - e.g. a statically linked file in a
> tar.gz file, with all the required data. Make sure to not hardwire any
> paths, because different distros put things in different places and
> without source code they couldn't patch your application to integrate
> well. For example, Adobe Acrobat Reader is/used to be commonly
> distributed in this way.
>
> If you application is purely closed source and not allowing free
> redistribution, then you are on your own. However, a binary either
> packaged with all its dependencies or statically linked and stored in a
> tar.gz file will run on any modern distribution. Targeting recent Fedora
> or Ubuntu is a safe bet that will probably cover some 80% of the user
> base, because those distributions are popular and many others are based
> on them or using same software versions.
>
> Don't bother with the various window manager integration - you will
> always get it wrong for someone (e.g. Mageia has different KDE/Gnome
> menus than Fedora which has them yet different than SuSE ...). The users
> are smart enough to make a shortcut in the menu themselves if that is
> what they want and when you are working with the distro packagers
> directly, they will take care of it anyway.
>
> There is also this, more technical article from 2005, but it applies the
> same today as it did back then:
> http://onlamp.com/pub/a/onlamp/2005/03/31/packaging.html
>
> Regards,
>
> Jan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] From Maya to OSH

2012-12-05 Thread Ferran Altarriba Bertran
Hi,

I'm very very new to OSG, so maybe my doubts will seem quite easy to solve for 
you...

the point is that I have a 3D model done in Autodesk Maya (including materials, 
image textures, videotextures and animation) and I need to export it to OSG.

I haven't found the way to do it directly from Maya (does this way exist?), so 
I tried to export from Maya to OBJ+MTL and then from this to OSG. The problem 
is that I can only convert the OBJ file to OSG, I don't know how to add the MTL 
too.

Have u know how can I solve this? 

Thanks a million! :)

Cheers,
Ferran

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





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


Re: [osg-users] Help undrstanding all thing GIS

2012-12-05 Thread William Temple
Hi,

I am going to admit straight up front I have no idea what I am doing.

I have an idea in my head for an educational application but since I am not a 
programmer, a cartographer, or an artist I am finding that my research has me 
treading water in a murky fogged coated abyss.

There are so many options and so many paths to take those options, I have an on 
going headache from the confusion

I hope there will be some willing guides here who will point me in the 
direction I need to go.

A little history my 3 year old son loves the television shows Dinosaur Train, 
Curious George, and Sid The Science Kid. He also enjoys helping me play my 
on-line game OpenTTD(a transportation simulation game) So, I thought to create 
a game where he could travel the globe and explore history, geography, science, 
society et cetera.

Details...
1) first person so it feels one is walking amongst the pyramids et cetera
2) 3D globe
3) modes of transportation buses, trains, boats, planes, spaceships (for that 
fantasy feel)
4) “cut scenes” 1st person youtube type videos for the interactive feel
5) KDE Marble Project GeoDataPlacemark type markers for information

What I believe I need.
1) CPU Blitter running a node based 3D terrain engine using tiles (I believe 
this will allow the application to run on older machines)
2) 3 Layers..   a) Basic heightmap for terrain
b) Textures for differing levels of zooming in and out 
(LOD?)
c) Shapfiles for maintaining data on cities and places
3) SketchUp images (free 3D graphics creator accessible to any one)
4) cross platform so a to be truly open

What I can envision
1) an on-line server where people can “play the game” and upload information
2) 42000 users(I have a shapefile from Natural Earth which has a dbf of cities 
and there are 42000 cities listed with 5+ population. I do believe at least 
one person from each of those cities will get involved.
3) Users strapping web-cams onto bike helmets and baseball caps taking 
scooter/walking tours of down town Tokyo, Pharaohs pyramids, the Eiffel Tower, 
Roman Coliseum, and The Grand Canyon and posting to the site.

What I am doing...
1) teaching myself C++ using books, on-line forums and tutorials.
2) learning how to sort, classify, choose, and then organize all the various 
GIS type data. And there is a lot to understand.

Am I crazy? Maybe my 2 programmer friends say I am. But I am an Aries so I will 
tend to pound my head. So I hope some of you join in and offer advice and 
guidance.

Oh and by the way at this point my ego is in the corner cowering and my sanity 
is hiding in the closet so if you also want to mention I am crazy go ahead;)

Thanks,
Bill

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





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


Re: [osg-users] Tessellation shaders not working with Radeon Cards

2012-12-05 Thread Alexandre Valdetaro
Hi,

I have been trying to render using tessellation shaders with OSG in a Win7 x64 
with 2 different Radeon cards (obviously with support for hardware 
tessellation) but they are behaving very strangely. They show nothing in FILL 
mode but work in LINE or POINT mode. Also, even in these modes backface culling 
culls everything...

I have tested with NVidia cards and everything seemed to work normally.

The very osg example osgtessellationshaders is not working here. 

Tried with OSG 3.0.1 and 3.1.2, already updated the AMD drivers and none worked.

BTW, when i used OpenGL code inside an OSG node everything seems to work fine.

Has anyone successfuly executed the osgtessellationshaders in a win7 x64 with a 
radeon card?

EDIT:

After trying to isolate the problem, it seems that the first 2 vertices of 
every patch that is passed to osg are repeated for the rest of the patches. 
I.e. when passing an index array of (1,3,2,0) and a vertex array of (A,B,C,D), 
i expected to receive in the shader a primitive (B,D,C,A), but i receive 
(B,D,D,B). Htat is, the first to indices are always repeated.

I do not have much experience with osg, so I cannot investigate much further 
than that.

... 

Thank you!

Cheers,
Alexandre

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





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


[osg-users] Scaling while retaining the center position of the object

2012-12-05 Thread Jonathan McLaughlin
Hi,

I am using a osgManipulator::TabBoxDragger with osgManipulator::Scale2DDraggers 
to scale objects within my scene. 

Currently when dragging one of the 2D Draggers the object will scale 
accordingly but the centre of the object will not stay in the same position. 
For example, if I grab the top left corner of a square and drag to the left, 
the bottom right corner will stay where it is and the rest of the object will 
move left while being rescaled. 

What I would like to happen is for the bottom right corner to move right at the 
same rate as the top left corner moves left, all the while maintaining the 
centre position of the object being scaled

Effectively, what I want to do is scale while maintaining the proportions on 
the plane I am scaling, however cant find a way to do this.

Hopefully my explanation is comprehensible and not too long winded. Any help on 
this would be appreciated.

Thanks

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





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


[osg-users] osgFX question

2012-12-05 Thread Pjotr Svetachov
Hi,

We recently converted our stereo viewer to cull the scene graph in parallel. 
But now we are having a crash with some models that have bump mapping effects 
on them. The crash happens in Effect::traverse because both threads try to add 
new techniques.

Is there a reason this is done during the cull traversal? From my first scan 
through this code it looks like this can also be done earlier, like in the 
constructor of the Effect class. Or will this break other code I'm not aware 
off? Anyone familiar with that piece of code who can shed some light on this 
issue?

Cheers,
Pjotr

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





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


[osg-users] CompositeViewer, GUIEventHandler::handle() and events cascading across Views

2012-12-05 Thread Andreas Stahl
Hello,

there's an aspect to the compositeViewer that I don't think I quite understand. 
First I'd like to explain what I want to achieve:

I want to create a user interface that consists of one big hud, that contains 
different viewports on the scene, and if the user clicks somewhere a picking 
event is dispatched, identifying the node (hud or scene) that was picked and 
choosing a handler accordingly. I know how I could create one big scenegraph 
with multiple cameras and different viewports and render orders, but since this 
will be rather dynamic and user customizable, I want to keep concerns separated 
as neatly as possible.

To achieve that, I would rather like to use one (or multiple) view(s) to 
represent the "scene layer" and another to hold the hud/gui-layer, each with 
its own and distinct scene graph. So I create two views with the same viewport, 
Main and HUD, and hook up a simple GUIEventHandler subclass handling the 
picking in each view. I set both views to accept focus events. In the handle 
method I return true when an object of the corresponding graph was hit, false 
if not. 

Now, what I would expect from other GUI toolkits that returning false from a 
handler indicated that the event was indeed not handled in the first receiving 
view and should be propagated to the next views that contain the event's x and 
y, and conversely returning true should abort this cascade. 
This does not happen, however. The event is sent only to one of the handlers*, 
so I looked in CompositeViewer::eventTraversal and saw that the return values 
of handleWithCheckAgainstIgnoreHandledEventsMask are actually not used in 
determining if a cascade should happen or not.

So I have two questions:

1. Is using CompositeViewer with overlapping views actually a sane way to 
tackle this, or should I just go the single-view route described in the first 
paragraph? 
2. Are there plans to support event cascading in overlapping views for future 
releases? If not, what is the significance of the bool return value of handle?
 
Also, if you would be so kind, if there's some fundamental misunderstanding on 
my part, I hope you can point it out. 

Thank you!

Holiday Cheers,
Andreas


*) which instance of the handlers is chosen appearently is determined by the 
order in which the cameras' setGraphicsContext is called. The last one called 
receives the event, independent of view or render order.

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





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


Re: [osg-users] osgText::readFontFile fails to find font file

2012-12-05 Thread Nathan Collins
Hi,

I'm having some issues getting OSG to find my font file in Red Hat Enterprise 
Linux 5.8.

>From the documentation I can see that osgText::readFontFile should be looking 
>in /usr/share/fonts/ttf to find my fonts, but this path does not exist in RHEL.

I have added /usr/share/fonts to my OSG_FILE_PATH environment variable and 
called osgText::readFontFile("/liberation/LiberationSans-Regular.ttf") but my 
font is still not found (/usr/share/fonts/liberation/LiberationSans-Regular.ttf 
exists).

The error message I receive is: "Warning: Could not find plugin to read objects 
from file "/liberation/LiberationSans-Regular.ttf"."

I don't receive any other messages relating to the failure to load plugins, and 
OSG happily loads Arial in Windows.

Any advice you could provide would be really useful.

Thanks, 
Nathan

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





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


Re: [osg-users] Retrobooster playable demo

2012-12-05 Thread Jan Ciger

On 12/05/2012 08:18 PM, Terry Welsh wrote:

Hi Jan,
Thanks for all the tips and the article. I wanted to use an RPM and
DEB for this release because I really like the way Linux can resolve
dependencies for packaged software. Unfortunately, making packages is
hard to get right and there is much room for error.


Actually the basic packages that only unpack files somewhere and set 
permissions are not hard. On the other hand, dependency resolution is 
not something you want in a proprietary game - it would likely pull in a 
wrong version of the library and make your application crash or fail 
because that exact version isn't available for the version of the 
distro. You need to bundle your dependencies with the application. You 
can get some inspiration in how SecondLife client is being distributed 
(even though it is GPL licensed) or Skype.



If I was making
something open source I'd definitely try to go through distro
maintainers. When I get some more time I want to look harder at tools
like MojoSetup, Makeself, and Nixstaller. They get a lot of use by
other indie game developers.


Please don't. These Windows-like "next->next .." graphical installers 
are a nightmare in Linux, because they must have root permissions to 
install into system directories. More often than not the user will not 
know how to start it with root permissions, often the X variables are 
clobbered by su or sudo for security reasons and the installer will just 
fail with a cryptic error. They also make it easy for the user to make a 
mistake and install it into a wrong place (such as /usr), accidentally 
overwriting distro-provided shared libraries with something you are 
shipping = disaster. Finally, running black-box stuff with root 
permissions is a really bad idea - one mistake/bug in the installer and 
your system is a toast.


A tarball or self-extracting shar script are perfectly sufficient. If 
you want an rpm or deb, build systems such as CMake/CPack or autotools 
can generate one for you automatically. I do recommend CMake with CPack 
because it is excellent for cross-platform applications, autotools are a 
royal PITA. CPack can automatically build a Windows installer, 
rpms/debs/tars for Linux and I think also a package/installer for Mac.


Regards,

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


Re: [osg-users] OSG Wiki - what's going on?

2012-12-05 Thread Jan Ciger

On 11/16/2012 07:50 PM, Ryan Schneider wrote:

Hi,

I was looking at the OSG wiki today (at wiki [dot] openscenegraph [dot] com), 
and it's been taken over by ad-bots or something because the site is filled 
with hundreds of garbage articles. Is there an actively-maintained wiki 
somewhere else? If not, when is someone going to wrangle the other wiki back 
into a usable state?



Hi,

That was mentioned last week. That wiki is only an experiment, the real, 
maintained wiki is at openscenegraph.org (.org, not .com!)


Regards,

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


[osg-users] QT Gui not working with Necessitas/OSG

2012-12-05 Thread Massimo Tarantini
Hi,

I'm developing with Necessitas (QT for Android), Osg/VPB and OpenGLES 2.0
It works fine, but the Qt Gui does not work. If i add a simply QPushButton, the 
opengl rendering stop working.

After many hours of debug i found a problem in the QT Framework, in the file 
qpaintengineex_opengl2.cpp,
 inside the methodQGL2PaintEngineExPrivate::resetGLState().

void QGL2PaintEngineExPrivate::resetGLState()
{
glDisable(GL_BLEND);
glActiveTexture(GL_TEXTURE0);
glDisable(GL_STENCIL_TEST);
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
glDepthMask(true);
glDepthFunc(GL_LESS);
glClearDepth(1);
glStencilMask(0xff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
glStencilFunc(GL_ALWAYS, 0, 0xff);

ctx->d_func()->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, false);
ctx->d_func()->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, false);
ctx->d_func()->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, false);

#ifndef QT_OPENGL_ES_2
// gl_Color, corresponding to vertex attribute 3, may have been changed
float color[] = { 1.0f, 1.0f, 1.0f, 1.0f };
glVertexAttrib4fv(3, color);
#endif
}

I must comment the following 3 commands to have OSG working:
// ctx->d_func()->setVertexAttribArrayEnabled(QT_TEXTURE_COORDS_ATTR, 
false);
// ctx->d_func()->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, false);
// ctx->d_func()->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, false);

I don't know if it is a problem of OSG or Necessitas. 
Should i report a bug to the kde/Necessitas forum? 

Thank you!

Cheers,
Massimo

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





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


Re: [osg-users] OSG Wiki - what's going on?

2012-12-05 Thread Jordi Torres
Hi,
In fact openscenegraph.com is maintained too. We are migrating from .org to
.com but the migration tasks are huge. Help is appreciated ;).
Cheers.
El 05/12/2012 20:54, "Jan Ciger"  escribió:

> On 11/16/2012 07:50 PM, Ryan Schneider wrote:
>
>> Hi,
>>
>> I was looking at the OSG wiki today (at wiki [dot] openscenegraph [dot]
>> com), and it's been taken over by ad-bots or something because the site is
>> filled with hundreds of garbage articles. Is there an actively-maintained
>> wiki somewhere else? If not, when is someone going to wrangle the other
>> wiki back into a usable state?
>>
>>
> Hi,
>
> That was mentioned last week. That wiki is only an experiment, the real,
> maintained wiki is at openscenegraph.org (.org, not .com!)
>
> Regards,
>
> Jan
> __**_
> 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] Skybox blocks out other model data

2012-12-05 Thread Paul Heraty
Found the answer. The code in the example resets the depth buffer to 1.0 before 
drawing the skybox. This means that all depth info is effectively cleared from 
the z buffer, and the skybox overwrites everything then.

Not sure how this code worked in the example, but removed the z-clear from my 
code made the skybox work perfectly.

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





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


Re: [osg-users] Tutorials

2012-12-05 Thread Peterakos
Hello

Here are the books + quick guide:
http://www.openscenegraph.com/index.php/documentation/books

And you can also download the source code of many examples using svn:
http://www.openscenegraph.com/index.php/downloads/code-repositories

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


Re: [osg-users] Importing 3DS max in OSG

2012-12-05 Thread rocco martino
Hi Valeriu,

the easiest way is:
osg::ref_ptrroot = osgDB::readNodeFile("my_model.obj")

you will find more info at
http://www.openscenegraph.org/projects/osg/wiki/Support/UserGuides/Plugins


Regards,
Martino


2012/11/20 Valeriu Schneider 

> Hi,
>
> Is there any simple method to import 3ds max/maya models into osg?
>
> Thank you!
>
> Cheers,
> Valeriu
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=51159#51159
>
>
>
>
>
> ___
> 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] readNodeFile returns null without CURL env variables?

2012-12-05 Thread Ulrich Hertlein
Hi Tim,

On 24/10/12 3:59, Tim O'Leary wrote:
> When I have OSG_CURL_PROXY and OSG_CURL_PROXYPORT set to valid values, the 
> call to
> osgDB::readNodeFile( foo ) returns a valid pointer, and I'm able to load an 
> *.osg model
> from my C: drive.
> 
> When I delete these environment vars, and re-run my project, the call to 
> readNodeFile()
> returns NULL.  Nothing else has changed.  The path that I'm sending to 
> readNodeFile is
> a valid *.osg file on my C: drive.
> 
> Presumably, when I delete the CURL env vars, the CURL plugin stops working, 
> and OSG has
> no other way to load my *.osg file.  Is that a true statement?  Does this 
> mean that I'm
> missing a plugin to handle non-CURL file I/O?

Are you specifying your path URL-style, as "file:///..."?
Curl is not necessary to load resources from the local disk, but they then have 
to be
specified as plain paths.

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


Re: [osg-users] [osgPlugins] Changing CURL environment variables programmatically

2012-12-05 Thread Ulrich Hertlein
Hi Tim,

On 1/11/12 5:32, Tim O'Leary wrote:
> Is it possible to change CURL environment variables (e.g., OSG_CURL_PROXY)
> programmatically, or am I stuck with the same value until I restart my OSG
> application?
> 
> I would like to be able to change OSG_CURL_PROXY, and I'm trying to do this 
> by calling
> (in Visual++) SetEnvironmentVariable("OSG_CURL_PROXY", "some_URL") but it 
> doesn't
> appear to actually have any effect on OSG/CURL.  I have to shut down my OSG
> application, change the environment variable manually, then restart my OSG
> application.

The curl plugin also supports setting these through 
osgDB::Options::setOptionString.  The
options can be passed to the readNodeFile call.

Be aware that if the environment variables are set, then these take precedence!
(Which actually sounds like a bug to me, code supplied values should always take
precedence over environment supplied values.)

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


[osg-users] Flipped Particle Texture

2012-12-05 Thread Cheng Guan
Hi,

I tried replacing the texture of smoke trail texture with the attached texture 
(arrow.png) but the texture of each particle will flip horizontally (see 
attached picture). How to disable flipping of texture?

Thank you!

Cheers,
CG

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



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


Re: [osg-users] [osgPlugins] WindowManager on IOS?

2012-12-05 Thread David Aiken
Hi,

This isn't such a big issue for me now. I'm treating OSG as purely a renderer 
since depending too much on 3rd party GUIs for configuration screens etc. could 
cause unpredictable delays if you want to get into an app store.

Cheers,
David

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





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


Re: [osg-users] osgviewerIPhone runtime errors

2012-12-05 Thread David Aiken
Managed to get it working shortly after sending this..

thanks,
David

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





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


Re: [osg-users] Tutorials

2012-12-05 Thread michael kapelko
I personally read Wang Rui books and recommend those (found in the first
link).

2012/12/6 Peterakos 

> Hello
>
> Here are the books + quick guide:
> http://www.openscenegraph.com/index.php/documentation/books
>
> And you can also download the source code of many examples using svn:
> http://www.openscenegraph.com/index.php/downloads/code-repositories
>
> thnx.
> ___
> 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] OSG + Mesa3D

2012-12-05 Thread Andrew Cunningham
Hi Mike,
I have put a zip of the complete build directory on DropBox.

https://dl.dropbox.com/u/82874382/Mesa-7.8.2.zip

Let me know when you get it.

Andrew

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





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


Re: [osg-users] Example request: render to renderbuffer attachments of FBO of main camera.

2012-12-05 Thread Daniel Schmid
Hi,

You can have a look in my post:
http://forum.openscenegraph.org/viewtopic.php?t=11385

there is an example attached!

Thank you!

Cheers,
Daniel

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





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