Re: [osg-users] NULL Options passed to readImageFile()

2009-09-12 Thread Joe Abreu
Running any of the debug programs through dependencywalker comes up with the 
error that

MSVCP80D.DLL Error Opening File. The System cannot find the specified file ( 2).

But the file can be located here:

C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c

the release version loads MSVCP80.dll fine from the same WinSxS folder.

I do not know why they are not loaded. Event placing them in the same folder as 
the exe fails.

As you said this may be a configuration problem? But, I have just downloaded 
the binaries so I can not recompile them. I guess compiling OSG from source may 
be a solution?? ATM I do not have the time, I was only given 4 days to get a 
project complete and its deadline day.

Thanks for your help,

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





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


Re: [osg-users] OpenGL Extensions.

2009-09-12 Thread Guy Volckaert
Jan, I looked at GLEW after I wrote my original post. I was about to download 
and use when I figured out an easier way. I essentially followed robert's 
advise (thanks rob!).

NOTE: In my case, I would also need to recompile GLEW to use multiple 
threads/context (which also require installing Cygwin).

Thanks for your help.

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





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


Re: [osg-users] Render-to-texture TextureRectangle

2009-09-12 Thread Guy Volckaert
NPOT = non-power-of-two
POT = power-of-two

Since my card does not support NPOT textures, can I create a POT texture but 
command the renderTargetImplemtation to only render to a specific region of the 
texture.

For example, if my texture if 512x512 (i.e POT texture) and my viewport is 
320x240 (widthxheight), can I command the renderTargetImplememtation to render 
the entire viewport to only the 320x240 portion of the texture?

Since the viewport define in the camera is 320x240, I would expect this to 
work. Can anyone confirm this?

Regards,

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





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


Re: [osg-users] Render-to-texture TextureRectangle

2009-09-12 Thread Guy Volckaert
I was able to use a POT texture after all with the renderTargetImplementation 
of camera (as I mentioned in my last post). 

All is well with the world once again.

Thanks everyone.

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





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


[osg-users] Ann: osgBoostPython

2009-09-12 Thread Jean-Sébastien Guay

Hi all,

I'd like to announce the initial availability of osgBoostPython, a very 
work-in-progress python wrapping of OSG.


The project is on Google Code here:
http://code.google.com/p/osgboostpython/

Seeing how osgSwig had its problems wrapping recent versions of OSG, and 
wanting to do something completely different than what I do at work 
during my vacation, I started working on this. At the moment, I have 
some of osg, osgDB, osgGA and osgViewer wrapped, such that I can do the 
following completely in python code:


1. Create simple node hierarchies (osg::Node, osg::Group, osg::Geode, 
osg::Drawable, osg::Geometry, osg::ShapeDrawable)

2. Read various files (osgDB::readNodeFile, readImageFile, readShaderFile)
3. Create osg::Geometry with Vec2, Vec3 and Vec4 Arrays for vertices, 
texcoords, vertex colors and normals.
4. Set modes in a stateset and add a texture to a stateset (the only 
StateAttribute currently wrapped)
5. Start a viewer (osgViewer::Viewer) with different windowing setups 
(osgViewer::View)
6. Override osg::NodeCallback, osg::NodeVisitor and 
osgGA::GUIEventHandler in python subclasses (the enums from 
osgGA::GUIEventAdapter for key and event type have not yet been wrapped 
but this is trivial to add and will be added soon)
7. A few more that I surely forget. See the test/ directory in the code 
for some python-scripted unit tests, I try to keep these complete so 
they represent what can currently be done with the wrappers.


Lots of things are missing to make a useful application from this, and 
no performance tests have been done either (I suspect if you make a 
NodeCallback in python code, it would have to be pretty simple, but I 
have no numbers). Also, some basic tests are in the code base but some 
things are known not to work (ref_ptr gives me a bit of trouble 
sometimes), so more unit tests would be helpful.


The manual wrapping is a bit tedious to do but it has some definite 
advantages (you wrap what you need as you need it, and things are simple 
to wrap including VecXArrays).


The project's name comes from the fact that it uses Boost.Python to do 
the wrapping. Boost.Python is a way to wrap C++ libraries into Python 
modules using C++ code (boost's heavily-template metaprogramming style 
of code). As such, it uses bjam as a built tool instead of CMake, but 
anyone who has boost should have bjam too so it shouldn't be a problem. 
More info on Boost.Python can be found here:

http://www.boost.org/doc/libs/1_40_0/libs/python/doc/index.html

Essentially, I'm announcing this so people can take a look, give me 
comments, and if anyone would like to help in the initial stages I'll 
gladly accept patches. If someone wants to contribute in a more major 
way I could also give commit access to some.


