Re: [osg-users] OSG animation in a GTK widget

2010-12-22 Thread Robert Osfield
Hi Matteo,

Have a look at the osgviewerGTK example.

Robert.

On Tue, Dec 21, 2010 at 9:50 PM, Matteo Morelli
matteo.more...@tiscali.it wrote:
 Dear all,

 I'm moving my first steps with OSG. My final goal is to embed an OSG
 animation in a GTK window (I'm also new to GTK development).

 For the animation, I've read the OSGQSG and I've also looked at the
 companion examples on Google Code ('Callback' folder). For the OSG-GTK
 integration, I've looked at the examples providen with OSG ('examples/
 osgviewerGTK' folder). Both the examples work fine, and I've learnt good
 lessons from them.

 However, I have no idea of how to merge them. How do I embed the viewer
 with the scene graph and the associated callbacks for animation in the
 OSGGTKDrawingArea?

 Any hints, code fragments or other kind of help is greatly appreciated.

 --
 Matteo
 ___
 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] On allocation of TRANSPARENT BIN

2010-12-22 Thread Robert Osfield
Hi Maximillian,

The OSG dynamically creates bins on demand during the cull traversal.
A very simple scene graph might not even use any transparent objects
so not require a RenderBin for this.  Conversely some scene graphs
such as the ones that do complete render to texture, or have multiple
layers of rendering may have dozens of RenderStage and RenderBin.
Since the demands for these resources can change each frame the OSG
doesn't pre-allocated them, instead clones them from prototypes as the
new frame requires it.

Robert.

On Tue, Dec 21, 2010 at 8:39 PM, Maximillian GUENTHER
max19...@yahoo.com wrote:
 Hi,

 I am using TRANSPARENT BIN. Code:

 Code:
 stateset-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);


 I set a breakpoint in RenderBin constructor and destructor to see the 
 allocation and deallocation.

 I ask: Why does this cause RenderBin to be allocated and deallocated every 
 frame? This does not happen with default bin.

 Thank you!

 Cheers,
 Maximillian

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





 ___
 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 animation in a GTK widget

2010-12-22 Thread Matteo Morelli

Hi Robert,

On 12/22/2010 10:00 AM, Robert Osfield wrote:

Have a look at the osgviewerGTK example.


As I said, I've already looked at osgviewerGTK


On Tue, Dec 21, 2010 at 9:50 PM, Matteo Morelli
matteo.more...@tiscali.it  wrote:

For the OSG-GTK integration, I've looked at the examples providen with
OSG ('examples/osgviewerGTK' folder).


My problem is how to embed the following code fragment:

osgViewer::Viewer viewer;
viewer.setSceneData( createScene() );
if (!viewer.getSceneData())
return( 1 );

// Loop and render. OSG calls RotateCB::operator()
//   during the update traversal.
return( viewer.run() );

in the OSGGTKDrawingArea class providen by osgviewerGTK.

Again,


Any hints, code fragments or other kind of help is greatly appreciated.


Regards,

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


Re: [osg-users] OSG animation in a GTK widget

2010-12-22 Thread Robert Osfield
Hi Matteo,

I'm afraid I have no GTK expertise, so can only point you at the
examples that users have submitted.   The 3rd party examples I have no
knowledge so can't comment at all on these, but I would suggestion
caution as some 3rd party codes are rather old and out of date.

The rest of your OSG usage will be orthogonal to GTK usage, so you can
learn about it from other examples.  Try to take each part of your
learning bit by bit - get comfortable with one area before moving on
to the next.

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


Re: [osg-users] Problem with Transparency when using osg::Cameras

2010-12-22 Thread George Bekos
Hello!

Yeah I know it is a little strange how I use the camera's but it would be great 
to make this work. I still don't understand why is this happening. Other 
options are much more complicated. I will have a look at osg source, and if I 
can't find a way around I will change my main graph design I guess. Thank you 
very much!

Cheers,
George

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





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


Re: [osg-users] Problem with Transparency when using osg::Cameras

2010-12-22 Thread Robert Osfield
Hi George,

On Wed, Dec 22, 2010 at 10:02 AM, George Bekos bekos...@live.com wrote:
 Yeah I know it is a little strange how I use the camera's but it would be 
 great to make this work. I still don't understand why is this happening. 
 Other options are much more complicated. I will have a look at osg source, 
 and if I can't find a way around I will change my main graph design I guess. 
 Thank you very much!

When you are trying to do something in a cack-handed way it tends to
suggest that you should take a step back think about what you are
trying achieve.  You explanation and use of osg::Cmaera just doesn't
make any sense to me.

Could you please take the step back, explain what you effect you are
trying to achieve with your application, please don't trying to
explain the techniques you've tried to achieve this as it'll just
confuse yourself and everybody - the focus should just be on what you
are tying to achieve and why.  Others in the community will then be
able to suggest a better way of doing it.

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


[osg-users] Troubles with texture mapping

2010-12-22 Thread Axel Spirtaat
Hi,

I'm modelling a little room. I'm tryng to apply a texture to room walls, floor 
and roof. Reading the source code of osg examples, i've implemented a little 
class hierarchy to create the geometry shape, setting colors and normals of the 
quad and, finally applying the texture (how you can see in the attachments).
If i run my application, texture are applied only on 3 faces and, one of this 
faces have 2 textures :-( 
What is wrong in my setTexture() method?
Unfortunately i have never used C  openGL, so i don't understand weell the 
tutorials.  
In the future I would like that floor and roof  have a single texture on their 
face, and lateral walls have the texture repeated, but now for now I'd settle 
for have a single texture apply for each face of the room.
Can anyone help me or suggest a simple tutorial?
 

Thank you!

Cheers,
Axel

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




Attachments: 
http://forum.openscenegraph.org//files/lateralwall_156.cpp
http://forum.openscenegraph.org//files/wall_197.cpp
http://forum.openscenegraph.org//files/wallshape_143.h


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


[osg-users] osgQt::QWidgetImage dosen't respond to event

2010-12-22 Thread Aitor Ardanza
Hi,

I'm not sure how to solve the problem ... I see that the class 
osgQt::QWidgetImage inherits from osg::Image, and osgQt::QWebViewImage inherits 
from osgWidget: BrowserImage, which in turn inherits from osg::Image.

If we define these two classes in a scene with HUD camera, no problem. But if 
we do it in a 3D free scene, osgQt::QWidgetImage no receives events...

I'm debugging osg::QWidgetImage and, as I said, if we define it in a free 3D 
scene, does not go into these functions:
virtual bool sendFocusHint(bool focus)
virtual bool sendPointerEvent(int x, int y, int buttonMask)
virtual bool sendKeyEvent(int key, bool keyDown)

I do not know how to find the source of the calls to these functions ... any 
help?


Thank you!

Cheers,
Aitor

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





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


Re: [osg-users] OSG Animation Tutorial

2010-12-22 Thread Eric Zaremba
I don't know if they are tutorails about this, but animation can be done with 
OSG.

To set your animation, you can use blender for example and then, export to osg.
Then, use osgCal to perform animation and skinning.

Eric

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





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


Re: [osg-users] OSG Animation Tutorial

2010-12-22 Thread Jerome Karim
well Eric, you just made my day a wonderful one :) 
I will be looking for further informations about osgCal and Cal3D.

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





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


[osg-users] Combined 3D Models :) ?? thanks for reading :)

2010-12-22 Thread Omar Khaled Aly


i know its a very lazy question but i really need an answer :)

i 
did create a combined  object in 3d studio max and export it as a .3ds 
then use OSG to open it i wish i can deal with each object in the 
combined model alone that i can blend one and not the others when some 
actions is done

so please help me how can i do so :) ?

thanks for reading :)

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


Re: [osg-users] OSG Animation Tutorial

2010-12-22 Thread Eric Zaremba
Hey! See it as your Christmas gift ;)

Eric

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





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


Re: [osg-users] OSG Animation Tutorial

2010-12-22 Thread Jerome Karim
thank you et merry christmas

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





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


[osg-users] Need Help ! Open Scene Graph For IPhone Shaders Issues

2010-12-22 Thread Laith Dhawahir
Hi All,
I'm Software Engineer,
and here in the company we are trying our product to IPhone/IPad.

anyway. after near to 1 month of search ,  modifying and fixing i didnt find 
any answer to my problems Problems In Open Scene Graph.

Here Is the Problem.
im trying to run the following code :
its very simple project that should show box on the screen , but the problem 
it is not showing else the background.. and search i found that there is a 
shader compiling errors in open scene graph :S. i fix it. and still nothing 
appear else the background... note i wrote a test that just change the 
background color to see if the problem is from opengles linking or something 
like.. and its work correctly..

guys i really need help..
do anyone have any idea about what is going on.


Code:

