[osg-users] about DelaunayTriangulator problem!

2009-04-17 Thread 月下幽灵
hi everyone !
   I am a new one here! I have a problem ablut t DelaunayTriangulator!could 
anyone give me some advice!
  my platform is Visual Studio 2008 and OSG 2.6.
  The problem is that I find some warning when I test a application about 
DelaunayTriangulator!
/***
  
int main(){ osgViewer::Viewer* viewer = new osgViewer::Viewer();
viewer->addEventHandler( new 
osgGA::StateSetManipulator(viewer->getCamera()->getOrCreateStateSet()) );  
osg::Group* root = new osg::Group();osg::Vec3Array* coords = new 
osg::Vec3Array();  unsigned int n = sizeof(vertex)/sizeof(float[3]);   for( 
unsigned int i = 0; i push_back( 
osg::Vec3(vertex[i][0], vertex[i][1], vertex[i][2] ));   }   
osgUtil::DelaunayTriangulator* dt = new osgUtil::DelaunayTriangulator(coords);  
dt->triangulate();  osg::Geometry* geometry = new osg::Geometry();  
geometry->setVertexArray(coords);   
geometry->addPrimitiveSet(dt->getTriangles());  osg::Geode* geode = new 
osg::Geode();   geode->addDrawable( geometry);  root->addChild(geode) ; 
osgUtil::Optimizer optimizer ;  optimizer.optimize(root) ;  
viewer->setSceneData(root); viewer->realize();  viewer->run();  return 
0 ;}
/
And the warning: DelaunayTriangulator::triangulate(): too few sample points!
warning: invalid index i or primitiveset passed to 
osg::Geometry::addPrimitiveSet, ignoring call!___
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 22, Issue 53

2009-04-17 Thread Eduardo Alberto Hernández Muñoz
Hi list,

@Jan Ciger:
> Regarding multiple licenses - you will still have them, due to the OSG
> dependencies (zlib license, JPEG library license, ...)

Yes, but I'm not the one that maintains OSG's dependencies.


> However, a much nicer approach would be to contribute the changes you
> want to make back to OSG instead of locking them away under GPL.

I have no problem with my changes being incorporated back into OSG;
but about the only changes that I think that would be desirable in OSG
is to allow cel shading to take a different texture unit than 0,  to
separate cel shading from outlining, and not requiring a diffuse
texture for bump mapping. If I made any actual improvements, I would
gladly backport them.

However, you did made me realize something. While I still don't know
if the OSGPL allows to port to the GPL, there is after all one benefit
to using the OSGPL instead of the GPL: that *I* would backport my
changes and release them under the OSGPL, doesn't means that *anyone*
that I convey the program to, will be willing to allow their changes
to be released under the OSGPL.

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


Re: [osg-users] DelaunayTriangulator and multiple drawables

2009-04-17 Thread Steve Gifford
I was doing something different with the triangulator, but noticed
similar problems.  I ended up using GTS.  If you're doing anything
more than a handful of points, it's isn't really built for that.

-Steve Gifford

On Fri, Apr 17, 2009 at 8:18 AM, Martin Beckett  wrote:
> I am playing with the DelaunayTriangulator trying to mesh a surface.
>
> The advice on writing the file reader was to split the points into blocks of 
> 10,000 and generate multiple drawables in each geometry.
> Now when I come to triangulate it each block of points is going to mesh 
> individually. The triangles are indices into the vertices and so can't cross 
> nodes.
>
> Should I copy all the vertices into a single drawable, but set them not to be 
> drawn,  and mesh those. But then I loose the link between the mesh and the 
> original data which makes picking complicated
>
> Any ideas ?
>
> Martin
>
> ps. The surface produced by DelaunayTriangulator has problems (modifying the 
> source points, long thin triangles, intersecting triangles etc) so i am 
> looking at some alternate routines - but the above problem would apply to any 
> of them.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=10346#10346
>
>
>
>
>
> ___
> 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] FOG: applying both kinds at the same time. How?

2009-04-17 Thread Allen Saucier
Thx everyone!  I've got my stuff working now and I'm glad that I can only have 
1 type of fog active.  It makes my job easier.


Allen

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





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


[osg-users] OSG wiki database locked

2009-04-17 Thread Roland Smeenk
There seems to be a problem with the Wiki:


> Trac detected an internal error:
> 
> OperationalError: database is locked


--
Roland

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





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


Re: [osg-users] Changing OSG License to GPL

2009-04-17 Thread Jan Ciger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello Eduardo,

Eduardo Alberto Hernández Muñoz wrote:

>> So why should OSG derived code be GPL ed?
> Because I want to reduce the overhead of maintaining the code. I
> already have the GPLv3 for code, Creative Commons for the media, the
> SIL font license for fonts, and probably something else will pop it's
> head. I don't want to have multiple licenses for the same kind of
> data.

The OSG license should not cause you any headaches, because it is
compatible with GPL. You do not need to treat it in any special way
compared to your GPLv3 code.

Regarding multiple licenses - you will still have them, due to the OSG
dependencies (zlib license, JPEG library license, ...)

> Even though my reason to GPL the code is to lower the effort required,
> I do want to clear that it is not my desire that my program is used in
> closed-source projects unless I'm asked for permission.

It cannot be - if your own code is GPLed, then the license does not
allow it already and your are covered. And the 3rdparty code that you
are not the copyright holder of (OSG) is none of your business, to put
it bluntly. If you want to create a derivative work of the 3rdparty code
- - e.g. to take a piece of OSG, modify it and release under a different
license, you need the right holder's permission, as you have correctly
identified yourself.

However, a much nicer approach would be to contribute the changes you
want to make back to OSG instead of locking them away under GPL. While
it is better than making them outright proprietary, it still does not
allow use of that library code in many cases - e.g. many universities do
not have problems to release code as open source, however they often
want their own licenses with various restrictions that may or may not be
GPL-compatible (original BSD license is a great example). For example,
for me is a GPL-ed library a potential liability of wasting my time,
because I could be prevented from distributing my own research code due
to the GPL-incompatible opinion of university legal department.

Considering the benefit you have from using OSG, I do not think that
asking for a bit of payback is so outlandish. Nobody can force you to do
this, but please, do consider this option.

Regards,

Jan




-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJ6MGWn11XseNj94gRAhC7AKDp+ncZo05GFPMUkW6jaXsrRietrgCff66T
tgQD+Fb5lhvZboeL4jD+GMQ=
=P/9I
-END PGP SIGNATURE-
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Changing OSG License to GPL

2009-04-17 Thread Eduardo Alberto Hernández Muñoz
Hi list,

@Sergey Kurdakov:
> sorry but it is really not clear why LGPL prohibits you to

The LGPL itself does not prohibits me to use the GPL, in fact, it
explicitly permits it.

However, the page
http://www.openscenegraph.org/projects/osg/wiki/Legal, probably
written by Robert( it's down now, so I can't verify ), forbids
releasing under *any* other license. I'm not a lawyer, but I'm sure
that it could be claimed that the LGPL text refered only to itself and
not the OSGPL, and I'm not sure Robert will be too happy with people
taking OSG code and GPL'ing it.

> So why should OSG derived code be GPL ed?
Because I want to reduce the overhead of maintaining the code. I
already have the GPLv3 for code, Creative Commons for the media, the
SIL font license for fonts, and probably something else will pop it's
head. I don't want to have multiple licenses for the same kind of
data.

@Xenon:
> What exactly, is your goal in putting it under the GPL? The OSGPL is
> designed so that OSG can be used equally with F/OSS and closed-source
> projects. Your change would reduce that flexibility, so the question is --
> why is this a goal of yours?

Even though my reason to GPL the code is to lower the effort required,
I do want to clear that it is not my desire that my program is used in
closed-source projects unless I'm asked for permission.

Unlike OSG, my program is not meant to be used as a library( right now
the goal is make a game, though it might be split into an engine and
game logic in the future ).

Including OSGPL'ed code won't allow my program to be used in
closed-source projects, since the rest of the code is under the GPLv3.

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


Re: [osg-users] Using osgWidget for the first time, some questions

2009-04-17 Thread Jean-Sébastien Guay

Hello Cedric,


Maybe look at osgwidgetmessagebox example, if i remember it does what
you want.


That showed me how to make the center widget auto-resize, yes. Thanks.

What about the other questions? (the color of the center widget not 
using the alpha, and the alignment of widgets to the top of the frame)


Thanks a lot,

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] terrain database popping...

2009-04-17 Thread Alejandro Aguilar Sierra
Hi Stefan,

I played with libmini some time ago. I didn't studied the code deeply,
but I think some things are already in OSG, like the viewer. I don't
have too much time right now, but with the proper insight, I may try
to do it.

Regards,

-- A.


On Thu, Apr 16, 2009 at 4:32 AM, Stefan Roettger  wrote:
> On Apr 15, 2009, at 11:44 PM, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
> wrote:
>
>> I think it would be good to fold libmini (or something equivalent) into
>> OSG.
>> That way you can use the databases built with VPB. I don't know much about
>> VTP but using VPB databases are nice...
>
> Yes. I have been thinking for almost 2 years now about folding libMini into
> OSG, but so far did not have the necessary time to do it. So it got delayed
> and delayed... If someone is volunteering though, I'd be happy to give the
> necessary insight into libMini.
>
> Cheers,
> Stefan
>
> ___
> 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] Using osgWidget for the first time, some questions

2009-04-17 Thread Cedric Pinson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Sebastien,
Maybe look at osgwidgetmessagebox example, if i remember it does what
you want.

Cedric

Jean-Sébastien Guay wrote:
> Hello all, hello Jeremy,
>
> I'm using osgWidget for the first time, thinking of using it for a
> little addition I'm planning for OSG eventually, and just trying to
> get familiar with it. I have a few questions.
>
> First, here's my code:
>
> const unsigned int MASK_2D = 0xF000;
>
> // To be able to pass an osg::Vec4 to a
> // setColor(float, float, float, float) method
> #define mySetColor(obj, c) (obj->setColor(c.r(), c.g(), c.b(), c.a()))
>
> DebugHUD::DebugHUD(osgViewer::View* view)
> {
> osg::Vec4 titleBarColor(0, 0, 0.5, 0.5);
> osg::Vec4 backgroundColor(0.2, 0.2, 0.7, 0.5);
>
> osgWidget::point_type w =
> view->getCamera()->getViewport()->width();
> osgWidget::point_type h =
> view->getCamera()->getViewport()->height();
>
> m_windowManager = new osgWidget::WindowManager(view, w, h,
> MASK_2D);
>
> osgWidget::Frame* frame =
> osgWidget::Frame::createSimpleFrameFromTheme(
> "frameTheme",
> osgDB::readImageFile("osgWidget/theme-1.png"),
> 300.0f,
> 300.0f,
> osgWidget::Frame::FRAME_ALL
> );
> frame->setPosition(300,100,0);
>
> osgWidget::Table* table  = new osgWidget::Table("table", 1, 1);
> osgWidget::Widget* center = new osgWidget::Widget("center",
> 300.0f, 300.0f);
> mySetColor(center, backgroundColor);
> center->setAlignVertical(osgWidget::Widget::VA_TOP);//
> Doesn't work
> table->addWidget(center, 0, 0);
> frame->setWindow(table);
>
> mySetColor(frame->getBackground(), osg::Vec4(1.0, 1.0, 1.0, 0.0));
>
> mySetColor(frame->getBorder(osgWidget::Frame::BORDER_TOP),
> titleBarColor);
>   
> mySetColor(frame->getCorner(osgWidget::Frame::CORNER_UPPER_LEFT),
> titleBarColor);
>   
> mySetColor(frame->getCorner(osgWidget::Frame::CORNER_UPPER_RIGHT),
> titleBarColor);
>
> mySetColor(frame->getBorder(osgWidget::Frame::BORDER_LEFT),
> backgroundColor);
> mySetColor(frame->getBorder(osgWidget::Frame::BORDER_RIGHT),
> backgroundColor);
> mySetColor(frame->getBorder(osgWidget::Frame::BORDER_BOTTOM),
> backgroundColor);
>   
> mySetColor(frame->getCorner(osgWidget::Frame::CORNER_LOWER_LEFT),
> backgroundColor);
>   
> mySetColor(frame->getCorner(osgWidget::Frame::CORNER_LOWER_RIGHT),
> backgroundColor);
>
> m_windowManager->addChild(frame);
>
> m_camera = m_windowManager->createParentOrthoCamera();
> m_windowManager->resizeAllWindows();
>
> view->getCamera()->addChild(m_camera.get());
> view->addEventHandler(new
> osgWidget::MouseHandler(m_windowManager.get()));
> view->addEventHandler(new
> osgWidget::KeyboardHandler(m_windowManager.get()));
> view->addEventHandler(new
> osgWidget::ResizeHandler(m_windowManager.get(), m_camera.get()));
> view->addEventHandler(new
> osgWidget::CameraSwitchHandler(m_windowManager.get(), m_camera.get()));
> }
>
> So, here are my questions.
>
> 1. The widget in the center is not the color I set it to. The alpha
> doesn't seem to be taken into account. I'd like my whole window to
> be a transparent blue (backgroundColor).
> 2. When I resize the frame to make it larger (dragging the
> bottom-right corner down and to the right for example), I'd like the
> widget in the center to resize itself to fit. Is that possible?
> Well, in fact if I could do without that widget it would be even
> better, but I want the center of the window to be transparent blue,
> and getBackground()->setColor() makes the color visible even on the
> corners of the window, which I don't want...
> 3. I want the widgets in my frame to stay at the top of the frame
> when it's resized. But even if I set my widget's vertical alignment
> to VA_TOP, it doesn't work (see the line with the "Doesn't work"
> comment above). Is that a bug or should I do something else to get
> what I want?
>
> BTW, to set the vertical alignment I would have expected to call
> setVerticalAlignment instead of setAlignVertical, any reason why
> it's named that way? setVerticalAlignment seems more natural.
>
> Other than that, it seems that osgWidget will allow me to do what I
> want and I'm enjoying working with it (though I'm only doing basic
> things right now...).
>
> Thanks in advance,
>
> J-S

- --
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:morni...@plopbyte.net
http://www.plopbyte.net

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknonmMACgkQs6ZHzVQN0IiiSACfYwX5eK3dRwnp/JHRI7gnkQ8+
+vUAn2k2pfcH8NjRWs2HMmNsaX+jjRFh
=XxCD
-END PGP SIGNATURE-

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


[osg-users] DelaunayTriangulator and multiple drawables

2009-04-17 Thread Martin Beckett
I am playing with the DelaunayTriangulator trying to mesh a surface.

The advice on writing the file reader was to split the points into blocks of 
10,000 and generate multiple drawables in each geometry.
Now when I come to triangulate it each block of points is going to mesh 
individually. The triangles are indices into the vertices and so can't cross 
nodes.

Should I copy all the vertices into a single drawable, but set them not to be 
drawn,  and mesh those. But then I loose the link between the mesh and the 
original data which makes picking complicated

Any ideas ?

Martin

ps. The surface produced by DelaunayTriangulator has problems (modifying the 
source points, long thin triangles, intersecting triangles etc) so i am looking 
at some alternate routines - but the above problem would apply to any of them.

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





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


[osg-users] Using osgWidget for the first time, some questions

2009-04-17 Thread Jean-Sébastien Guay

Hello all, hello Jeremy,

I'm using osgWidget for the first time, thinking of using it for a 
little addition I'm planning for OSG eventually, and just trying to get 
familiar with it. I have a few questions.


First, here's my code:

const unsigned int MASK_2D = 0xF000;

// To be able to pass an osg::Vec4 to a
// setColor(float, float, float, float) method
#define mySetColor(obj, c) (obj->setColor(c.r(), c.g(), c.b(), c.a()))

DebugHUD::DebugHUD(osgViewer::View* view)
{
osg::Vec4 titleBarColor(0, 0, 0.5, 0.5);
osg::Vec4 backgroundColor(0.2, 0.2, 0.7, 0.5);

osgWidget::point_type w = view->getCamera()->getViewport()->width();
osgWidget::point_type h = view->getCamera()->getViewport()->height();

m_windowManager = new osgWidget::WindowManager(view, w, h, MASK_2D);

osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameFromTheme(
"frameTheme",
osgDB::readImageFile("osgWidget/theme-1.png"),
300.0f,
300.0f,
osgWidget::Frame::FRAME_ALL
);
frame->setPosition(300,100,0);

osgWidget::Table* table  = new osgWidget::Table("table", 1, 1);
osgWidget::Widget* center = new osgWidget::Widget("center", 300.0f, 
300.0f);

mySetColor(center, backgroundColor);
center->setAlignVertical(osgWidget::Widget::VA_TOP);// Doesn't work
table->addWidget(center, 0, 0);
frame->setWindow(table);

mySetColor(frame->getBackground(), osg::Vec4(1.0, 1.0, 1.0, 0.0));

mySetColor(frame->getBorder(osgWidget::Frame::BORDER_TOP), 
titleBarColor);
mySetColor(frame->getCorner(osgWidget::Frame::CORNER_UPPER_LEFT), 
titleBarColor);
mySetColor(frame->getCorner(osgWidget::Frame::CORNER_UPPER_RIGHT), 
titleBarColor);


mySetColor(frame->getBorder(osgWidget::Frame::BORDER_LEFT), 
backgroundColor);
mySetColor(frame->getBorder(osgWidget::Frame::BORDER_RIGHT), 
backgroundColor);
mySetColor(frame->getBorder(osgWidget::Frame::BORDER_BOTTOM), 
backgroundColor);
mySetColor(frame->getCorner(osgWidget::Frame::CORNER_LOWER_LEFT), 
backgroundColor);
mySetColor(frame->getCorner(osgWidget::Frame::CORNER_LOWER_RIGHT), 
backgroundColor);


m_windowManager->addChild(frame);

m_camera = m_windowManager->createParentOrthoCamera();
m_windowManager->resizeAllWindows();

view->getCamera()->addChild(m_camera.get());
view->addEventHandler(new 
osgWidget::MouseHandler(m_windowManager.get()));
view->addEventHandler(new 
osgWidget::KeyboardHandler(m_windowManager.get()));
view->addEventHandler(new 
osgWidget::ResizeHandler(m_windowManager.get(), m_camera.get()));
view->addEventHandler(new 
osgWidget::CameraSwitchHandler(m_windowManager.get(), m_camera.get()));

}

So, here are my questions.

1. The widget in the center is not the color I set it to. The alpha 
doesn't seem to be taken into account. I'd like my whole window to be a 
transparent blue (backgroundColor).
2. When I resize the frame to make it larger (dragging the bottom-right 
corner down and to the right for example), I'd like the widget in the 
center to resize itself to fit. Is that possible? Well, in fact if I 
could do without that widget it would be even better, but I want the 
center of the window to be transparent blue, and 
getBackground()->setColor() makes the color visible even on the corners 
of the window, which I don't want...
3. I want the widgets in my frame to stay at the top of the frame when 
it's resized. But even if I set my widget's vertical alignment to 
VA_TOP, it doesn't work (see the line with the "Doesn't work" comment 
above). Is that a bug or should I do something else to get what I want?


BTW, to set the vertical alignment I would have expected to call 
setVerticalAlignment instead of setAlignVertical, any reason why it's 
named that way? setVerticalAlignment seems more natural.


Other than that, it seems that osgWidget will allow me to do what I want 
and I'm enjoying working with it (though I'm only doing basic things 
right now...).


Thanks in advance,

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] Fullscreen with diferent resolutions

2009-04-17 Thread Serge Lages
Be aware that you'll need to manually restore the screen resolution before
exiting your application or you'll find your desktop in 640x480...

On Fri, Apr 17, 2009 at 4:24 PM, Stephan Maximilian Huber <
ratzf...@digitalmind.de> wrote:

> Hi Carlos,
>
> Carlos Sanches schrieb:
> > I m looking for some example of
> > osg::GraphicsContext::WindowingSystemInterface .
> > Do you know where I found some example of how to use it ?
> Afaik there's no such example.
>
> This works for me: it changes the resolution to 800x600 for Screen 0
>
> osg::GraphicsContext::WindowingSystemInterface* wsi =
> osg::GraphicsContext::getWindowingSystemInterface();
>
> if (wsi) {
>  wsi->setScreenResolution(0,800,600);
> }
>
> Note: depending on your version of osg there may be a bug in the OS X
> implementation of setScreenResolution, a fix for this is not commited yet.
>
> cheers,
> Stephan
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how can I turn a camera on and off? (UNCLASSIFIED)

2009-04-17 Thread Lingyun Yu
camera->setNodeMask(0)
and
camera->setNodeMask(0x) might work.

On Fri, Apr 17, 2009 at 4:26 PM, Konkle, Daniel T AMRDEC/Dynetics <
daniel.kon...@us.army.mil> wrote:

> Classification:  UNCLASSIFIED
> Caveats: NONE
>
> I need to turn a camera on and off.
> Use it and not use it.
>
> I've look through the docs and can't find the settings.
> The only thing I've found is an old reference to Producer Camera
> which of course didn't work.
>
> Is there a way to turn a camera on and off?
>
> thanks in advance,
> Danny
>
> The reference I found is below:
>
> http://www.3drealtimesimulation.com/osg/osg_faq_2.htm
> How can I dynamically turn a Camera On or Offb
>
>
>  It is very straight forward to turn a Camera On or Off firest you
> ned to get a pointer to your camera
>
>  e.g. Producer::Camera *camera = getPointerToMyCamera();
>
>  then to turn the camera On call camera->enable();
>
>  else to turn the camera Off call camera->disable();
>
>
> Classification:  UNCLASSIFIED
> Caveats: NONE
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


[osg-users] how can I turn a camera on and off? (UNCLASSIFIED)

2009-04-17 Thread Konkle, Daniel T AMRDEC/Dynetics
Classification:  UNCLASSIFIED 
Caveats: NONE

I need to turn a camera on and off.
Use it and not use it.

I've look through the docs and can't find the settings.
The only thing I've found is an old reference to Producer Camera
which of course didn't work.

Is there a way to turn a camera on and off?

thanks in advance,
Danny

The reference I found is below:

http://www.3drealtimesimulation.com/osg/osg_faq_2.htm
How can I dynamically turn a Camera On or Offb
  

  It is very straight forward to turn a Camera On or Off firest you
ned to get a pointer to your camera

  e.g. Producer::Camera *camera = getPointerToMyCamera();

  then to turn the camera On call camera->enable();

  else to turn the camera Off call camera->disable();


Classification:  UNCLASSIFIED 
Caveats: NONE

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


Re: [osg-users] Fullscreen with diferent resolutions

2009-04-17 Thread Stephan Maximilian Huber
Hi Carlos,

Carlos Sanches schrieb:
> I m looking for some example of
> osg::GraphicsContext::WindowingSystemInterface .
> Do you know where I found some example of how to use it ?
Afaik there's no such example.

This works for me: it changes the resolution to 800x600 for Screen 0

osg::GraphicsContext::WindowingSystemInterface* wsi =
osg::GraphicsContext::getWindowingSystemInterface();

if (wsi) {
  wsi->setScreenResolution(0,800,600);  
}

Note: depending on your version of osg there may be a bug in the OS X
implementation of setScreenResolution, a fix for this is not commited yet.

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


Re: [osg-users] Fullscreen with diferent resolutions

2009-04-17 Thread Carlos Sanches
Hi Stephan .
I m looking for some example of
osg::GraphicsContext::WindowingSystemInterface .
Do you know where I found some example of how to use it ?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cache system...

2009-04-17 Thread neil.hughes
Hi Stephan,

Thanks for coming back to me. 

I think I confused myself with the filecache concept. thanks for the hint. I've 
now tracked through and found out what is happening, so it looks like I don't 
need to implement my own cache, which is great.

Thanks again.

neil.


 Stephan Maximilian Huber  wrote: 
> Hi neil,
> 
> neil.hug...@tesco.net schrieb:
> > Hi All,
> > 
> > I'm looking for some thoughts, and advice, on the cache process within OSG. 
> > Essentially a while ago (OSG1.2) I wrote an app that implemented its own 
> > node/texture cache in memory as I didn't want to be writing things to the 
> > file system as permissions were potentially a problem. I'm now looking at 
> > rewriting in OSG2.8, and trying to get a handle on whether the cacheing 
> > offered by OSG has changed at all. Essentially I want to cache objects in a 
> > memory cache, rather than to file. As far as I can see this isn't an option 
> > within OSG2.8, but I wanted to check if others new anything to the contrary 
> > ?
> > 
> > Thanks for any help/comments.
> 
> Have you tried the internal cache of osg? I think it defaults to off, so
> you have to switch it on via:
> 
> osgDB::ReaderWriter::Options* options = new osgDB::ReaderWriter::Options();
> options->setObjectCacheHint(osgDB::ReaderWriter::CACHE_ALL);
> 
> osgDB::Registry::instance()->setOptions(options);
> 
> For more infos see the documentation of osgDB::ReaderWriter::Options
> 
> HTH,
> Stephan
> 
> 
> ___
> 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] Dinamic Line Drawing

2009-04-17 Thread Allen Saucier
I'm guessing that I have about 10,000 vertices or a little more.  I stopped the 
app after 4500 had been displayed and the line was 1/2 drawn.  Thx for the 
note, too, on dirtyBound().  I didn't really know what it did or what it meant 
so I threw in a comment for myself as a reminder that it did what I needed.

Do I need the call to dirtyDisplayList() too, you think?


Brian R Hill wrote:
> Allen,
> 
> Your code has the following line:
> 
> m_ogeomTrailGeometry->dirtyBound();  // forces redraw
> 
> dirtyBound does not force a redraw. It simply recalculates the bounding
> volume for the geometry. The problem you were having before was that the
> geometry was being clipped because the bounding volume was incorrect.
> 
> Your performance issues can be due to a number of things.
> 
> How many verts do you have?
> 
> Brian
> 



Allen

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





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


[osg-users] cannot set child stateset in pagedLOD?

2009-04-17 Thread Ufuk
Hi,
i have an .osg file which is like this:

PagedLOD {
  nodeMask 0x
  cullingActive TRUE
  Center 512 512 0
  Radius 724.077
  RangeMode DISTANCE_FROM_EYE_POINT
  RangeList 5 {
1448.15 5792.62
0 1448.15
0 1448.15
0 1448.15
0 1448.15
  }
  NumChildrenThatCannotBeExpired 0
  FileNameList 5 {
ter_0_0_0.ive
ter_1_0_0.osg
ter_1_1_0.osg
ter_1_0_1.osg
ter_1_1_1.osg
  }
  num_children 0
}

and every .osg file which is in this file is like this file. they have 1 ive
file and 4 osg files.

by this method, we are loading child nodes in paging.

here i want to render all of these in a shader. So i set the parent node
stateSet but childs does not effect :(

do you have any idea why i cant set the child node's stateset by changing
the stateset of parent?



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


Re: [osg-users] Cache system...

2009-04-17 Thread Stephan Maximilian Huber
Hi neil,

neil.hug...@tesco.net schrieb:
> Hi All,
> 
> I'm looking for some thoughts, and advice, on the cache process within OSG. 
> Essentially a while ago (OSG1.2) I wrote an app that implemented its own 
> node/texture cache in memory as I didn't want to be writing things to the 
> file system as permissions were potentially a problem. I'm now looking at 
> rewriting in OSG2.8, and trying to get a handle on whether the cacheing 
> offered by OSG has changed at all. Essentially I want to cache objects in a 
> memory cache, rather than to file. As far as I can see this isn't an option 
> within OSG2.8, but I wanted to check if others new anything to the contrary ?
> 
> Thanks for any help/comments.

Have you tried the internal cache of osg? I think it defaults to off, so
you have to switch it on via:

osgDB::ReaderWriter::Options* options = new osgDB::ReaderWriter::Options();
options->setObjectCacheHint(osgDB::ReaderWriter::CACHE_ALL);

osgDB::Registry::instance()->setOptions(options);

For more infos see the documentation of osgDB::ReaderWriter::Options

HTH,
Stephan


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


Re: [osg-users] Fullscreen with diferent resolutions

2009-04-17 Thread Stephan Maximilian Huber
Carlos Sanches schrieb:
> Hi guys !
> Now I m trying to display my program in fullscreen mode, but the problem is
> that the resolution that is displayed is the same of my screen monitor.
> If my monitor is 1280x1024 and I dont put any value to my osgViewer  my
> program ll be fullscreen with 1280x1024.
> If I put a value to my osgvier likerViewer->setUpViewInWindow( 320, 0,
> 640, 480 );my program opens in a window.
> 
> I wanna that my program run in 640x480 in fullscreen mode and when it finish
> back to my desktop at 1280x1024.
> Anybody has an idea ?

you can try some of the provided methods in
osg::GraphicsContext::WindowingSystemInterface

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


[osg-users] Fullscreen with diferent resolutions

2009-04-17 Thread Carlos Sanches
Hi guys !
Now I m trying to display my program in fullscreen mode, but the problem is
that the resolution that is displayed is the same of my screen monitor.
If my monitor is 1280x1024 and I dont put any value to my osgViewer  my
program ll be fullscreen with 1280x1024.
If I put a value to my osgvier likerViewer->setUpViewInWindow( 320, 0,
640, 480 );my program opens in a window.

I wanna that my program run in 640x480 in fullscreen mode and when it finish
back to my desktop at 1280x1024.
Anybody has an idea ?
Thanks
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dinamic Line Drawing

2009-04-17 Thread Brian R Hill
Allen,

Your code has the following line:

 m_ogeomTrailGeometry->dirtyBound();  // forces redraw

dirtyBound does not force a redraw. It simply recalculates the bounding
volume for the geometry. The problem you were having before was that the
geometry was being clipped because the bounding volume was incorrect.

Your performance issues can be due to a number of things.

How many verts do you have?

Brian


This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose. •


-osg-users-boun...@lists.openscenegraph.org wrote: -


To: osg-users@lists.openscenegraph.org
From: "Allen Saucier" 
Sent by: osg-users-boun...@lists.openscenegraph.org
Date: 04/16/2009 05:05PM
Subject: Re: [osg-users] Dinamic Line Drawing

Thx everyone!! for the help. :D :D  You've given me a lot to think about.
I really appreciate your time.

J-S, here's my code that now works but still "drags" a little after a few
thousand iterations.  I found that setVertexArray is (I believe, but could
be totally wrong) actually "copying" the array I send it.  After a few
thousand times of being called, it really slows down my entire interface.
In fact, my interface Almost crawls to a halt calling setVertexArray() each
time through the frame loop after about 4000 calls to it.

And I'm drawing a LOT of small line segments each millisecond to make up
the long "looking" line.

I'm not using vertex buffer objects... yet.  if I need to switch to them, I
will.  Though that will be in the land of experimentation for me too. ha,
ha,... :-)

I found that dirtyDisplayList() w.o dirtyBound() did nothing.  I found that
dirtyBound() worked all by itself to get the line to draw during each
iteration of my osg::viewer::frame loop.

I'm using osg::PrimitiveSet::LINE_STRIP as my primitive type and I do not
need to push_back 2 vertices per line segment - I think. [Embarassed] At
least, my line is being drawn... :)

Honestly, I think it's the way I'm drawing the line.  I don't believe there
is a bug in OSG. I'm just to new @ this stuff.. ha, ha...

here's my code: snippets of it: the 2 main methods w/in my class are 1)
setup my line and 2) then to add to that line one new vertex at a time.
This code actually works but it does 'slow' down after a few thousand
iterations and then speeds up.. and slows down and speeds up...

class COsgPaxNodeSceneElementInfo
{
   osg::ref_ptr m_podreTrailDrawElements;
   osg::ref_ptr m_ov3aLineVerticesData;
   osg::ref_ptr m_ogeomTrailGeometry;
   osg::ref_ptr m_ogeoTrailGeode;
   osg::Vec3d   m_ov3dPrevPos;  ///<
   previous trail head
   bool m_bHasTrail;

void m_vConstructATrail(math::Vector3D &p_v3dVec);
void m_vUpdateTrail(model::PlatformStateVector &p_psvState);
};

void COsgPaxNodeSceneElementInfo::m_vConstructATrail(math::Vector3D
&p_v3dVec)
{
 // initialize previous to current point/position sent in
 m_ov3dPrevPos.set(p_v3dVec.getX(), p_v3dVec.getY(), p_v3dVec.getZ());
 // curr pos
 osg::Vec3d ov3d(p_v3dVec.getX(), p_v3dVec.getY(), p_v3dVec.getZ()););

 // ALLOCATE  ONCE  AND  ONLY  ONCE
 m_podreTrailDrawElements= new osg::DrawArrays
 (osg::PrimitiveSet::LINE_STRIP);
 m_ov3aLineVerticesData  = new osg::Vec3Array();
 m_ogeomTrailGeometry= new osg::Geometry();
 m_ogeoTrailGeode= new osg::Geode;

 m_ov3aLineVerticesData->push_back(m_ov3dPrevPos); // prev pos
 m_ov3aLineVerticesData->push_back(ov3d);  // curr pos

 m_podreTrailDrawElements->setFirst(0);
 m_podreTrailDrawElements->setCount(m_ov3aLineVerticesData->size());

 m_ogeomTrailGeometry->addPrimitiveSet(m_podreTrailDrawElements.get());
 m_ogeomTrailGeometry->setVertexArray(m_ov3aLineVerticesData.get());
 // attempt to draw lines faster by disabling display lists &
 //  then with each new vertex added, call dirtyBound() on the geometry.
 m_ogeomTrailGeometry->setUseDisplayList(false);
 m_ogeoTrailGeode->addDrawable(m_ogeomTrailGeometry.get());


 // ADD ONLY ONCE to the Node Scene
 m_no3vViewer->m_iAddElementToScene(m_ogeoTrailGeode.get()); // equivalent
 to root->addChild(m_ogeoTrailGeode.get());  but "root" of the osg node
 scene is actually located w/in another class object, not this one.

 // keep track of fact that this node scene elem has a trail
 m_bHasTrail = true;
} // m_vConstructATrail



void COsgPaxNodeSceneElementInfo::m_vUpdateTrail(
 model::PlatformStateVector &p_psvState)
{
 if (!m_bHasTrail)
   return;

 static bool b_trailIsShowing=true; // trails on be default
 static double x,y,z;
 x=p_psvState.getPosition().getX();
 y=p_psvState.getPosition().getY();
 z=p_psvState.getPosition().getZ();

 // for now, just keep current PTL around;
 //  unused @ moment, however
 m_dPtl=p_psvState.get

Re: [osg-users] osgAnimation and 3ds max exporter

2009-04-17 Thread Botorabi
hello,

i had to temporarily freeze the work on osg exporter because of heavy workload. 
so far, bones, rigs, and animation keys are exported. there are still some 
points missing in the exporter.

it would be great if someone could help in further development of the exporter, 
so things could get done faster.


cheers
boto


Virtual Reality Chat (VRC), a free 3D chat application. http://www.vr-fun.net

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





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


[osg-users] Cache system...

2009-04-17 Thread neil.hughes
Hi All,

I'm looking for some thoughts, and advice, on the cache process within OSG. 
Essentially a while ago (OSG1.2) I wrote an app that implemented its own 
node/texture cache in memory as I didn't want to be writing things to the file 
system as permissions were potentially a problem. I'm now looking at rewriting 
in OSG2.8, and trying to get a handle on whether the cacheing offered by OSG 
has changed at all. Essentially I want to cache objects in a memory cache, 
rather than to file. As far as I can see this isn't an option within OSG2.8, 
but I wanted to check if others new anything to the contrary ?

Thanks for any help/comments.

Neil.



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


[osg-users] Cache system...

2009-04-17 Thread neil.hughes
Hi All,

I'm looking for some thoughts, and advice, on the cache process within OSG. 
Essentially a while ago (OSG1.2) I wrote an app that implemented its own 
node/texture cache in memory as I didn't want to be writing things to the file 
system as permissions were potentially a problem. I'm now looking at rewriting 
in OSG2.8, and trying to get a handle on whether the cacheing offered by OSG 
has changed at all. Essentially I want to cache objects in a memory cache, 
rather than to file. As far as I can see this isn't an option within OSG2.8, 
but I wanted to check if others new anything to the contrary ?

Thanks for any help/comments.

Neil.



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