I don't think I'll ever compete with osgSwig, since the focus of this 
project will likely be different. I doubt it will ever feature complete 
wrapping of all of OSG. However, it can be useful to people who want 
certain features and want lots of control over how the OSG API is 
exposed to Python.


I'll be back to regular work on Monday, so I have no idea how often 
I'll be able to work on this (it may be quite sporadic). But I'll gladly 
answer questions and review patches.


If you want to help, you can check the code and see the 
WrappingCookbook page on the project wiki to see how to continue 
wrapping. Also see the project's Issues section for some of the things I 
wanted to tackle next (but any additional wrapping will be useful). The 
README.txt in the repository explains how to build and then how to run 
the unit tests.


Hope this can be useful to someone someday. Let me know if there are 
questions or comments.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] creating integration with JUCE toolkit - manipulator not responding to mouse events

2009-09-12 Thread Terrence Vergauwen
Hi,

I'm writing a class to get an osg Viewer working from the JUCE framework 
(http://www.rawmaterialsoftware.com/juce/)

I've attached the class, things seem to work ok, i can see my node with a mesh 
object, expect that the mouse events aren't working.

I'm initializing this class from my main app as:


Code:


... build node tree ...

viewer-setSceneData( root );
//viewer.run();

viewer-setCameraManipulator(new osgGA::TrackballManipulator());
viewer-addEventHandler(new osgViewer::StatsHandler);
viewer-realize();




here's the class:


Code:

class OsgViewerComponent : public osgViewer::Viewer, public OpenGLComponent,
   public ChangeListener

{
public:
OsgViewerComponent () :
  window(NULL)
{
};

  ~OsgViewerComponent() {};

void newOpenGLContextCreated()
{
window = setUpViewerAsEmbeddedInWindow(getX(), getY(), 
getWidth(), getHeight());

getCamera()-setViewport(new osg::Viewport(0, 0, getWidth(), 
getHeight()));
getCamera()-setProjectionMatrixAsPerspective(60.0f, 
static_castdouble(getWidth())/static_castdouble(getHeight()), 1.0f, 
1.0f);
getCamera()-setGraphicsContext(window.get());
//getCamera()-setClearColor (osg::Vec4(0.2f, 0.2f, 0.2f, 
1.f));

setThreadingModel(osgViewer::Viewer::SingleThreaded);
};

void renderOpenGL()
{
frame();
};

void resized()
{
if(window.valid()) {
window-getEventQueue()-windowResize(getX(), getY(), 
getWidth(), getHeight() );
window-resized(getX(), getY(), getWidth(), 
getHeight());   
getCamera()-setViewport(new osg::Viewport(0, 0, 
getWidth(), getHeight()));
getCamera()-setProjectionMatrixAsPerspective(60.0f, 
static_castdouble(getWidth())/static_castdouble(getHeight()), 1.0f, 
1.0f);
}
};


void mouseDown (const MouseEvent e)
{
int mButton = 1; 
int flags = e.mods.getRawFlags();
if(flags == ModifierKeys::leftButtonModifier)
mButton = 1;
else if(flags == ModifierKeys::middleButtonModifier)
mButton = 2;
else if(flags == ModifierKeys::rightButtonModifier)
mButton = 3;

window-getEventQueue()-mouseButtonPress(e.x, e.y, mButton);
frame();
}

void mouseUp (const MouseEvent e)
{
int mButton = 1; 
int flags = e.mods.getRawFlags();
if(flags == ModifierKeys::leftButtonModifier)
mButton = 1;
else if(flags == ModifierKeys::middleButtonModifier)
mButton = 2;
else if(flags == ModifierKeys::rightButtonModifier)
mButton = 3;

window-getEventQueue()-mouseButtonRelease(e.x, e.y, mButton);
frame();
}

void mouseMove (const MouseEvent e)
{
window-getEventQueue()-mouseMotion(e.x, e.y);
frame();
};

void changeListenerCallback (void*) {};

juce_UseDebuggingNewOperator

private:
osg::observer_ptrosgViewer::GraphicsWindow window;

OsgViewerComponent (const OsgViewerComponent);
const OsgViewerComponent operator= (const OsgViewerComponent);
};




I've tested the juce mouseDown, mouseUp and mouseMove methods and these all 
work propperly, returning the required mouse positions (integer window coords) 
and buttons as ints.

It just seems the trackballmanipulator is'nt responding to them. 
Not sure how it should respond and what mouse/key combinations to say rotate 
the node are required as i can't find it anywhere in the openscenegrah docs.

Anyone have a clue ?

Thank you!

Cheers,
Terrence

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





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


Re: [osg-users] [solved] creating integration with JUCE toolkit - manipulator not responding to mouse events

2009-09-12 Thread Terrence Vergauwen
Hi,

I found the issue :)

Seems juce was interfering with the update with frame();
So had to request a full juce::repaint().

Cheers,
Terrence

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





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