#import iphoneViewerAppDelegate.h
#include osgGA/TrackballManipulator
#include osg/ShapeDrawable
#include osgViewer/api/IOS/GraphicsWindowIOS 
#include osg/Node
#include osg/Group
#include osg/Geode
#include osg/Geometry
#include osg/Texture2D
#include osgDB/ReadFile 
#include osgViewer/Viewer
#include osg/PositionAttitudeTransform
#include osgGA/TrackballManipulator
#include osg/Geode
#include osg/TexGen
#include osg/Texture2D

#define kAccelerometerFrequency30.0 // Hz
#define kFilteringFactor0.1

@implementation iphoneViewerAppDelegate
@synthesize _window;
//
//Called once app has finished launching, create the viewer then realize. Can't 
call viewer-run as will 
//block the final inialization of the windowing system
//
- (void)applicationDidFinishLaunching:(UIApplication *)application {

//get the screen size
CGRect lFrame = [[UIScreen mainScreen] bounds];
unsigned int w = lFrame.size.width;
unsigned int h = lFrame.size.height;

// create the main window at screen size
self._window = [[UIWindow alloc] initWithFrame: lFrame]; 

//show window
[_window makeKeyAndVisible];

//create our graphics context directly so we can pass our own window 
osg::ref_ptrosg::GraphicsContext::Traits traits = new 
osg::GraphicsContext::Traits;

// Init the Windata Variable that holds the handle for the Window to 
display OSG in.
osg::ref_ptrosg::Referenced windata = new 
osgViewer::GraphicsWindowIOS::WindowData(_window);

// Setup the traits parameters
traits-x = 0;
traits-y = 0;
traits-width = w;
traits-height = h;
traits-depth = 16; //keep memory down, default is currently 24
traits-red = 33;
traits-blue = 66;
traits-green = 99;
traits-windowDecoration = false;
traits-doubleBuffer = true;
traits-sharedContext = 0;
traits-setInheritedWindowPixelFormat = true;
traits-windowName = osgViewer;

traits-inheritedWindowData = windata;

// Create the Graphics Context
osg::ref_ptrosg::GraphicsContext graphicsContext = 
osg::GraphicsContext::createGraphicsContext(traits.get());

graphicsContext-clear();

//create the viewer
viewer = new osgViewer::Viewer();


//if the context was created then attach to our viewer
if(graphicsContext)
{
viewer-getCamera()-setGraphicsContext(graphicsContext);
viewer-getCamera()-setViewport(new osg::Viewport(0, 0, traits-width, 
traits-height));
}
osg::setNotifyLevel(osg::DEBUG_FP);

root = new osg::MatrixTransform();

osg::Geode* geode = new osg::Geode();
osg::ShapeDrawable* drawable = new osg::ShapeDrawable( new 
osg::Box(osg::Vec3(0,1,1),1));

drawable-setColor(osg::Vec4(1.0f,0.0f,1.0f,0.5f));
drawable-getOrCreateStateSet();
geode-addDrawable(drawable);

root-addChild(geode);

viewer-setSceneData(root.get());

[NSTimer scheduledTimerWithTimeInterval:1.0/5.0 target:self 
selector:@selector(updateScene) userInfo:nil repeats:YES]; 

//Configure and start accelerometer
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(0.1)];
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
}
//
//Timer called function to update our scene and render the viewer
//
- (void)updateScene {
viewer-frame();
}
- (void)applicationWillResignActive:(UIApplication *)application {
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
}
-(void)applicationWillTerminate:(UIApplication *)application{
root = NULL;
viewer = NULL;
} 
//
//Accelorometer
//
- (void)accelerometer:(UIAccelerometer*)accelerometer 
didAccelerate:(UIAcceleration*)acceleration
{
//Use a basic low-pass filter to only keep the gravity in the accelerometer 
values
accel[0] = acceleration.x * kFilteringFactor + accel[0] * (1.0 - 
kFilteringFactor);
accel[1] = acceleration.y * kFilteringFactor + accel[1] * (1.0 - 
kFilteringFactor);
accel[2] = acceleration.z * kFilteringFactor + accel[2] * (1.0 - 
kFilteringFactor);
}
- (void)dealloc {
root = 

Re: [osg-users] Need Help ! Open Scene Graph For IPhone Shaders Issues

2010-12-22 Thread Eric Zaremba
Hi,

First, I don't see any call to realize();
Second, do you set any camera manipulator or position to look at your box?

Eric

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





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


[osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Wang Rui
Hi all,

After 6 months work, we would finally proudly announce a new OSG
beginners book: OpenSceneGraph 3.0 Beginner's Guide, written by Wang
Rui and Qian Xuelei, and published by Packt Publishing. This time we
are writing totally in English and you could be free from the
hard-to-read Chinese characters this time (except those in my country
:-)

The official website of this book is:
https://www.packtpub.com/openscenegraph-3-0-beginners-guide/book

And you may find it on Amazon:
http://www.amazon.com/OpenSceneGraph-3-0-Beginners-Rui-Wang/dp/1849512825/

We'd like to first thank Don Burns and Robert Osfield for their
creative efforts in giving birth to OpenSceneGraph, as well as
thousands of members in the OSG core community, for their supports and
contributions all the time.

Thanks again to Robert Osfield, a pure open source enthusiast and
father of a happy family, for his tremendous passion in leading the
development the OSG project for so many years (since 1999). He also
took time out of his busy schedule to write the foreword for this
book.

We must express our deep gratitude to Rakesh Shejwal, Usha Iyer, Leena
Purkait, Priya Mukherji, and the entire Packt Publishing team for
their talented work in producing yet another product, as well as
Jean-Sébastien Guay and Cedric Pinson for reviewing the first drafts
of the book and providing insightful feedback.

We would like to acknowledge John F. Richardson and Marek Teichmann,
who announced the book at the OpenSceneGraph BOF at SIGGRAPH 2010. We
also offer special thanks to Zhanying Wei, Xuexia Chen, Shixing Yang,
Peng Xiao, Qingliang Liu, Su Jiang, and a number of other people who
contributed to the completion of this book in different ways.

Finally, we owe the most sincere thanks to Paul Martz, who dedicates
the first non-commercial book to OSG beginners all over the world and
provides great help in supporting the publication of our past and
current books.

I will dedicate this book to his parents, Lihang Wang and Ximei Bao,
and my lovely fiancée Qin Leng, for their patience and moral support
during the entire writing.

Hope this book could be a not too bad present for everyone who wants
to learn OSG step by step, or just loves to find bugs flying around
the book :-) Finger crossed to see if this would be usable for the
community, and any suggestions and advices will be always appreciated.

Cheers, and merry Christmas to everybody,

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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Vincent Bourdier

Congratulations !

I was interested in writing this book as Packt offered me, but it was 
too much work and I'm not an OSG master yet ...

Now I'm very interested in reading it !

Vincent.

Le 22/12/2010 14:04, Wang Rui a écrit :

Hi all,

After 6 months work, we would finally proudly announce a new OSG
beginners book: OpenSceneGraph 3.0 Beginner's Guide, written by Wang
Rui and Qian Xuelei, and published by Packt Publishing. This time we
are writing totally in English and you could be free from the
hard-to-read Chinese characters this time (except those in my country
:-)

The official website of this book is:
https://www.packtpub.com/openscenegraph-3-0-beginners-guide/book

And you may find it on Amazon:
http://www.amazon.com/OpenSceneGraph-3-0-Beginners-Rui-Wang/dp/1849512825/

We'd like to first thank Don Burns and Robert Osfield for their
creative efforts in giving birth to OpenSceneGraph, as well as
thousands of members in the OSG core community, for their supports and
contributions all the time.

Thanks again to Robert Osfield, a pure open source enthusiast and
father of a happy family, for his tremendous passion in leading the
development the OSG project for so many years (since 1999). He also
took time out of his busy schedule to write the foreword for this
book.

We must express our deep gratitude to Rakesh Shejwal, Usha Iyer, Leena
Purkait, Priya Mukherji, and the entire Packt Publishing team for
their talented work in producing yet another product, as well as
Jean-Sébastien Guay and Cedric Pinson for reviewing the first drafts
of the book and providing insightful feedback.

We would like to acknowledge John F. Richardson and Marek Teichmann,
who announced the book at the OpenSceneGraph BOF at SIGGRAPH 2010. We
also offer special thanks to Zhanying Wei, Xuexia Chen, Shixing Yang,
Peng Xiao, Qingliang Liu, Su Jiang, and a number of other people who
contributed to the completion of this book in different ways.

Finally, we owe the most sincere thanks to Paul Martz, who dedicates
the first non-commercial book to OSG beginners all over the world and
provides great help in supporting the publication of our past and
current books.

I will dedicate this book to his parents, Lihang Wang and Ximei Bao,
and my lovely fiancée Qin Leng, for their patience and moral support
during the entire writing.

Hope this book could be a not too bad present for everyone who wants
to learn OSG step by step, or just loves to find bugs flying around
the book :-) Finger crossed to see if this would be usable for the
community, and any suggestions and advices will be always appreciated.

Cheers, and merry Christmas to everybody,

Wang Rui
___
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] Need Help ! Open Scene Graph For IPhone Shaders Issues

2010-12-22 Thread Laith Dhawahir
Hey Eric,
Thanks for replay to me :).

actually sorry i use them in the code, but it seem i miss to write them
anyway.. here is the code i use currently:


Code:

//if the context was created then attach to our viewer
if(graphicsContext)
{
viewer-getCamera()-setGraphicsContext(graphicsContext);
//viewer-getCamera()-setViewport(new osg::Viewport(0, 0, 
traits-width, traits-height));
}


osg::setNotifyLevel(osg::DEBUG_FP);

root = new osg::MatrixTransform();

osg::Geode* geode = new osg::Geode();
osg::ShapeDrawable* drawable = new osg::ShapeDrawable( new 
osg::Box(osg::Vec3(0,1,1),1));

drawable-setColor(osg::Vec4(1.0f,0.0f,1.0f,0.5f));
drawable-getOrCreateStateSet();
geode-addDrawable(drawable);

root-addChild(geode);*/

viewer-setSceneData(root.get());
viewer-setCameraManipulator(new osgGA::TrackballManipulator);
viewer-realize();  




yes i use realize and setCameraManipulator

... 

Thank you!

Cheers,
Laith[/code]

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





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


[osg-users] How can I read the information of the light?

2010-12-22 Thread Duan Linghao
Hi,
I have a model(osg/ive) created by 3dMax,I add a light in the model.I want to 
read out the information of the light,such as position of the light.I know the 
name of the light,then how can I read the position of the model?
Can you give me some code? 

Thank you!

Cheers,
Duan

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





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


Re: [osg-users] [3rdparty] Rendering into cegui element

2010-12-22 Thread issam boughanmi
thanks to th3Dei from the delta3d forum

i post the solution here if someone is in the same situation

the problem is on :

Code:
listBoxItem-setSelectionBrushImage(WindowsLook, MultiListSelectionBrush);



referring to wrong image
try this one, maybe work:
 
Code:

listBoxItem-setTextColours(CEGUI::colour(0.f, 0.f, 0.f));
listBoxItem-setSelectionColours(CEGUI::colour(50.f, 100.f, 180.f));
listBoxItem-setSelectionBrushImage(WindowsLook, Background);





and thanks robert for your support !

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





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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Mourad Boufarguine
Good news !!

Just bought it! It will be of a great help to our trainees and to me as well
:)
Keep up the good work !

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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Torben Dannhauer
Hi Wang,

Congratulations! I ordered it in amazon.de but in Germany it is announced to be 
delivered in 2 -5 weeks - I will see :)

Best regards,
Torben

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





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


Re: [osg-users] Combined 3D Models :) ?? thanks for reading :)

2010-12-22 Thread Laith Dhawahir
Hi,
i'm not sure if i understand your question.

but you can see this application it may help you. www.simlabsoft.com
... 

Thank you!

Cheers,
Laith

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





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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Martin Naylor
Yes great news!!!

Just ordered mine on Amazon UK, hopefully stocks will hit the UK soon.

 

Cheers

 

Martin.

 

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Mourad
Boufarguine
Sent: 22 December 2010 13:34
To: OpenSceneGraph Users
Subject: Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0
Beginner's Guide

 

Good news !!

 

Just bought it! It will be of a great help to our trainees and to me as well
:)

Keep up the good work !

 

Mourad




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


Re: [osg-users] OSG Animation Tutorial

2010-12-22 Thread Laith Dhawahir
Hey SadikMan ,
I think u need to take alook at this Application (www.simlabsoft.com) download 
the SimLab Animation it is very easy and support import and export many many 
type of formats..

enjoy it :)
merry Christmas 

... 

Thank you!

Cheers,
Laith

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





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


Re: [osg-users] OSG Animation Tutorial

2010-12-22 Thread Jerome Karim
thank you laithbasildotnet very interesting , I will looking at it tonight with 
a cup of coffé , 

but please next time no need to bother yourself by being SO polite ( enjoy it; 
Smile; merry Christmas; Thank you!; Cheers ; Laith ...kidding ;) )

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





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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Paul Martz

Excellent news, congratulations on publishing this valuable resource!
   -Paul



On 12/22/2010 6:04 AM, Wang Rui wrote:

Hi all,

After 6 months work, we would finally proudly announce a new OSG
beginners book: OpenSceneGraph 3.0 Beginner's Guide, written by Wang
Rui and Qian Xuelei, and published by Packt Publishing. This time we
are writing totally in English and you could be free from the
hard-to-read Chinese characters this time (except those in my country
:-)

The official website of this book is:
https://www.packtpub.com/openscenegraph-3-0-beginners-guide/book

And you may find it on Amazon:
http://www.amazon.com/OpenSceneGraph-3-0-Beginners-Rui-Wang/dp/1849512825/

We'd like to first thank Don Burns and Robert Osfield for their
creative efforts in giving birth to OpenSceneGraph, as well as
thousands of members in the OSG core community, for their supports and
contributions all the time.

Thanks again to Robert Osfield, a pure open source enthusiast and
father of a happy family, for his tremendous passion in leading the
development the OSG project for so many years (since 1999). He also
took time out of his busy schedule to write the foreword for this
book.

We must express our deep gratitude to Rakesh Shejwal, Usha Iyer, Leena
Purkait, Priya Mukherji, and the entire Packt Publishing team for
their talented work in producing yet another product, as well as
Jean-Sébastien Guay and Cedric Pinson for reviewing the first drafts
of the book and providing insightful feedback.

We would like to acknowledge John F. Richardson and Marek Teichmann,
who announced the book at the OpenSceneGraph BOF at SIGGRAPH 2010. We
also offer special thanks to Zhanying Wei, Xuexia Chen, Shixing Yang,
Peng Xiao, Qingliang Liu, Su Jiang, and a number of other people who
contributed to the completion of this book in different ways.

Finally, we owe the most sincere thanks to Paul Martz, who dedicates
the first non-commercial book to OSG beginners all over the world and
provides great help in supporting the publication of our past and
current books.

I will dedicate this book to his parents, Lihang Wang and Ximei Bao,
and my lovely fiancée Qin Leng, for their patience and moral support
during the entire writing.

Hope this book could be a not too bad present for everyone who wants
to learn OSG step by step, or just loves to find bugs flying around
the book :-) Finger crossed to see if this would be usable for the
community, and any suggestions and advices will be always appreciated.

Cheers, and merry Christmas to everybody,

Wang Rui


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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Jean-Sébastien Guay

Hi Wang Rui,


After 6 months work, we would finally proudly announce a new OSG
beginners book: OpenSceneGraph 3.0 Beginner's Guide, written by Wang
Rui and Qian Xuelei, and published by Packt Publishing.


Congratulations! It's great to see this book come out and in the hands 
of the users!


This book is some excellent work, and goes through beginner and 
intermediate subjects in a progressive and easy to understand manner, 
and covers them in good detail. It is a great book for anyone working 
with OSG.


Great work to you and Qian Xuelei. And now it's time to take a vacation 
and get some rest, you've earned it! :-)


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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Wang Rui
Hi J-S,

Many thanks to your great technique reviewing work, without which we
couldn't make out this book and huge number of concepts smoothly.

Will the Packt send a copy of the book to you?If not, I'll manage to
send you one as a gift for free. :-)

Cheers,

Wang Rui


2010/12/22 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com:
 Hi Wang Rui,

 After 6 months work, we would finally proudly announce a new OSG
 beginners book: OpenSceneGraph 3.0 Beginner's Guide, written by Wang
 Rui and Qian Xuelei, and published by Packt Publishing.

 Congratulations! It's great to see this book come out and in the hands of
 the users!

 This book is some excellent work, and goes through beginner and intermediate
 subjects in a progressive and easy to understand manner, and covers them in
 good detail. It is a great book for anyone working with OSG.

 Great work to you and Qian Xuelei. And now it's time to take a vacation and
 get some rest, you've earned it! :-)

 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] draw a 3D pipe

2010-12-22 Thread lucie lemonnier
Hi,

I want to draw a 3D curved pipe from a list of points.
I looked at osgModeling but I don't know how to do this.
Would you have an idea using osgModeling or something else?

Thank you!

Cheers,
lucie

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





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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Jean-Sébastien Guay

Hi Wang Rui,


Many thanks to your great technique reviewing work, without which we
couldn't make out this book and huge number of concepts smoothly.


It was a real pleasure to be part of the process, this book will really 
help users (new and not so new).



Will the Packt send a copy of the book to you?If not, I'll manage to
send you one as a gift for free. :-)


Yes, they are sending one to me, it was part of the deal :-)

But I will be buying a few more for work. I want to encourage you as 
well after all!


Thanks,

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] Shader problem on nvidia card

2010-12-22 Thread Aitor Ardanza
Hi,

I have a problem when I apply a shader to an object in osg. I tried it on two 
machines. One with an intel G41 graphics card, which does not give me any 
problem, and the other is a NVidia GTX 480, which gives me the problem. When 
osg try to compile the shader, skip the following error:

FRAGMENT glCompileShader  FAILED
VERTEX glCompileShader  FAILED
glLinkProgram  FAILED
Error: In Texture::Extensions::setupGLExtensions(..) OpenGL version test 
failed, requires valid graphics context.

Vertex program:

Code:

uniform mat4 boneMatrices[2];

attribute vec4 weights;
attribute vec4 matrixIndices;
attribute float numBones;

varying vec2 Texcoord;
varying vec3 ViewDirection;
varying vec3 LightDirection;
varying vec3 Normal;

void main( void )
{
vec4 normal  = vec4( gl_Normal.xyz, 0.0 );
vec4 tempPosition= vec4( 0.0, 0.0, 0.0, 0.0 );
vec4 tempNormal  = vec4( 0.0, 0.0, 0.0, 0.0 );
for(int i = 0; i  int(numBones); i++  )
{
// Apply influence of bone i
tempPosition += vec4((boneMatrices[int(matrixIndices[i])] * 
gl_Vertex).xyz,1.0) * weights[i];

// Transform normal by bone i
tempNormal += (boneMatrices[int(matrixIndices[i])] * normal) * 
weights[i];
}

gl_Position = gl_ModelViewProjectionMatrix * tempPosition;
Texcoord= gl_MultiTexCoord0.xy;

vec4 fvObjectPosition =  gl_ModelViewMatrix * gl_Vertex;
   
ViewDirection  = normalize(-fvObjectPosition.xyz);
LightDirection = normalize(gl_LightSource[0].position.xyz - 
fvObjectPosition.xyz);
Normal = normalize(gl_NormalMatrix * tempNormal.xyz);
}



Fragment program:

Code:

uniform sampler2D baseMap;

varying vec3 ViewDirection;
varying vec3 LightDirection;
varying vec3 Normal;
varying vec2 Texcoord;

void main( void )
{
float NdotL = max(dot(Normal, LightDirection), 0.0);
vec4 diffuse = NdotL * gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;

vec4 ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
vec4 globalAmbient = gl_LightModel.ambient * gl_FrontMaterial.ambient;

vec3  fvReflection = normalize( ( ( 2.0 * Normal ) * NdotL ) - 
LightDirection ); 
float fRDotV   = max( 0.0, dot( fvReflection, ViewDirection ) );
vec4 specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * 
pow(fRDotV,200.0);

vec4 color =  diffuse + globalAmbient + ambient + specular;

gl_FragColor = texture2D( baseMap, Texcoord ) * color;
}



I fail to understand what may be the problem... any idea?

Thank you!

Cheers,
Aitor

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





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


[osg-users] invalid operation (osgearth and viewer)

2010-12-22 Thread Martin Naylor
Hi all,
I have a HP 6730b (with the dreaded Intel 4 express graphics chipset, latest
driver, believe it supports GL2)
Guessing this is a driver bug, I am getting the following error when running
osgviewer srtm.earth:
Warning: detected OpenGL error 'invalid operation' at after
RenderBin::draw(..)

Digging deeper into the OSG debug output:
VERTEX Shader osgearth_vert_setupTexturing infolog:
No errors.
Linking osg::Program  id=1 contextID=0
Program  link succeded, infolog:
No errors.
Uniform osgearth_LightingEnabled loc=0 size=1 type=bool
Uniform osgearth_ImageLayerEnabled loc=65536 size=2 type=bool
Uniform osgearth_ImageLayerRange loc=131072 size=4 type=float
Uniform osgearth_ImageLayerAttenuation loc=196608 size=1
type=float
Uniform tex1 loc=262144 size=1 type=sampler2D
Uniform osgearth_ImageLayerOpacity loc=327680 size=2 type=float
Attrib gl_Vertex loc=0 size=1
Attrib gl_Normal loc=17 size=1
Attrib gl_MultiTexCoord0 loc=21 size=1
Attrib gl_MultiTexCoord1 loc=22 size=1

OpenGL extension 'GL_EXT_secondary_color' is supported.
OpenGL extension 'GL_EXT_fog_coord' is supported.
Warning: detected OpenGL error 'invalid operation' at after
RenderBin::draw(..)

Also a bit further down the log:

draw() got SceneView 00D369F8
OpenGL extension '' is not supported.
Setting up osg::Camera::FRAME_BUFFER
draw() 00D362B8
draw() got SceneView 00D3C7F0

Created new 0FE1B330 TextureObject, _numOfTextureObjects 9
Snipped

Created new 0FE1B330 TextureObject, _numOfTextureObjects 26
end draw() 00D363D0
OpenGL extension '' is not supported.
Setting up osg::Camera::FRAME_BUFFER

It does appear as an earth but with no textures, height data is applied to
the earth and shows ok, just no textures.
Anyone know why, it works ok on my Nvidia 480 desktop, guess this could be
an OSGEarth issue or the chipset driver is just naff?

Cheers

Martin Naylor


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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Paul Martz
Is the book available electronically? Kindle, safari, PDF, etc? (Due to my 
eyesight, I am no longer able to read print material of any kind.)


Thanks,
   -Paul

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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Jean-Sébastien Guay

Hi Paul,


Is the book available electronically? Kindle, safari, PDF, etc? (Due to
my eyesight, I am no longer able to read print material of any kind.)


You can buy and download it directly from Packt in ebook format (I guess 
it's PDF).


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


Re: [osg-users] Shader problem on nvidia card

2010-12-22 Thread Robert Osfield
Hi Aitor,

The warning you are getting OpenGL version test failed, requires
valid graphics context. suggests that you are trying to do rendering
from a thread that doesn't have a graphics context current.

I know nothing about how you are setting up your graphics context or
how you manage you frame loop so I can do little to advice beyond
suggesting that you try the same scene graph with a standard OSG
example that is known to set up graphics contexts correctly and then
see how you can fix your application to match this.

Robert.

On Wed, Dec 22, 2010 at 2:56 PM, Aitor Ardanza aitoralt...@terra.es wrote:
 Hi,

 I have a problem when I apply a shader to an object in osg. I tried it on two 
 machines. One with an intel G41 graphics card, which does not give me any 
 problem, and the other is a NVidia GTX 480, which gives me the problem. When 
 osg try to compile the shader, skip the following error:

 FRAGMENT glCompileShader  FAILED
 VERTEX glCompileShader  FAILED
 glLinkProgram  FAILED
 Error: In Texture::Extensions::setupGLExtensions(..) OpenGL version test 
 failed, requires valid graphics context.

 Vertex program:

 Code:

 uniform mat4 boneMatrices[2];

 attribute vec4 weights;
 attribute vec4 matrixIndices;
 attribute float numBones;

 varying vec2 Texcoord;
 varying vec3 ViewDirection;
 varying vec3 LightDirection;
 varying vec3 Normal;

 void main( void )
 {
    vec4 normal      = vec4( gl_Normal.xyz, 0.0 );
    vec4 tempPosition    = vec4( 0.0, 0.0, 0.0, 0.0 );
    vec4 tempNormal  = vec4( 0.0, 0.0, 0.0, 0.0 );
    for(int i = 0; i  int(numBones); i++  )
    {
        // Apply influence of bone i
        tempPosition += vec4((boneMatrices[int(matrixIndices[i])] * 
 gl_Vertex).xyz,1.0) * weights[i];

        // Transform normal by bone i
        tempNormal += (boneMatrices[int(matrixIndices[i])] * normal) * 
 weights[i];
    }

    gl_Position = gl_ModelViewProjectionMatrix * tempPosition;
    Texcoord    = gl_MultiTexCoord0.xy;

    vec4 fvObjectPosition =  gl_ModelViewMatrix * gl_Vertex;

    ViewDirection  = normalize(-fvObjectPosition.xyz);
    LightDirection = normalize(gl_LightSource[0].position.xyz - 
 fvObjectPosition.xyz);
    Normal         = normalize(gl_NormalMatrix * tempNormal.xyz);
 }



 Fragment program:

 Code:

 uniform sampler2D baseMap;

 varying vec3 ViewDirection;
 varying vec3 LightDirection;
 varying vec3 Normal;
 varying vec2 Texcoord;

 void main( void )
 {
    float NdotL = max(dot(Normal, LightDirection), 0.0);
    vec4 diffuse = NdotL * gl_FrontMaterial.diffuse * 
 gl_LightSource[0].diffuse;

    vec4 ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
    vec4 globalAmbient = gl_LightModel.ambient * gl_FrontMaterial.ambient;

    vec3  fvReflection     = normalize( ( ( 2.0 * Normal ) * NdotL ) - 
 LightDirection );
    float fRDotV           = max( 0.0, dot( fvReflection, ViewDirection ) );
    vec4 specular = gl_FrontMaterial.specular * gl_LightSource[0].specular * 
 pow(fRDotV,200.0);

    vec4 color =  diffuse + globalAmbient + ambient + specular;

    gl_FragColor = texture2D( baseMap, Texcoord ) * color;
 }



 I fail to understand what may be the problem... any idea?

 Thank you!

 Cheers,
 Aitor

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





 ___
 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] invalid operation (osgearth and viewer)

2010-12-22 Thread Robert Osfield
Hi Martin,

I can't say what the problem is, the error could one of many things.
Does your hardware/driver support compressed textures, VPB by default
generates databases with compressed textures?  Try a paged database
that doesn't use compressed textures.

Robert.

On Wed, Dec 22, 2010 at 3:09 PM, Martin Naylor
martinnay...@virginmedia.com wrote:
 Hi all,
 I have a HP 6730b (with the dreaded Intel 4 express graphics chipset, latest
 driver, believe it supports GL2)
 Guessing this is a driver bug, I am getting the following error when running
 osgviewer srtm.earth:
 Warning: detected OpenGL error 'invalid operation' at after
 RenderBin::draw(..)

 Digging deeper into the OSG debug output:
 VERTEX Shader osgearth_vert_setupTexturing infolog:
 No errors.
 Linking osg::Program  id=1 contextID=0
 Program  link succeded, infolog:
 No errors.
        Uniform osgearth_LightingEnabled loc=0 size=1 type=bool
        Uniform osgearth_ImageLayerEnabled loc=65536 size=2 type=bool
        Uniform osgearth_ImageLayerRange loc=131072 size=4 type=float
        Uniform osgearth_ImageLayerAttenuation loc=196608 size=1
 type=float
        Uniform tex1 loc=262144 size=1 type=sampler2D
        Uniform osgearth_ImageLayerOpacity loc=327680 size=2 type=float
        Attrib gl_Vertex loc=0 size=1
        Attrib gl_Normal loc=17 size=1
        Attrib gl_MultiTexCoord0 loc=21 size=1
        Attrib gl_MultiTexCoord1 loc=22 size=1

 OpenGL extension 'GL_EXT_secondary_color' is supported.
 OpenGL extension 'GL_EXT_fog_coord' is supported.
 Warning: detected OpenGL error 'invalid operation' at after
 RenderBin::draw(..)

 Also a bit further down the log:

 draw() got SceneView 00D369F8
 OpenGL extension '' is not supported.
 Setting up osg::Camera::FRAME_BUFFER
 draw() 00D362B8
 draw() got SceneView 00D3C7F0

 Created new 0FE1B330 TextureObject, _numOfTextureObjects 9
 Snipped

 Created new 0FE1B330 TextureObject, _numOfTextureObjects 26
 end draw() 00D363D0
 OpenGL extension '' is not supported.
 Setting up osg::Camera::FRAME_BUFFER

 It does appear as an earth but with no textures, height data is applied to
 the earth and shows ok, just no textures.
 Anyone know why, it works ok on my Nvidia 480 desktop, guess this could be
 an OSGEarth issue or the chipset driver is just naff?

 Cheers

 Martin Naylor


 ___
 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] invalid operation (osgearth and viewer)

2010-12-22 Thread Glenn Waldron
Martin,

Can you set:
OSGEARTH_NOTIFY_LEVEL=INFO

and run osgearth_viewer and post the output?
Thanks

Glenn Waldron : Pelican Mapping


On Wed, Dec 22, 2010 at 10:09 AM, Martin Naylor 
martinnay...@virginmedia.com wrote:

 Hi all,
 I have a HP 6730b (with the dreaded Intel 4 express graphics chipset,
 latest
 driver, believe it supports GL2)
 Guessing this is a driver bug, I am getting the following error when
 running
 osgviewer srtm.earth:
 Warning: detected OpenGL error 'invalid operation' at after
 RenderBin::draw(..)

 Digging deeper into the OSG debug output:
 VERTEX Shader osgearth_vert_setupTexturing infolog:
 No errors.
 Linking osg::Program  id=1 contextID=0
 Program  link succeded, infolog:
 No errors.
Uniform osgearth_LightingEnabled loc=0 size=1 type=bool
Uniform osgearth_ImageLayerEnabled loc=65536 size=2 type=bool
Uniform osgearth_ImageLayerRange loc=131072 size=4 type=float
Uniform osgearth_ImageLayerAttenuation loc=196608 size=1
 type=float
Uniform tex1 loc=262144 size=1 type=sampler2D
Uniform osgearth_ImageLayerOpacity loc=327680 size=2 type=float
Attrib gl_Vertex loc=0 size=1
Attrib gl_Normal loc=17 size=1
Attrib gl_MultiTexCoord0 loc=21 size=1
Attrib gl_MultiTexCoord1 loc=22 size=1

 OpenGL extension 'GL_EXT_secondary_color' is supported.
 OpenGL extension 'GL_EXT_fog_coord' is supported.
 Warning: detected OpenGL error 'invalid operation' at after
 RenderBin::draw(..)

 Also a bit further down the log:

 draw() got SceneView 00D369F8
 OpenGL extension '' is not supported.
 Setting up osg::Camera::FRAME_BUFFER
 draw() 00D362B8
 draw() got SceneView 00D3C7F0

 Created new 0FE1B330 TextureObject, _numOfTextureObjects 9
 Snipped

 Created new 0FE1B330 TextureObject, _numOfTextureObjects 26
 end draw() 00D363D0
 OpenGL extension '' is not supported.
 Setting up osg::Camera::FRAME_BUFFER

 It does appear as an earth but with no textures, height data is applied to
 the earth and shows ok, just no textures.
 Anyone know why, it works ok on my Nvidia 480 desktop, guess this could be
 an OSGEarth issue or the chipset driver is just naff?

 Cheers

 Martin Naylor


 ___
 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] On allocation of TRANSPARENT BIN

2010-12-22 Thread Maximillian GUENTHER
Hi,


 dozens of RenderStage and RenderBin.
 Since the demands for these resources can change each frame 


But also RenderStage is not allocated and deallocated eacch frame. It uses 
RenderStageCache. Why is TRANSPARENT_BIN allocated and deallocated each fram, 
but RenderStage uses a cache? Does TRANSPARENT_BIN need a cache? To make it 
avoid the heap.

Thank you!

Cheers,
Maximillian

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





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


Re: [osg-users] OSG problem with multiple cards

2010-12-22 Thread Steve Satterfield


If anyone is interested in trying this example program to reproduce our 
multi-card performance problem, I have our test case data file available. 
Contact me directly and I will give you the details of where to access it.


Below are the environment variables I have set and the FPS results for
four sample runs of the attached program.

-Steve


Set these environment variables:

export __GL_SYNC_TO_VBLANK=0
export OSG_SERIALIZE_DRAW_DISPATCH=OFF
export OSG_THREADING=CullThreadPerCameraDrawThreadPerContext


Command executedFPS
---

./multiWindows 0   testex.ive   146

./multiWindows 0 1 testex.ive52

./multiWindows 0 1 2   testex.ive26

./multiWindows 0 1 2 3 testex.ive15



On Tue, 14 Dec 2010, John Kelso wrote:


Hi all,

As Tim and Robert requested, attached is the OSG program I've been using to show
the problem with threading.  It's called multiWindows.cpp

Tim, I'd be very interested if you could run it and see what happens.
Anybody else out there have a system with more than one graphics card that
can give it a try?

To run it, specify 1 or more screen numbers, then a file to load.

For example:

  multiWindows 0 1 2 3 bigHonkingModelFile.ive

will create windows on 4 displays (:0.0 :0.1 :0.2 :0.3 -or- :0.0 :1.0 :2.0
:3.0 - look at the #if in the source for how to choose which one) and also
set processor affinity to processors 0 1 2 3.

As Steve mentioned, we have been using a pretty big file to show the drop in
frame rate.  Steve's working on getting it onto an ftp server.

As for the non-OSG program that doesn't show the problem, it uses a package
called DGL, which is the OpenGL component of the DIVERSE package.  In
brief, DGL lets you run an OpenGL program as a callback.  The program I
wrote was the basic OpenGL helix program, but modified to spew enough
triangles to give a frame rate that was less than 60hz on our system.
I always got the same frame rate no matter if I ran on 1, 2, 3, or 4 cards.

-- I think the following might be important ---

DGL has its own threading and draw code.  It uses OpenThreads for threading.
The OpenGL calls generated by draw() are sent to the defined windows using
OSG's SceneView class and Producer.  So, it's not completely OSG-free, but
as its threading works, perhaps this indicates that the OSG problem is not
in SceneView.

If anyone wants to install DGL I can send them details on how to get it and
install it, and the modified helix test file. The DIVERSE home page is
http://diverse.sourceforge.net/diverse/

I hope this is helpful.

Many thanks,

John

On Tue, 14 Dec 2010, Steve Satterfield wrote:


Hi Tim,

I have pulled your questions out of the body of the test and responding to
them up front.


Are you using Linux?


Yes, we are running CentOS and our sys admin keeps it very much up to date.


Could you share the source of this program?


  Yes, we can post the source code. John Kelso did the actual work and
  he will follow up with the code and details in a separate
  message. There are actually two test programs.

  The first test is a straight OSG only test. It is the primary code
  used for most of the tests. It reads any OSG loadable file. We have
  an .ive test case. I need to make it available via FTP. Details will
  follow.

  The second test does not use OSG and does the graphics directly with
  OpenGL. It does require some additional software to download and install.
  John will provide details.


It is paradoxical. That it works at all is do to the fact that, with
vsync enabled, all GPU activity is buffered up until the after the
next SwapBuffers call.


  I am not entirely clear what you mean in this statement. I will say
  that for the majority of our testing, we have the Nvidia environment
  variable __GL_SYNC_TO_VBLANK set to 0 so the swap is tied to
  vblank. I believe this is specific to the Nvidia driver. For normal
  production its set to 1. The X/N performance is observed in both
  cases.



I put together a multicard system specifically to look at these
issues, and I too am very interested in getting it to work.


  Does this mean you are seeing performance problems like I have
  described on your system? We would certainly be interested in
  hearing how our test program(s) run on your multi-card system.

  I will add that we had Nvidia contacts interested in eliminating if
  the problem is related to Nvidia drivers. They got the X/N
  performance on a a non-Nvidia machine and that's what prompted me to
  build a dual ATI based machine as I reported in the original
  message. Its always useful to demonstrate a problem on multiple
  platforms.


-Steve






On Mon, 13 Dec 2010, Tim Moore wrote:




On Mon, Dec 13, 2010 at 9:51 PM, Steve Satterfield 
st...@nist.govmailto:st...@nist.gov wrote:

Hi,

I would like to update the discussion we started back in October
regarding an apparent problem scaling OSG to multiple 

Re: [osg-users] On allocation of TRANSPARENT BIN

2010-12-22 Thread Robert Osfield
Hi Maximum,

Only the top level RenderStage is reused for each viewer level
osg::Camera, all the rest of the RenderStage are created on the fly.

This system might seem quite complicated, but for the most part you
won't need to worry about this complexity, it just happens in the
OSG's rendering backend supporting what your scene graph requires of
it.

The thing to take away right away is that the OSG is extremely
flexible and scaling when handling multi-pass and multi-stage
rendering, when you needs it power it'll be there waiting for you.

Robert.

On Wed, Dec 22, 2010 at 5:40 PM, Maximillian GUENTHER
max19...@yahoo.com wrote:
 Hi,


 dozens of RenderStage and RenderBin.
 Since the demands for these resources can change each frame


 But also RenderStage is not allocated and deallocated eacch frame. It uses 
 RenderStageCache. Why is TRANSPARENT_BIN allocated and deallocated each fram, 
 but RenderStage uses a cache? Does TRANSPARENT_BIN need a cache? To make it 
 avoid the heap.

 Thank you!

 Cheers,
 Maximillian

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





 ___
 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] invalid operation (osgearth and viewer)

2010-12-22 Thread Martin Naylor
Hi Glen,

The file is a bit big to send on the list, it now crashes when I exit using
osgearth_viewer instead of osgviewer, which appears to be openthread
related., it doesn't crash everytime either.

Shall I send the file direct to yourself?

Browsing the log I noticed the texture extensions below as suggested by
Robert 

I should also add I am running both the svn versions of OSG and OSGEarth on
Windows 7 pro (32bit on laptop) using VS2008, i am also seeing the malformed
polygons when running osgviewer cow.osg as was mentioned previously by
somebody else using Intel drivers.

 

 

 

HANDLE_NON_HTTP: _pager-size()= 6 to delete = 0

DatabasePager::RequestQueue::takeFirst() Found DatabaseRequest size()=5

HANDLE_NON_HTTP: Passing http requests over 1_0_1.2.osgearth_osgterrain_tile

OpenGL extension 'GL_ARB_multitexture' is supported.

OpenGL extension 'GL_EXT_texture_filter_anisotropic' is supported.

OpenGL extension 'GL_ARB_texture_compression' is supported.

OpenGL extension 'GL_EXT_texture_compression_s3tc' is supported.

OpenGL extension 'GL_EXT_texture_compression_rgtc' is not supported.

OpenGL extension 'GL_IMG_texture_compression_pvrtc' is not supported.

OpenGL extension 'GL_IBM_texture_mirrored_repeat' is supported.

OpenGL extension 'GL_EXT_texture_edge_clamp' is supported.

OpenGL extension 'GL_ARB_texture_border_clamp' is supported.

OpenGL extension 'GL_SGIS_generate_mipmap' is supported.

OpenGL extension 'GL_ARB_texture_multisample' is not supported.

OpenGL extension 'GL_ARB_shadow' is supported.

OpenGL extension 'GL_ARB_shadow_ambient' is not supported.

OpenGL extension 'GL_APPLE_client_storage' is not supported.

OpenGL extension 'GL_ARB_texture_non_power_of_two' is supported.

OpenGL extension 'GL_EXT_texture_integer' is not supported.

Created new 0B618EE8 TextureObject, _numOfTextureObjects 1

 

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


Re: [osg-users] invalid operation (osgearth and viewer)

2010-12-22 Thread Robert Osfield
Hi Martin,

From extension it looks like texture compression is supported so in
theory should work fine.

I don't know if it's related at all, but there is a submission on
osg-users that added buffer object pointer clamping to 4 byte
boundaries to address a crash with Intel hardware/drivers.  The
submission was in form that was suitable for merging, but it might be
worth you looking at to see if it affects things at your end.

Beyond that, I'd guess it's a driver bug, so would recommend have a
look at any updating drivers if that is possible.

Robert.

On Wed, Dec 22, 2010 at 7:29 PM, Martin Naylor
martinnay...@virginmedia.com wrote:
 Hi Glen,

 The file is a bit big to send on the list, it now crashes when I exit using
 osgearth_viewer instead of osgviewer, which appears to be openthread
 related., it doesn’t crash everytime either.

 Shall I send the file direct to yourself?

 Browsing the log I noticed the texture extensions below as suggested by
 Robert

 I should also add I am running both the svn versions of OSG and OSGEarth on
 Windows 7 pro (32bit on laptop) using VS2008, i am also seeing the malformed
 polygons when running osgviewer cow.osg as was mentioned previously by
 somebody else using Intel drivers.







 HANDLE_NON_HTTP: _pager-size()= 6 to delete = 0

 DatabasePager::RequestQueue::takeFirst() Found DatabaseRequest size()=5

 HANDLE_NON_HTTP: Passing http requests over 1_0_1.2.osgearth_osgterrain_tile

 OpenGL extension 'GL_ARB_multitexture' is supported.

 OpenGL extension 'GL_EXT_texture_filter_anisotropic' is supported.

 OpenGL extension 'GL_ARB_texture_compression' is supported.

 OpenGL extension 'GL_EXT_texture_compression_s3tc' is supported.

 OpenGL extension 'GL_EXT_texture_compression_rgtc' is not supported.

 OpenGL extension 'GL_IMG_texture_compression_pvrtc' is not supported.

 OpenGL extension 'GL_IBM_texture_mirrored_repeat' is supported.

 OpenGL extension 'GL_EXT_texture_edge_clamp' is supported.

 OpenGL extension 'GL_ARB_texture_border_clamp' is supported.

 OpenGL extension 'GL_SGIS_generate_mipmap' is supported.

 OpenGL extension 'GL_ARB_texture_multisample' is not supported.

 OpenGL extension 'GL_ARB_shadow' is supported.

 OpenGL extension 'GL_ARB_shadow_ambient' is not supported.

 OpenGL extension 'GL_APPLE_client_storage' is not supported.

 OpenGL extension 'GL_ARB_texture_non_power_of_two' is supported.

 OpenGL extension 'GL_EXT_texture_integer' is not supported.

 Created new 0B618EE8 TextureObject, _numOfTextureObjects 1



 ___
 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] [osgPlugins] upgrades to osgdb_bsp

2010-12-22 Thread Thomas Dickerson
I was sidetracked for a while with exams and such, but I got back to work and I 
think I have all but one (or two) of the bugs worked out.

Looking at the image below (and ignoring the wooden gates), the bottom half 
represents what the top half should look like, minus the lighting. The faces 
that are strangely darker in the top half would lead me to believe that perhaps 
I have some faces which are flipped and showing their back face. But as far as 
the distortion of the stone texture on the ramp is concerned I'm stumped. The 
texturing is applied based on two texgen equations which are applied 
statically (not with a TexGen node) to generate a UV coordinate as follows: 
Given a point pt, and an x and y plane defining the texgen equation, 
Code:
u = pt.x*xP.x + pt.y*xP.y + pt.z*xP.z + xP.w;
v = pt.x*yP.x + pt.y*yP.y + pt.z*yP.z+yP.w;



[Image: http://img814.imageshack.us/img814/9619/funkytex.jpg ]


gDEBugger shows that the relevant textures in both osgViewer and the reference 
program are loaded and undistorted in memory. If anyone here has a hunch as to 
the cause, or has seen similar problems before, I'd love to hear about it.


Vermont Sustainable Heating Initiative (http://www.sustainableheatingvt.org) || 
Village2Village Project (http://www.village2villageproject.org)

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





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


Re: [osg-users] invalid operation (osgearth and viewer)

2010-12-22 Thread Glenn Waldron
Martin,
Sure, send me the file.

Glenn


On Wed, Dec 22, 2010 at 2:29 PM, Martin Naylor martinnay...@virginmedia.com
 wrote:

 Hi Glen,

 The file is a bit big to send on the list, it now crashes when I exit using
 osgearth_viewer instead of osgviewer, which appears to be openthread
 related., it doesn’t crash everytime either.

 Shall I send the file direct to yourself?

 Browsing the log I noticed the texture extensions below as suggested by
 Robert

 I should also add I am running both the svn versions of OSG and OSGEarth on
 Windows 7 pro (32bit on laptop) using VS2008, i am also seeing the malformed
 polygons when running osgviewer cow.osg as was mentioned previously by
 somebody else using Intel drivers.







 HANDLE_NON_HTTP: _pager-size()= 6 to delete = 0

 DatabasePager::RequestQueue::takeFirst() Found DatabaseRequest size()=5

 HANDLE_NON_HTTP: Passing http requests over
 1_0_1.2.osgearth_osgterrain_tile

 OpenGL extension 'GL_ARB_multitexture' is supported.

 OpenGL extension 'GL_EXT_texture_filter_anisotropic' is supported.

 OpenGL extension 'GL_ARB_texture_compression' is supported.

 OpenGL extension 'GL_EXT_texture_compression_s3tc' is supported.

 OpenGL extension 'GL_EXT_texture_compression_rgtc' is not supported.

 OpenGL extension 'GL_IMG_texture_compression_pvrtc' is not supported.

 OpenGL extension 'GL_IBM_texture_mirrored_repeat' is supported.

 OpenGL extension 'GL_EXT_texture_edge_clamp' is supported.

 OpenGL extension 'GL_ARB_texture_border_clamp' is supported.

 OpenGL extension 'GL_SGIS_generate_mipmap' is supported.

 OpenGL extension 'GL_ARB_texture_multisample' is not supported.

 OpenGL extension 'GL_ARB_shadow' is supported.

 OpenGL extension 'GL_ARB_shadow_ambient' is not supported.

 OpenGL extension 'GL_APPLE_client_storage' is not supported.

 OpenGL extension 'GL_ARB_texture_non_power_of_two' is supported.

 OpenGL extension 'GL_EXT_texture_integer' is not supported.

 Created new 0B618EE8 TextureObject, _numOfTextureObjects 1



 ___
 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


[osg-users] AGX Multiphysics with OSG

2010-12-22 Thread Kenneth Bodin

Hi all,

We're releasing our physics engine AGX Multiphysics for licensing. We use OSG 
as our default graphics pipeline and it turns out that many of our customers 
also use OSG.

AGX may be of interest to those of you who develop e.g. vehicle simulators or simulate other types of mechanical or multiphysical systems that are stiff and require higher precision/performance than 
you get from a typical game physics engine where mass and force ratios typically must be constrained to 1:50 or even less. Actually, we also have iterative solvers, so it is really up to the user to 
chose solvers according to which precision is required for the various components of a physics simulation. We also target scientific and engineering type of simulations (e.g. CAD and virtual 
prototyping) and as far as I know we are the only ones in this area that provide both interactive real-time simulations as well as high-precision multiphysics simulations in the same unified framework.


We also have a new website, and lots of new videos. Much of the graphics is 
with OSG (including the rather amazing Ship simulators by Kongsberg Maritime).

http://www.algoryx.se/


Cheers,
Kenneth
attachment: kenneth.vcf___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] draw a 3D pipe

2010-12-22 Thread Trajce (Nick) Nikolov
hi lucie,

here is something with geometry shaders ...  might get you inspired

-Nick


On Wed, Dec 22, 2010 at 6:42 PM, lucie lemonnier
lucielemonn...@hotmail.frwrote:

 Hi,

 I want to draw a 3D curved pipe from a list of points.
 I looked at osgModeling but I don't know how to do this.
 Would you have an idea using osgModeling or something else?

 Thank you!

 Cheers,
 lucie

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





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

#include osg/Notify
#include osg/ref_ptr
#include osg/Geode
#include osg/Geometry
#include osg/Vec3
#include osg/Vec4
#include osg/Program
#include osg/Shader
#include osg/Uniform
#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers
#include osgGA/StateSetManipulator

///

static const char* vertSource = {
void main(void)\n
{\n
   gl_Position = gl_Vertex;	\n
	gl_FrontColor = gl_Color;	\n
}\n
};

static const char* geomSource = {
#version 120	\n
#extension GL_EXT_geometry_shader4 : enable	\n
uniform int numCylinderSegments;\n
uniform float cylinderRadius;	\n
vec3 rotateVec3(vec4 q,vec3 v)	\n
{\n
	vec3 uv, uuv;\n
	vec3 qvec = vec3(q.x, q.y, q.z);			\n
	uv = cross(qvec,v);			\n
	uuv = cross(qvec,uv);		\n
	uv *= ( 2.0 * q.w );		\n
	uuv *= 2.0;	\n
	return v + uv + uuv;		\n
}\n
void main(void)\n
{\n
	{			\n
		vec4 q1 = gl_FrontColorIn[0];			\n
		vec4 p1 = gl_PositionIn[0];\n
		vec4 p2 = gl_PositionIn[1];\n
		vec4 q2 = gl_FrontColorIn[1];			\n
		{		\n
			for (int i=0; i=numCylinderSegments; ++i)			\n
			{	\n
float a = 3.14159265358979323846*2.0 / float(numCylinderSegments);\n
\n
float x = cos(a*float(i))*cylinderRadius;		\n
float y = sin(a*float(i))*cylinderRadius;		\n
float z = 0.0;	\n
\n
float clr = cos(a*float(i)+1.57079632679489661923);\n
vec3 vx = vec3(x,y,z);			\n
\n
gl_Position = gl_ModelViewProjectionMatrix * vec4(rotateVec3(q2,vx)+p2.xyz,1.0);\n
gl_FrontColor = vec4(clr,clr,clr,1.0);			\n
EmitVertex();	\n
\n
gl_Position = gl_ModelViewProjectionMatrix * vec4(rotateVec3(q1,vx)+p1.xyz,1.0);\n
gl_FrontColor = vec4(clr,clr,clr,1.0);			\n
EmitVertex();	\n
			}	\n
			EndPrimitive();		\n
		}		\n
	}			\n
}\n
};


static const char* fragSource = {
void main(void)\n
{\n
	gl_FragColor = gl_Color;	\n
}\n
};

///

osg::Program* createShader(int numVxs)
{
osg::Program* pgm = new osg::Program;
pgm-setName( osgshader2 demo );

pgm-addShader( new osg::Shader( osg::Shader::VERTEX,   vertSource ) );
pgm-addShader( new osg::Shader( osg::Shader::FRAGMENT, fragSource ) );

pgm-addShader( new osg::Shader( osg::Shader::GEOMETRY, geomSource ) );
pgm-setParameter( GL_GEOMETRY_VERTICES_OUT_EXT, numVxs );
pgm-setParameter( GL_GEOMETRY_INPUT_TYPE_EXT, GL_LINES );
pgm-setParameter( GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_TRIANGLE_STRIP );

return pgm;
}

///

class CatMullRomCurve : public osg::Geometry
{
public:
CatMullRomCurve(int numCurveSegments = 100, int numCylinderSegments = 35,float cylinderRadius = 0.035f)
{
		std::vectorosg::Vec3 vxs;
		vxs.push_back( osg::Vec3(0,0,0) );
vxs.push_back( osg::Vec3(1,1,0) );
		vxs.push_back( osg::Vec3(0.5,0.5,0.5) );
		vxs.push_back( osg::Vec3(1.0,1.0,1.0) );
		vxs.push_back( osg::Vec3(1.5,1.5,0.5) );
		osg::Vec3Array* vAry = new osg::Vec3Array;
setVertexArray( vAry );

		osg::Vec4Array* quatsIncolorArray = new osg::Vec4Array;
		setColorArray(quatsIncolorArray);
		setColorBinding(BIND_PER_VERTEX);

		for (unsigned int i=0; ivxs.size()-1; ++i)
		{
			int idx0 = i0?i-1:0;
			int idx1 = i;
			int idx2 = i+1;
			int idx3 = idx2(int)vxs.size()-1?idx2+1:idx2;

			osg::Vec3 p0 = vxs.at(idx0);
			osg::Vec3 p1 = vxs.at(idx1);
			osg::Vec3 p2 = vxs.at(idx2);
			osg::Vec3 p3 = vxs.at(idx3);

			for (int j=0; jnumCurveSegments; ++j)			
			{

float t = 

[osg-users] memory leak resizing osgoit

2010-12-22 Thread Don Leich

Hi all,

The osgoit example program exhibits a large memory leak when the
window is continually resized causing the depth peel cameras
to be recreated over and over.   This leak is made much worse
when the program is modified for multi-sampled antialiasing...

// camera-attach(osg::Camera::COLOR_BUFFER, colorTexture.get());
camera-attach(osg::Camera::COLOR_BUFFER, colorTexture.get(),
0, 0, false, 4, 4);

I suspect that each time it sets up the cameras a new FBO is allocated
without releasing previously used FBO resources as described in
the threads FBO resizing problem and [osgPPU] Problems with resizing.

How would one go about managing FBOs without leaking memory in the context
of osgoit?  A callback on resize such as the one below was suggested in
one (actually both) of the threads mentioned. If this is appropriate,
where does it fit in?

class detachFBOCallback : public osg::NodeCallback {
public:
detachFBOCallback( ) {}

virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
osg::Camera* fboCam = dynamic_castosg::Camera*( node );
osgUtil::CullVisitor* cv = dynamic_castosgUtil::CullVisitor*( nv );

if ( fboCam  cv )
{
// Cause the FBO to be recreated.
cv-getCurrentRenderBin()-getStage()-setFrameBufferObject(NULL);
// Ensure that runCameraSetUp is called.
cv-getCurrentRenderBin()-getStage()-setCameraRequiresSetUp(true);
}
traverse( node, nv );
}

};

-Don Leich

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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Wang Rui
Hi Paul,

Yse, there is an ebook version of this book on the Packt website. Take
care of your eyes. Long time working at the computer will harm them,
too.

Cheers,

Wang Rui


2010/12/22 Paul Martz pma...@skew-matrix.com:
 Is the book available electronically? Kindle, safari, PDF, etc? (Due to my
 eyesight, I am no longer able to read print material of any kind.)

 Thanks,
   -Paul

 ___
 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] File Size Limit on OSG::Image?

2010-12-22 Thread Blake Mason
If you just need to create a high resoultion rendering from of a single 
frame, you can modify the camera's projection matrix to capture many 
smaller segments, something like this:


camera-setProjectionMatrix(projMat * osg::Matrix::scale(xSegments, 
ySegments, 1.0) *
osg::Matrix::translate((float)(xSegments) - segmentX*2.0f - 
1.0, (float)(ySegments) - segmentY*2.0f - 1.0, 0.0));


I got this idea from the osgcamera example. You can then save an image 
for each segment with osgDB::writeImageFile and then piece it together 
with another image editing program.



On 2010-12-21 11:30, Geoff Rhodes wrote:

Hi,

I am currently working on creating a poster image from several images and the 
file size is pretty large. Currently the one I am trying to create is 65250 
wide x 22500 pixels  in height (Image needs to be large)

Currently I am doing the following:


Code:
posterImage = new osg::Image;   
posterImage-allocateImage( (mHeight), (mWidth), 1, GL_RGBA, 
GL_UNSIGNED_BYTE );



Right now it is giving me an exception when trying to allocate that image. Is 
there a size limit on it, or am I doing something wrong?



...

Thank you!

Cheers,
Geoff

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





___
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] Several questions regarding Terrain

2010-12-22 Thread Thomas Dickerson
Hi,

I have loaded a 256x256 HeightField, created a HeightFieldLayer, and added it 
as the ElevationLayer to a TerrainTile. Now, if I would like to go about 
texturing patches of terrain, do I essentially need a separate TerrainTile for 
each individual area to be textured? And if this is the case, can multiple 
TerrainTiles use the same ImageLayer for their own ColorLayers? And I still 
have not decoded the use of the Terrain class itself, which doesn't seem to be 
used in the osgterrain_example demo application!

Any help or tips that can be provided would be delightful.

Thank you!

Cheers,
Thomas


Vermont Sustainable Heating Initiative (http://www.sustainableheatingvt.org) || 
Village2Village Project (http://www.village2villageproject.org)

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





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


Re: [osg-users] Need Help ! Open Scene Graph For IPhone Shaders Issues

2010-12-22 Thread Ulrich Hertlein
Hi,

On 23/12/10 0:23 , Laith Dhawahir wrote:
 Code:
 
   //if the context was created then attach to our viewer
 if(graphicsContext)
 {
 viewer-getCamera()-setGraphicsContext(graphicsContext);
 //viewer-getCamera()-setViewport(new osg::Viewport(0, 0, 
 traits-width, traits-height));
   }
   
   osg::setNotifyLevel(osg::DEBUG_FP);
   
   root = new osg::MatrixTransform();
   
   osg::Geode* geode = new osg::Geode();
   osg::ShapeDrawable* drawable = new osg::ShapeDrawable( new 
 osg::Box(osg::Vec3(0,1,1),1));
   
   drawable-setColor(osg::Vec4(1.0f,0.0f,1.0f,0.5f));
   drawable-getOrCreateStateSet();
   geode-addDrawable(drawable);
   
   root-addChild(geode);*/
   
   viewer-setSceneData(root.get());
 viewer-setCameraManipulator(new osgGA::TrackballManipulator);
 viewer-realize();

Since this is just a code fragment it's hard/impossible to get an overall 
picture.
For example, the line 'root-addChild(geode)' has a closing comment on it, 
which could
mean that the entire block you've sent is commented.

Certainly *not* adding the geode to the scene root would explain why you're not 
seeing
anything.

Why don't you post the entire setup function to save us from guessing?

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


[osg-users] osgManipulator::Dragger event handler

2010-12-22 Thread François Bodic
Hi,

I the osg::Manipulator example, there is no EventHandler Class as before but a 
new handle function has been introduced in the Dragger code. How does it works? 
I used to work with the prévious version which was using a classic pick system 
built in a GUIEventHandler class.

Thank you!

Cheers,
François

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





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


Re: [osg-users] [ANN] New book published - OpenSceneGraph 3.0 Beginner's Guide

2010-12-22 Thread Robert Osfield
Hi Rui,

I'll add my public congratulations to yourself and Xuelei on
publication of OpenScenegraph 3.0 Beginners Guide.  Writing a book is
a big endeavor, delivered on schedule too!   Thank you for the kind
words too ;-)

Now... I just need to get my 3.0 out too... alas I'm not quite as good
at pushing through schedules on code as you've been with the book!

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


Re: [osg-users] osg-users Digest, Vol 42, Issue 41

2010-12-22 Thread Robert Osfield
Hi Omar,

You reply came through alone with a whole digest post, and the subject
line is related to the digest as well which breaks any threading that
mail tools provide.  These too factors together make it difficult to
track the context of your post and make it less likely that others
will be able easily answer your questions.

It would be worth changing your mailing list subscription to not use
the digest option while you are interacting with other members of the
community.  The digest option is really only appropriate for when you
are just lurking.

As for the topic, I couldn't really follow your text. Grammar and
punctuation is hard second language, I know as I even struggle with
English being my first language, but not having any punctuation makes
it more difficult to read and follow.  As a first step try breaking
the text down into a series of short paragraphs that logically break
the topic down.  Even without getting everything else perfect it'll
help others understand and make it much more likely to get a helpful
reply.

Cheers,
Robert.

2010/12/22 Omar Khaled Aly matrixto...@hotmail.com:


 thanks for helping me in the combined 3d object what i mean is that i did
 create a 3d object on 3d max a cube and a teapot inside it and i did use the
 OSG intersection to just know when i did intersect with the teapot as its
 inside the cube and when i did intersect with it i want to blend the cube
 but as the loader of osg loades the cube and the teapot inside it as one
 object cause they are in onde 3ds file so i cannot separately interact with
 the cube to just blend it only with out blending the teapot too so i did ask
 a friend and he told me about a class named findNodeVisitor  which is a user
 made class that inheret NodeVisitor class but the idea is that i did not got
 the w ay i can use that findNodeVisitor so i did send mail to the osg user
 mailing list and you and i really appritiate it helped me but if i did not
 annoy i did not want to use another external application i wanna do it with
 the code in OSG and i really need your help to do it with code thank you :)
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org