Re: [osg-users] Positioning PrecipitationEffect

2009-05-13 Thread Rick Appleton
Hi Jason,

Thanks for the update. That's exactly what I'm seeing as well. However, as far 
as I can see in the code, the effect is positioned correctly around the camera.

Cheers,
Rick

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





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


Re: [osg-users] _CRT_SECURE_NO_WARNINGS and osg

2009-05-13 Thread Vincent Bourdier
Hi,

Thanks for the answers, I get it in osg Visual project properties :
_CRT_SECURE_NO_DEPRECATE.

I just wanted to be sure and not making supposition about that.

Thanks for you help.

Regards,
Vincent.

2009/5/13 Martin Beckett m...@mgbeckett.com

 _CRT_SECURE_NO_WARNINGS is set by default in OSG built for VS (at least
 with 2.8 an vs2008), check properties - c++ -preprocessor setttings

 Martin

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





 ___
 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] Positioning PrecipitationEffect

2009-05-13 Thread Rick Appleton
Hi Robert,

You asked Jason for a repro case back then. I've been simpifying my test case 
such that is is now a simply plane.

plane.osg
  Geode {
DataVariance STATIC
nodeMask 0x
num_drawables 1
Geometry {
  DataVariance STATIC
  PrimitiveSets 1
  {
DrawElementsUShort TRIANGLE_STRIP 4
{
  2 0 1 3
}
  }
  VertexArray Vec3Array 8
  {
181920 -10 445.602
-10 181920 445.602
-10 -10 445.602
181920 181920 445.602
  }
}
}

I run the precipitation example with the following options:
osgprecipitation plane.osg --fogColor 0.0 0.1 0.3 1.0 --particleSpeed 0.05 
--rain 0.1 --particleColour 0.5 0.5 0.5 0.5 --fogDensity 0.01 
--particleSize 0.15

You'll need to tilt the camera slightly to see the plane, and then if you zoom 
way in you'll see the precipitation. (Note, I'm not using it for rain or snow, 
hence the extremely low particle speed)

I hope this helps.

Kind regards,
Rick

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





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


Re: [osg-users] Stereo Problem

2009-05-13 Thread Jean-Christophe Lombardo

Jan Ciger wrote:

I guess they are trying to prevent cannibalization of the sales of their
overpriced Quadros by cheaper GeForces :(


May be not.
At Laval Virtual last month (french VR conference) NVidia showed an 
early version of their driver which handle OpenGL, and said that a 
'professional'  version of the 3D Vision system will be available this 
autumn (OpenGL and linux support, more robust glasses)


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


[osg-users] KeyboardEventHandler and native keyboard layout bug in Linux

2009-05-13 Thread Максим Гаммер
Hello,

While porting my program to Linux, I encountered the following error. If the
keyboard layout is English (USA) then KeyboardEventHandler works fine. But
if it's something else, Russian for example, ea.getKey() always returns
zero. (Except system keys F1 - F12 and digits)

It's the case for Kubuntu 9.04 and SUSE 11.1 (KDE)
In WindowsXP and Vista everything works fine.

The usage of KeyboardEventHandler:

bool KeyboardEventHandler::handle(const osgGA::GUIEventAdapter
ea,osgGA::GUIActionAdapter us)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::KEYDOWN ):
{
int _key = ea.getKey();
std::cout  key=   _key  std::endl;




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


[osg-users] OSG and QT integration problem

2009-05-13 Thread Максим Гаммер
Hi.

There is a problem of my program and QT integration. Problem occurs
when I'm trying to use OSG ModularEmitter for particle creation.

In process of compilation I get the following:
...
/usr/local/include/
osgParticle/ModularEmitter:89: error: expected unqualified-id before ‘double’
...
ModularEmitter, line 89 : virtual void emit(double dt);


I think the problem is in the name of method virtual void emit(double
dt), because emit is a preprocessor word in QT, (like  slot,
signal, emit...)


Any ideas how could I compile my project? )
--
Gammer Maxim
TSOGU, Tyumen, Russia
___
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-05-13 Thread Sergey Bocharov
All my experiments false. I cant make a simple thing - draw dinamic line in my 
application with color vertex. May be i'm stuped, but i'm confused about gurus 
of this forum who cant help to do this simple thing. :-(

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





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


Re: [osg-users] QT and ModularEmitter (((

2009-05-13 Thread Antonin Linares

Hi Gammer

I v' the same trouble few day ago, i solved it by add -DQT_NO_EMIT to 
the compilation flags.


cheers,
Antonin Linares



Максим Гаммер a écrit :

Hi List.

Problem QT and OSG ModularEmitter

make ...
...
/usr/local/include/osgParticle/ModularEmitter:89: error: expected 
unqualified-id before ‘double’

...

ModularEmitter, line 89 : virtual void emit(double dt);

emit - preprocessor word in QT (slot, signal, emit ...)

How can I make my project? )
--
Gammer Maxim
TSOGU, Tyumen, Russia


___
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 and QT example

2009-05-13 Thread Richard Baron Penman
hi David,

I'm also interested in your work. Like Simon I had problems with QOSGWidget
and was frustrated with the limitations of AdapterWidget.

Richard


On Mon, May 11, 2009 at 11:19 PM, Simon Loic simon1l...@gmail.com wrote:

 Hi David,

 Just to answer your point, I would be personally interested in such an
 integration.
 So far I'm using the AdapterWidget of the ViewerQt example but I'm not
 fully satisfied. Indeed it suffers a couple of problems as :
 - the lack of multiple thread support
 - a bad translation between QT keyboard events and OSG one.

 I had a quick look to the code you pointed and both seems to be handled in
 it (tell me if I'm wrong).

 As for the QOSGWidget, I tried to embed it in a QtDesigner based GUI and I
 must confess I couldn't make it. May be I dind't try hard enough. Yet if
 someone could provide such an example (ie without the trick to avoid the moc
 steps and so on), that would be hell of a tip.

 Thanks




 On Thu, May 7, 2009 at 8:43 PM, David Guthrie 
 dguth...@alionscience.comwrote:

 Hi,

 We wrote a QT/OSG integration that implements the windowing system
 interface for qt.

 It's in the delta3d dtQt library.  It seems like the sort of thing that
 should be part of OSG, we just haven't submitted it.  If there is interest,
 we can look at what the code should look like and where it should go...

 Look at

 https://delta3d.svn.sourceforge.net/svnroot/delta3d/trunk/delta3d/inc/dtQt
 https://delta3d.svn.sourceforge.net/svnroot/delta3d/trunk/delta3d/src/dtQt

 at the files

 osgadapterwidget.h
 osggraphicswindowqt.h
 qtguiwindowsystemwrapper.h

 osgadapterwidget.cpp
 osggraphicswindowqt.cpp
 qtguiwindowsystemwrapper.cpp

 Thank you!
 David Guthrie

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





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




 --
 Loïc Simon

 ___
 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] Understanding OSG : plugins runtime loading question

2009-05-13 Thread Vincent Bourdier
Hi all,

I'm currently making a dynamic lib for my application, and so I use the
osgDB::DynamicLibrary class to load the lib and find the Proc_adress but,
there are some points I would like to understand more :

1.
The osgDB::DynamicLibrary::PROC_ADDRESS is just a void* so to use the adress
as a function as expected, I need to cast it :


typedef int(*Pupdate)(const char* path, const char* id, bool
first_time);
Pupdate update;
update = (Pupdate) dll-getProcAddress(update);


If I do not cast, the compiler do not want to use a void* when I call the
function next...

It is the behavior/use you were expecting when writing this class ? or is
there someting else to use, avoiding the cast ...
A little precision : this code have to work on every osg supported
plateform. (win and linux at least)


2.
Next, I just have red a lot of code on osgDB, writers, plugins ... etc but I
didn't found the rela connection between the osgDB core and the plugins.

What I've understood is :
The core, using the file termination, load the DLL (if exists).
But the getProcAdress is never used ... so how did the core call the dll
read/write function without the ProcAdress ?


Any help would a very apreciated :-)

Thanks.

Regards,
   Vincent.
___
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-05-13 Thread J.P. Delport

Hi Sergey,

what you are trying to do is certainly possible, but it is hard to 
follow and correct code snippets.


I suggest you make a very simple example that people can compile. Then 
post the zipped code to the forum/mailing list and let someone fix it.


jp

Sergey Bocharov wrote:

All my experiments false. I cant make a simple thing - draw dinamic line in my 
application with color vertex. May be i'm stuped, but i'm confused about gurus 
of this forum who cant help to do this simple thing. :-(

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





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Change cursor with object under mouse

2009-05-13 Thread Romain Charbit
Hi,

Thanks for the answer,  that's what I was afraid of. But in fact, the graphic 
context of the app that I'am working on is made by Java, so I need this 
GraphicsWindowEmbedded. I'am gonna do it in another way :D

Thank you!

Cheers,
Romain


Romain Charbit

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





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


[osg-users] World space bounding box

2009-05-13 Thread Harold Comere
Hi all,

I wonder if there is any osg function computing any node world space bounding 
box.

If not, i have done it but i think it can be optimized a bit..
Here i'm computing it for a drawable, i compute box vertices coordinates in 
world space then i do some min max on them.



Code:
osg::BoundingBox boundingBox = drawable-getBound ( );

osg::Vec3d p1 = osg::Vec3d ( boundingBox.xMin ( ), boundingBox.yMin ( ), 
boundingBox.zMin ( ) );
osg::Vec3d p2 = osg::Vec3d ( boundingBox.xMin ( ), boundingBox.yMin ( ), 
boundingBox.zMax ( ) );
osg::Vec3d p3 = osg::Vec3d ( boundingBox.xMin ( ), boundingBox.yMax ( ), 
boundingBox.zMin ( ) );
osg::Vec3d p4 = osg::Vec3d ( boundingBox.xMin ( ), boundingBox.yMax ( ), 
boundingBox.zMax ( ) );
osg::Vec3d p5 = osg::Vec3d ( boundingBox.xMax ( ), boundingBox.yMin ( ), 
boundingBox.zMin ( ) );
osg::Vec3d p6 = osg::Vec3d ( boundingBox.xMax ( ), boundingBox.yMin ( ), 
boundingBox.zMax ( ) );
osg::Vec3d p7 = osg::Vec3d ( boundingBox.xMax ( ), boundingBox.yMax ( ), 
boundingBox.zMin ( ) );
osg::Vec3d p8 = osg::Vec3d ( boundingBox.xMax ( ), boundingBox.yMax ( ), 
boundingBox.zMax ( ) );

osg::Vec3d p1w = p1 * matrix;
osg::Vec3d p2w = p2 * matrix;
osg::Vec3d p3w = p3 * matrix;
osg::Vec3d p4w = p4 * matrix;
osg::Vec3d p5w = p5 * matrix;
osg::Vec3d p6w = p6 * matrix;
osg::Vec3d p7w = p7 * matrix;
osg::Vec3d p8w = p8 * matrix;

double xMinw = std::min ( p1w.x ( ), std::min ( p2w.x ( ), std::min ( p3w.x ( 
), std::min ( p4w.x ( ), std::min ( p5w.x ( ), std::min ( p6w.x ( ), std::min ( 
p7w.x ( ), p8w.x ( ) ) ) ) ) ) ) );
double yMinw = std::min ( p1w.y ( ), std::min ( p2w.y ( ), std::min ( p3w.y ( 
), std::min ( p4w.y ( ), std::min ( p5w.y ( ), std::min ( p6w.y ( ), std::min ( 
p7w.y ( ), p8w.y ( ) ) ) ) ) ) ) );
double zMinw = std::min ( p1w.z ( ), std::min ( p2w.z ( ), std::min ( p3w.z ( 
), std::min ( p4w.z ( ), std::min ( p5w.z ( ), std::min ( p6w.z ( ), std::min ( 
p7w.z ( ), p8w.z ( ) ) ) ) ) ) ) );

double xMaxw = std::max ( p1w.x ( ), std::max ( p2w.x ( ), std::max ( p3w.x ( 
), std::max ( p4w.x ( ), std::max ( p5w.x ( ), std::max ( p6w.x ( ), std::max ( 
p7w.x ( ), p8w.x ( ) ) ) ) ) ) ) );
double yMaxw = std::max ( p1w.y ( ), std::max ( p2w.y ( ), std::max ( p3w.y ( 
), std::max ( p4w.y ( ), std::max ( p5w.y ( ), std::max ( p6w.y ( ), std::max ( 
p7w.y ( ), p8w.y ( ) ) ) ) ) ) ) );
double zMaxw = std::max ( p1w.z ( ), std::max ( p2w.z ( ), std::max ( p3w.z ( 
), std::max ( p4w.z ( ), std::max ( p5w.z ( ), std::max ( p6w.z ( ), std::max ( 
p7w.z ( ), p8w.z ( ) ) ) ) ) ) ) );

osg::Vec3d minWorld = osg::Vec3d(xMinw, yMinw, zMinw);
osg::Vec3d maxWorld = osg::Vec3d(xMaxw, yMaxw, zMaxw);



It looks like an horrible code ... but it works.
Does anyone know a most efficient way to compute it ?

Thank you for attention,
Regards,
Harold

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





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


[osg-users] Taking it easy for a couple of days

2009-05-13 Thread Robert Osfield
Hi All,

I've gone down with a bad cold, so am struggling to focus, read and
think clearly today.  So... please don't expect much support from me
today, some active threads will just have do without my contribution
for a couple of days.

Luckily human virus can't be transmitted by email/forums just yet.

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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Lingyun Yu
Take care, Robert.
Look forward for your back.

On Wed, May 13, 2009 at 10:55 AM, Robert Osfield
robert.osfi...@gmail.comwrote:

 Hi All,

 I've gone down with a bad cold, so am struggling to focus, read and
 think clearly today.  So... please don't expect much support from me
 today, some active threads will just have do without my contribution
 for a couple of days.

 Luckily human virus can't be transmitted by email/forums just yet.

 Robert.
 ___
 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


Re: [osg-users] OSG and QT integration problem

2009-05-13 Thread Ismail Pazarbasi
On Wed, May 13, 2009 at 9:02 AM, Максим Гаммер maxgam...@gmail.com wrote:
 Hi.

 There is a problem of my program and QT integration. Problem occurs
 when I'm trying to use OSG ModularEmitter for particle creation.

 In process of compilation I get the following:
 ...
 /usr/local/include/
 osgParticle/ModularEmitter:89: error: expected unqualified-id before ‘double’
 ...
 ModularEmitter, line 89 : virtual void emit(double dt);


 I think the problem is in the name of method virtual void emit(double
 dt), because emit is a preprocessor word in QT, (like  slot,
 signal, emit...)


 Any ideas how could I compile my project? )
 --
 Gammer Maxim
 TSOGU, Tyumen, Russia
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Hi Gammer,

try to include QT _after_ OSG headers in all translation units.
Alternatively, you may temporarily undef macro then set it back. I am
not sure about its side effects; ensure that no header file directly
or indirectly loads an include file that has requires macro.

#ifdef MACRO1
#define MACRO1_SAVE MACRO1
#endif
#undef MACRO1

// include osg code here, may be?

#ifdef MACRO1_SAVE
#define MACRO1 UIQ_SAVE
#undef MACRO1_SAVE
#endif

MACRO1, in your case, is emit.

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


Re: [osg-users] Understanding OSG : plugins runtime loading question

2009-05-13 Thread Vincent Bourdier
Hi Ismail,

Not sure to understand all you explained, I didn't find a simple answer to
my questions.
I know that the getProcAdress return a void*, but I was asking about the osg
getProcAdress, and if is there any way different than the cast to get the
function usable ... and to know how this is used in the plugins because I
didn't found any code using it.

Thanks.

Regards,
   Vincent.

2009/5/13 Ismail Pazarbasi pazarb...@gmail.com

 On Wed, May 13, 2009 at 9:47 AM, Vincent Bourdier
 vincent.bourd...@gmail.com wrote:
  Hi all,
 
  I'm currently making a dynamic lib for my application, and so I use the
  osgDB::DynamicLibrary class to load the lib and find the Proc_adress but,
  there are some points I would like to understand more :
 
  1.
  The osgDB::DynamicLibrary::PROC_ADDRESS is just a void* so to use the
 adress
  as a function as expected, I need to cast it :
 
 
  typedef int(*Pupdate)(const char* path, const char* id,
 bool
  first_time);
  Pupdate update;
  update = (Pupdate) dll-getProcAddress(update);
 
  If I do not cast, the compiler do not want to use a void* when I call the
  function next...
 
  It is the behavior/use you were expecting when writing this class ? or is
  there someting else to use, avoiding the cast ...
  A little precision : this code have to work on every osg supported
  plateform. (win and linux at least)
 
 
  2.
  Next, I just have red a lot of code on osgDB, writers, plugins ... etc
 but I
  didn't found the rela connection between the osgDB core and the
 plugins.
 
  What I've understood is :
  The core, using the file termination, load the DLL (if exists).
  But the getProcAdress is never used ... so how did the core call the dll
  read/write function without the ProcAdress ?
 
 
  Any help would a very apreciated :-)
 
  Thanks.
 
  Regards,
 Vincent.
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 

 Hi Vincent,

 void* is accepted form of an address in memory. getProcAddress returns
 address of a symbol in the dynamic library and it (the underlying
 implementation) doesn't care how exported symbol looks like (i.e.
 types), nor knows what will that address be used for. There may be
 implementations around (IIRC, with boost::function and boost::bind)
 but it may be too complicated and doesn't simplify your job anyway.

 Ismail
 ___
 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] Taking it easy for a couple of days

2009-05-13 Thread neil.hughes
Hi Robert,

Hope you get well soon. 

Coincidently, this article appeared on the bbc today. So manflu does exist :-)

http://news.bbc.co.uk/1/hi/health/8047321.stm

Kind regards

Neil.



 Robert Osfield robert.osfi...@gmail.com wrote: 
 Hi All,
 
 I've gone down with a bad cold, so am struggling to focus, read and
 think clearly today.  So... please don't expect much support from me
 today, some active threads will just have do without my contribution
 for a couple of days.
 
 Luckily human virus can't be transmitted by email/forums just yet.
 
 Robert.
 ___
 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 and QT integration problem

2009-05-13 Thread Sergey Kurdakov
Hi Maxim.

BTW - in order everyone can address you properly, make some effort
which makes it easier.

example - do not use Cyrillic letters in mail header - it is not
russian mail list.

Next - sign so that is was clear what is your name and what is your surname.
as you could see from your sign it follows that your name is Gammer.

I call to you as here maintainers try to keep a special developer
atmosphere. So too much impersonal mails harms discussions.

Спасибо за понимание.

Regards
Sergey

On Wed, May 13, 2009 at 11:02 AM, Максим Гаммер maxgam...@gmail.com wrote:
 Hi.

 There is a problem of my program and QT integration. Problem occurs
 when I'm trying to use OSG ModularEmitter for particle creation.

 In process of compilation I get the following:
 ...
 /usr/local/include/
 osgParticle/ModularEmitter:89: error: expected unqualified-id before 'double'
 ...
 ModularEmitter, line 89 : virtual void emit(double dt);


 I think the problem is in the name of method virtual void emit(double
 dt), because emit is a preprocessor word in QT, (like  slot,
 signal, emit...)


 Any ideas how could I compile my project? )
 --
 Gammer Maxim
 TSOGU, Tyumen, Russia
 ___
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Lightwave multilayered textures and vertex map support?

2009-05-13 Thread Olle Ekberg
Hi,
I was wondering about the lightwave loader is multilayered textures and 
vertex maps supported?

... 

Thank you!

Cheers,
Olle

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





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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Ümit Uzun
Hi Robert;

God Bless You :)
Take care..

Regards.

2009/5/13 neil.hug...@tesco.net

 Hi Robert,

 Hope you get well soon.

 Coincidently, this article appeared on the bbc today. So manflu does exist
 :-)

 http://news.bbc.co.uk/1/hi/health/8047321.stm

 Kind regards

 Neil.



  Robert Osfield robert.osfi...@gmail.com wrote:
  Hi All,
 
  I've gone down with a bad cold, so am struggling to focus, read and
  think clearly today.  So... please don't expect much support from me
  today, some active threads will just have do without my contribution
  for a couple of days.
 
  Luckily human virus can't be transmitted by email/forums just yet.
 
  Robert.
  ___
  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




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


[osg-users] intersectorGroup, LineSegmentIntersector start end

2009-05-13 Thread petr srom
Hi,
i have got the problem with position line - Intersector, more informations in 
part of the code: 

(the scene is only rectangle face, it's  z=0.0f)

1) creating x,y,z position line: 
osg::Vec3f v3f_start(33.0f, -23.0f, 10.0f); //init position ( start )
osg::Vec3d v3f_end(33.0f, -23.0f, -5.0f); //init position ( end )

2) Intersector group:
osg::ref_ptrosgUtil::IntersectorGroup intersectorGroup = new 
osgUtil::IntersectorGroup();
osg::ref_ptrosgUtil::LineSegmentIntersector intersector = new 
osgUtil::LineSegmentIntersector(v3f_start, v3f_end);
intersectorGroup-addIntersector( intersector.get() );
osgUtil::IntersectionVisitor intersectVisitor( intersectorGroup.get(), 
new MyReadCallback );
model-accept(intersectVisitor);

3) Check intersect 
if ( intersectorGroup-containsIntersections() )
{
 ...
intersection.getWorldIntersectPoint();  //interscetion point is in 33.0f, - 
23.0f, 0.0f
...
}

4) Update position line
osgUtil::IntersectorGroup::Intersectors ints = 
intersectorGroup-getIntersectors();
for(osgUtil::IntersectorGroup::Intersectors::iterator intersector_itr2 
= ints.begin();
intersector_itr2 != ints.end();
++intersector_itr2)
{
osgUtil::LineSegmentIntersector* lsi = 
dynamic_castosgUtil::LineSegmentIntersector*(intersector_itr2-get());
if (lsi)
{
v3f_start.set(33.0f, 23.0f, 10.0f); //new position 
( start )
v3f_end.set(33.0f, 23.0f, -5.0f);   //new position 
( end )
lsi-setStart( v3f_start );  
lsi-setEnd( v3f_end );
}
}


5) Check intersect 
if ( intersectorGroup-containsIntersections() )
{
 ...
intersection.getWorldIntersectPoint(); 
//interscetion point is still the same(!) 33.0f, - 23.0f, 0.0f
//i thought that correct point must be 33.0f, 23.0f, 0.0f because 
LineSegmentIntersector contains correct new (start - end) position 
...
}

Where is the problem?

full code here:

Code:
void check_face(osgUtil::IntersectorGroup *intersectorGroup)
{
if ( intersectorGroup-containsIntersections() )
{
osgUtil::IntersectorGroup::Intersectors intersectors = 
intersectorGroup-getIntersectors();
for(osgUtil::IntersectorGroup::Intersectors::iterator 
intersector_itr = intersectors.begin();
intersector_itr != intersectors.end();
++intersector_itr)
{
osgUtil::LineSegmentIntersector* lsi = 
dynamic_castosgUtil::LineSegmentIntersector*(intersector_itr-get());
if (lsi)
{
osgUtil::LineSegmentIntersector::Intersections 
intersections = lsi-getIntersections();

for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = 
intersections.begin();
itr != intersections.end();
++itr)
{
const 
osgUtil::LineSegmentIntersector::Intersection intersection = *itr;
osg::Vec3f lv_pos;
lv_pos = 
intersection.getWorldIntersectPoint(); 
const osg::NodePath my_nodePath = 
intersection.nodePath;
unsigned int lun_nsize = 
my_nodePath.size(); 
osg::Node * ln_node = 0;
osg::Group * ln_parent = 0; 

ln_node = 
(lun_nsize=1)?my_nodePath[my_nodePath.size()-1]:0; 
std::string name = ln_node-getName();  
//name 
unsigned int mask = 
ln_node-getNodeMask(); //
//2nd group
ln_parent = 
(lun_nsize=2)?dynamic_castosg::Group*(my_nodePath[1]):0;
if (ln_parent)
{
std::string name2 = 
ln_parent-getName();   //name parent 
unsigned int mask2 = 
ln_parent-getNodeMask();  //mask parent
} 
}
}
}
}
}

//intersection
osg::Vec3f v3f_start(33.0f, -23.0f, 10.0f); //init position ( start 
)
osg::Vec3d v3f_end(33.0f, -23.0f, -5.0f);   //init position ( end )

osg::ref_ptrosgUtil::IntersectorGroup 

[osg-users] fast path with these settings?

2009-05-13 Thread Christian Sam
Hi,

according to documentation: Fast paths use vertex arrays, and 
glDrawArrays/glDrawElements.

- what is the difference between vertex arrays and glDrawArrays, or is it meant 
as generic term for glDrawArrays/glDrawElements?


will the use of something like this drop me into slow path mode?


Code:

osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,4,4| 
*colorIndexArray;
colorIndexArray = new osg::TemplateIndexArray |unsigned int, 
osg::Array::UIntArrayType,4,4|;
colorIndexArray-push_back(0); // vertex 0 assigned color array element 0
...




if not, i'm looking for a way to assign normals to vertices per indexed array, 
like the colorindexarray above. does this work in the same way?


Code:

osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,3,4| 
*normalsIndexArray;
normalsIndexArray = new osg::TemplateIndexArray|unsigned int, 
osg::Array::UIntArrayType,3,4|;
normalsIndexArray-push_back(0); // vertex 0 assigned normals array element 0
...





Thank you!

Cheers,
Christian

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





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


Re: [osg-users] OSG and QT integration problem

2009-05-13 Thread Maxim Gammer
 Thanks!

13 мая 2009 г. 17:15 пользователь Sergey Kurdakov
sergey.fo...@gmail.com написал:
 Hi Maxim.

 BTW - in order everyone can address you properly, make some effort
 which makes it easier.

 example - do not use Cyrillic letters in mail header - it is not
 russian mail list.

 Next - sign so that is was clear what is your name and what is your surname.
 as you could see from your sign it follows that your name is Gammer.

 I call to you as here maintainers try to keep a special developer
 atmosphere. So too much impersonal mails harms discussions.

 Спасибо за понимание.

 Regards
 Sergey

 On Wed, May 13, 2009 at 11:02 AM, Максим Гаммер maxgam...@gmail.com wrote:
 Hi.

 There is a problem of my program and QT integration. Problem occurs
 when I'm trying to use OSG ModularEmitter for particle creation.

 In process of compilation I get the following:
 ...
 /usr/local/include/
 osgParticle/ModularEmitter:89: error: expected unqualified-id before 'double'
 ...
 ModularEmitter, line 89 : virtual void emit(double dt);


 I think the problem is in the name of method virtual void emit(double
 dt), because emit is a preprocessor word in QT, (like  slot,
 signal, emit...)


 Any ideas how could I compile my project? )
 --
 Gammer Maxim
 TSOGU, Tyumen, Russia
 ___
 ___
 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] QT and ModularEmitter (((

2009-05-13 Thread Maxim Gammer
 Thanks!

2009/5/13 Antonin Linares antonin.lina...@onera.fr:
 Hi Gammer

 I v' the same trouble few day ago, i solved it by add -DQT_NO_EMIT to the
 compilation flags.

 cheers,
 Antonin Linares



 Максим Гаммер a écrit :

 Hi List.

 Problem QT and OSG ModularEmitter

 make ...
 ...
 /usr/local/include/osgParticle/ModularEmitter:89: error: expected
 unqualified-id before ‘double’
 ...

 ModularEmitter, line 89 : virtual void emit(double dt);

 emit - preprocessor word in QT (slot, signal, emit ...)

 How can I make my project? )
 --
 Gammer Maxim
 TSOGU, Tyumen, Russia
 

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


Re: [osg-users] OSG and QT integration problem

2009-05-13 Thread Maxim Gammer
 Thanks!

13 мая 2009 г. 18:08 пользователь Maxim Gammer maxgam...@gmail.com написал:
  Thanks!

 13 мая 2009 г. 17:15 пользователь Sergey Kurdakov
 sergey.fo...@gmail.com написал:
 Hi Maxim.

 BTW - in order everyone can address you properly, make some effort
 which makes it easier.

 example - do not use Cyrillic letters in mail header - it is not
 russian mail list.

 Next - sign so that is was clear what is your name and what is your surname.
 as you could see from your sign it follows that your name is Gammer.

 I call to you as here maintainers try to keep a special developer
 atmosphere. So too much impersonal mails harms discussions.

 Спасибо за понимание.

 Regards
 Sergey

 On Wed, May 13, 2009 at 11:02 AM, Максим Гаммер maxgam...@gmail.com wrote:
 Hi.

 There is a problem of my program and QT integration. Problem occurs
 when I'm trying to use OSG ModularEmitter for particle creation.

 In process of compilation I get the following:
 ...
 /usr/local/include/
 osgParticle/ModularEmitter:89: error: expected unqualified-id before 
 'double'
 ...
 ModularEmitter, line 89 : virtual void emit(double dt);


 I think the problem is in the name of method virtual void emit(double
 dt), because emit is a preprocessor word in QT, (like  slot,
 signal, emit...)


 Any ideas how could I compile my project? )
 --
 Gammer Maxim
 TSOGU, Tyumen, Russia
 ___
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




 --
 Гаммер Максим Дмитриевич
 Начальник отдела ИТ НИИ ЭОР




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


Re: [osg-users] Development of Qt support as part of osgViewer

2009-05-13 Thread John Ivar Haugland
Hi Jean-Sèbastien,

Thanks ! :) It helped to  use the TextureVisitor to disable
unrefImageDataAfterApply. Have you tried to share the OpenGL context
between the widgets to avoid several instances of all object
resources.

The QGLWidet has the constructor
QGLWidget ( QWidget * parent = 0, const char * name = 0, const
QGLWidget * shareWidget = 0, WFlags f = 0 )
and
bool QGLWidget::isSharing () const
to check if the GL system was able to provide it.

Is it possible to do the same with QOSGWidet?

On Tue, May 12, 2009 at 4:30 PM, Jean-Sébastien Guay
jean-sebastien.g...@cm-labs.com wrote:

 Hi John,

 I have, however, problems with textured models and the composite viewer. 
 When I add a new view after initalization (application has entered the frame 
 loop), the new view (within an QOSGWidet) does not show the textures. It the 
 views are added before entering the frame loop there are no problems.

 That's because of the unrefImageDataAfterApply setting. You're probably 
 running the osgUtil::Optimizer on your data after loading it, and this sets 
 this property of osg::Texture(1D, 2D, 3D) to true, which in turn frees the 
 image data the first time the texture is uploaded to the graphics hardware. 
 So when you create a new view (which creates a new graphics context, which 
 requires that all textures be re-uploaded to it) the image data is not 
 available anymore.

 You can either not run the optimizer, run it but disable the texture setting 
 optimization, or run just the osgUtil::Optimizer::TextureVisitor again after 
 running the Optimizer the first time, to re-set that property to false.

 Hope this helps,

 J-S
 --
 __
 Jean-Sebastien Guay    jean-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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Chris 'Xenon' Hanson
Robert Osfield wrote:
 Hi All,
 I've gone down with a bad cold, so am struggling to focus, read and
 think clearly today.  So... please don't expect much support from me
 today, some active threads will just have do without my contribution
 for a couple of days.

  Great! I'll start submitting a BUNCH of patches! ;)

 Luckily human virus can't be transmitted by email/forums just yet.

  Watch out for that Snow Crash virus...

  Take care of yourself.

 Robert.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] intersectorGroup, LineSegmentIntersector start end

2009-05-13 Thread Jean-Sébastien Guay

Hello Petr,


4) Update position line


[...]

5) Check intersect 
if ( intersectorGroup-containsIntersections() )

{
 ...
intersection.getWorldIntersectPoint(); 
//interscetion point is still the same(!) 33.0f, - 23.0f, 0.0f
//i thought that correct point must be 33.0f, 23.0f, 0.0f because LineSegmentIntersector contains correct new (start - end) position 
...

}


Does your step 5 retest for intersections (i.e. re-run the intersection 
visitor)? Also, to be safe, I would call reset() on the intersector and 
intersection visitor between intersection tests.


I have done this before (re-used the same intersector and intersection 
visitor for many intersection tests) so it should work, though I've 
never used intersection groups so perhaps there's a bug there.


If you can't get it to work I suggest you modify an existing OSG example 
(say osgpick) to demonstrate your problem and send it here, if we try it 
we can hopefully see what's wrong (either in your code or in OSG).


Hope this helps,

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] Development of Qt support as part of osgViewer

2009-05-13 Thread Jean-Sébastien Guay

Hello John,


Thanks ! :) It helped to  use the TextureVisitor to disable
unrefImageDataAfterApply. 


Glad I could help.


Have you tried to share the OpenGL context
between the widgets to avoid several instances of all object
resources.


I have not tried it, no. It could help, but I think then since the same 
context would be used for both widgets, it would have to clear twice to 
render the respective frames for each widget, and thus it couldn't be 
threaded. Using multiple contexts means you can thread the draw 
traversal (DrawThreadPerContext threading model) which will give better 
performance I think.


But this is something that could be tested in light of Robert's recent 
thread about making a Qt-specific GraphicsWindow subclass.


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] KeyboardEventHandler and native keyboard layout bug in Linux

2009-05-13 Thread Maxim Gammer
Hello,

While porting my program to Linux, I encountered the following error.
If the keyboard layout is English (USA) then KeyboardEventHandler
works fine. But if it's something else, Russian for example,
ea.getKey() always returns zero. (Except system keys F1 - F12 and
digits)

It's the case for Kubuntu 9.04 and SUSE 11.1 (KDE)
In WindowsXP and Vista everything works fine.

The usage of KeyboardEventHandler:

bool KeyboardEventHandler::handle(
const osgGA::GUIEventAdapter ea,osgGA::GUIActionAdapter us)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::KEYDOWN ):
{
int _key = ea.getKey();
std::cout  key=   _key  std::endl;

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


Re: [osg-users] intersectorGroup, LineSegmentIntersector start end

2009-05-13 Thread petr srom
Thanx mery much Skylark, 

here is the correct code, the Blue color is update.


Code:

[color=green]//positions[/color]
osg::Vec3f v3f_start(33.0f, -23.0f, 10.0f); [color=green]//init position ( 
start )[/color]
osg::Vec3d v3f_end(33.0f, -23.0f, -5.0f);   [color=green]//init 
position ( end )[/color]

[color=green]//create group[/color]
osg::ref_ptrosgUtil::IntersectorGroup intersectorGroup = new 
osgUtil::IntersectorGroup();
osg::ref_ptrosgUtil::LineSegmentIntersector intersector = new 
osgUtil::LineSegmentIntersector(v3f_start, v3f_end);
intersectorGroup-addIntersector( intersector.get() );
osgUtil::IntersectionVisitor intersectVisitor( intersectorGroup.get(), 
new MyReadCallback );
model-accept(intersectVisitor);

[color=green]//call first test[/color]  check_face(intersectorGroup);   


[color=green]//update position[/color]
osgUtil::IntersectorGroup::Intersectors ints = 
intersectorGroup-getIntersectors();
for(osgUtil::IntersectorGroup::Intersectors::iterator intersector_itr2 
= ints.begin();
intersector_itr2 != ints.end();
++intersector_itr2)
{
osgUtil::LineSegmentIntersector* lsi = 
dynamic_castosgUtil::LineSegmentIntersector*(intersector_itr2-get());
if (lsi)
{
v3f_start.set(33.0f, 23.0f, 10.0f); 
[color=green]//new position ( start )[/color]   
v3f_end.set(33.0f, 23.0f, -5.0f);   [color=green]//new position ( end 
)[/color]
lsi-setStart( v3f_start );  
lsi-setEnd( v3f_end );
}
}

[color=green]//reset and re-run (must be!)[/color]

[color=blue]intersectVisitor.reset();
model-accept(intersectVisitor);[/color]

[color=green]//call 2nd test[/color]
check_face(intersectorGroup);




Function for test is here:


Code:
void check_face(osgUtil::IntersectorGroup *intersectorGroup)
{
if ( intersectorGroup-containsIntersections() )
{
osgUtil::IntersectorGroup::Intersectors intersectors = 
intersectorGroup-getIntersectors();
for(osgUtil::IntersectorGroup::Intersectors::iterator 
intersector_itr = intersectors.begin();
intersector_itr != intersectors.end();
++intersector_itr)
{
osgUtil::LineSegmentIntersector* lsi = 
dynamic_castosgUtil::LineSegmentIntersector*(intersector_itr-get());
if (lsi)
{
osgUtil::LineSegmentIntersector::Intersections 
intersections = lsi-getIntersections();

for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = 
intersections.begin();
itr != intersections.end();
++itr)
{
const 
osgUtil::LineSegmentIntersector::Intersection intersection = *itr;
osg::Vec3f lv_pos;

lv_pos = 
intersection.getWorldIntersectPoint(); 
}
}
}
}
}



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





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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Jason Beverage
Take care Robert, get well soon :)

Jason

On Wed, May 13, 2009 at 4:55 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi All,

 I've gone down with a bad cold, so am struggling to focus, read and
 think clearly today.  So... please don't expect much support from me
 today, some active threads will just have do without my contribution
 for a couple of days.

 Luckily human virus can't be transmitted by email/forums just yet.

 Robert.
 ___
 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] Problems with FBOs when taking high resolution screenshots.

2009-05-13 Thread Jesper D. Thomsen
Hi all, I'm using OSG (2.6.1 compiled for windows XP/Vista by Visual Studio 
2005) to create a viewport in an MFC application. I have a function where I 
take a high resolution screenshot by doing RTT rendering to an FBO. I've now 
begun receiving bug reports from some users (so far, all ATI graphics card 
users) that the screenshots come out mostly black. This happens either all the 
time or after the first screenshot, which led me to guess that some kind of FBO 
resource is not getting released properly. On an older machine the screenshots 
always come out somewhat black. In both cases this occors when the screenshot 
is larger than 2048x2048 pixels. The lower-left 2048x2048 pixels of the 
screenshot are always correct, but the rest is black. I've tried using 
Pixel_buffer also, but with the exact same result on my old testmachine. On my 
own machine (Vista 64 - NV Quadro FX 2700M) the screenshots work fine at all 
tested resolutions.

Does anybody know if this is just a hard limitation in the drivers/graphics 
cards, or am I just forgetting something in my code (Code posted below).

Regards, and thanks in advance (again).

Jesper D. Thomsen

 Code: -


bool CModelView::CreateOSGImageSnap(int p_width, int p_height, double p_left, 
double p_right,

   double p_bottom, double p_top, double p_near, double p_far,

   double p_eye_pivot_0, double p_eye_pivot_1, double p_eye_pivot_2,

   double p_eye_eulerpar_0, double p_eye_eulerpar_1, double p_eye_eulerpar_2,

   double p_eye_eulerpar_3, double p_eye_dist, bool p_ortho, osg::Image* 
p_image){

osg::ref_ptrosg::Camera t_camera = new osg::Camera;

osg::ref_ptrosg::Group t_parent = new osg::Group;

unsigned int t_samples = 0;

unsigned int t_colorSamples = 0;

t_camera-setViewport(0,0,p_width,p_height);

if(p_ortho){

t_camera-setProjectionMatrixAsOrtho(p_left,p_right,p_bottom,p_top,p_near,p_far);

}else{

t_camera-setProjectionMatrixAsFrustum(p_left,p_right,p_bottom,p_top,p_near,p_far);

}

osg::Matrixd t_matrix = 
osg::Matrixd::translate(-(osg::Vec3d(p_eye_pivot_0,p_eye_pivot_1,p_eye_pivot_2)))*

osg::Matrixd::rotate((osg::Quat(p_eye_eulerpar_1,p_eye_eulerpar_2,p_eye_eulerpar_3,p_eye_eulerpar_0)).inverse())*

osg::Matrixd::translate(0.0,0.0,-p_eye_dist);

t_camera-setViewMatrix(t_matrix);

t_camera-setRenderOrder(osg::Camera::PRE_RENDER);

t_camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

t_camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

t_camera-setClearColor( 
osg::Vec4(GetBackgroundColor()[0],GetBackgroundColor()[1],GetBackgroundColor()[2],1.0)
 );

p_image-allocateImage(p_width, p_height, 1, GL_RGB, GL_UNSIGNED_BYTE);

t_camera-attach(osg::Camera::COLOR_BUFFER, p_image, t_samples, t_colorSamples);

t_camera-setPostDrawCallback(new MyCameraPostDrawCallback(p_image));

osg::Node* t_oldroot = mOSG-getASG()-getOSGRoot();

t_camera-addChild(mOSG-getASG()-getOSGRoot());

t_parent-addChild(t_camera.get());

mOSG-getViewer()-setSceneData(t_parent.get());

mOSG-getViewer()-frame();

mOSG-getViewer()-setSceneData(t_oldroot);

mOSG-getViewer()-frame();

return true; //Fixme: This should be changed to a bool describing whether the 
snapshot was successful.

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


Re: [osg-users] intersectorGroup, LineSegmentIntersector start end

2009-05-13 Thread Jean-Sébastien Guay

Hello Petr,

Thanx mery much Skylark, 


here is the correct code, the Blue color is update.


So I assume it works for you now?

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] How to increase rotation

2009-05-13 Thread Fadi Chehimi
Hi,

I am new to all this massive, remarkable graphics engine. really great and 
comprehensive work.  

Have been playing around abit trying to view a 3D model (.osg). I just want to 
know how can i increase the speed of rotating the model. Now from my 
experiments, if i scroll along the screen i get the model rotated around 90 
degrees. I want to make that double that angle. Can any one direct me? i tried 
to find the lib responsible of the transformations but could not locate it yet  

Thank you in advance

Cheers,
Fadi

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





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


Re: [osg-users] intersectorGroup, LineSegmentIntersector start end

2009-05-13 Thread petr srom
Skylark, yes, you can see result here:
[Image: http://img24.imageshack.us/img24/5431/22541985.th.jpg ] 
(http://img24.imageshack.us/my.php?image=22541985.jpg)[/img]

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





___
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-05-13 Thread Allen Saucier
Hi Sergey,

the code that I posted does work.  Have you tried using my code?  [Question]


Allen

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





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


Re: [osg-users] fast path with these settings?

2009-05-13 Thread Thrall, Bryan
Christian Sam wrote on Wednesday, May 13, 2009 6:44 AM:
 according to documentation: Fast paths use vertex arrays, and
 glDrawArrays/glDrawElements. 

Which documentation?

 - what is the difference between vertex arrays and glDrawArrays, or is
it
 meant as generic term for glDrawArrays/glDrawElements? 

Usually vertex arrays means using glVertexPointer() instead of a
series of glVertexf().

 will the use of something like this drop me into slow path mode?
 
 
 Code:
 
 osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,4,4|
 *colorIndexArray; 
 colorIndexArray = new osg::TemplateIndexArray |unsigned int,
 osg::Array::UIntArrayType,4,4|; 
 colorIndexArray-push_back(0); // vertex 0 assigned color array
element 0
 ...

Using index arrays will drop you into slow path mode, as will binding
any of your data arrays PER_PRIMITIVE. See
osg::Geometry::drawImplementation() for the exact conditions.

 if not, i'm looking for a way to assign normals to vertices per
indexed
 array, like the colorindexarray above. does this work in the same way?

 
 
 Code:
 
 osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,3,4|
 *normalsIndexArray; 
 normalsIndexArray = new osg::TemplateIndexArray|unsigned int,
 osg::Array::UIntArrayType,3,4|; 
 normalsIndexArray-push_back(0); // vertex 0 assigned normals array
element 0
 ...

It's most likely faster (because you'll be avoiding the slow path) to
copy your vertices and normals so you can bind the normals PER_VERTEX,
even though you'll get duplicates in the array. There was a thread on
the mailing list about how to do this recently; I suggest you search the
archives for it.

HTH,
-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problems with FBOs when taking high resolution screenshots.

2009-05-13 Thread Jean-Sébastien Guay

Hi Jesper,

 In both cases this occors when the screenshot
is larger than 2048x2048 pixels. The lower-left 2048x2048 pixels of the 
screenshot are always correct, but the rest is black.


I'd guess you're hitting a texture or FBO size limitation in the 
graphics cards your clients are running on. NVidia generally supports up 
to 4096x4096 (newer cards even go to 8192x8192 or more) but other 
manufacturers place different constraints.


I think you can quert GL_MAX_TEXTURE_SIZE or something like that to get 
the maximum size supported by the current driver (make sure you have an 
OpenGL context current when you try to query). Then you could limit your 
app to taking screenshots of that size. If the driver reports it 
correctly and doesn't lie, it would avoid the partially black screenshots.


As a first step you could make a small app that checks that value to see 
if that's really the problem.


Hope this helps,

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] Lightwave multilayered textures and vertex map support?

2009-05-13 Thread Tomlinson, Gordon

I don't know with out looking  at the code  but 

Did you try a model with those attributes  to see if it works that would
be the quickest test? 


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Olle
Ekberg
Sent: Wednesday, May 13, 2009 7:17 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Lightwave multilayered textures and vertex map
support?

Hi,
I was wondering about the lightwave loader is multilayered textures
and vertex maps supported?

... 

Thank you!

Cheers,
Olle

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





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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Martin Beckett
Not man-flu is it ?

Martin

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





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


Re: [osg-users] Problems with FBOs when taking high resolutionscreenshots.

2009-05-13 Thread Tomlinson, Gordon
I hazard a a guess that  that one reason you might be failing is the
card does not support the texture/ FBO size you trying to use ( never
assume always as the card what it supports )
 
// Must be called in an OGL context ( i.e. the draw thread)
GLint   maxTextureSize;
glGetIntegerv( GL_MAX_TEXTURE_SIZE, maxTextureSize); 
 
Secondly it might also be a combination of bad drivers especially with
ATI known poor Opengl drivers
 

Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__

 



From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper
D. Thomsen
Sent: Wednesday, May 13, 2009 9:34 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Problems with FBOs when taking high
resolutionscreenshots.


Hi all, I'm using OSG (2.6.1 compiled for windows XP/Vista by Visual
Studio 2005) to create a viewport in an MFC application. I have a
function where I take a high resolution screenshot by doing RTT
rendering to an FBO. I've now begun receiving bug reports from some
users (so far, all ATI graphics card users) that the screenshots come
out mostly black. This happens either all the time or after the first
screenshot, which led me to guess that some kind of FBO resource is not
getting released properly. On an older machine the screenshots always
come out somewhat black. In both cases this occors when the screenshot
is larger than 2048x2048 pixels. The lower-left 2048x2048 pixels of the
screenshot are always correct, but the rest is black. I've tried using
Pixel_buffer also, but with the exact same result on my old testmachine.
On my own machine (Vista 64 - NV Quadro FX 2700M) the screenshots work
fine at all tested resolutions.
 
Does anybody know if this is just a hard limitation in the
drivers/graphics cards, or am I just forgetting something in my code
(Code posted below).
 
Regards, and thanks in advance (again).

 

Jesper D. Thomsen

 

 Code: -

 

bool CModelView::CreateOSGImageSnap(int p_width, int p_height, double
p_left, double p_right, 

   double p_bottom, double p_top, double p_near, double p_far,

   double p_eye_pivot_0, double p_eye_pivot_1, double p_eye_pivot_2,

   double p_eye_eulerpar_0, double p_eye_eulerpar_1, double
p_eye_eulerpar_2,

   double p_eye_eulerpar_3, double p_eye_dist, bool p_ortho, osg::Image*
p_image){

osg::ref_ptrosg::Camera t_camera = new osg::Camera;

osg::ref_ptrosg::Group t_parent = new osg::Group;

unsigned int t_samples = 0;

unsigned int t_colorSamples = 0;

t_camera-setViewport(0,0,p_width,p_height);

if(p_ortho){

t_camera-setProjectionMatrixAsOrtho(p_left,p_right,p_bottom,p_top,p_nea
r,p_far);

}else{

t_camera-setProjectionMatrixAsFrustum(p_left,p_right,p_bottom,p_top,p_n
ear,p_far);

}

osg::Matrixd t_matrix =
osg::Matrixd::translate(-(osg::Vec3d(p_eye_pivot_0,p_eye_pivot_1,p_eye_p
ivot_2)))*

osg::Matrixd::rotate((osg::Quat(p_eye_eulerpar_1,p_eye_eulerpar_2,p_eye_
eulerpar_3,p_eye_eulerpar_0)).inverse())*

osg::Matrixd::translate(0.0,0.0,-p_eye_dist);

t_camera-setViewMatrix(t_matrix);

t_camera-setRenderOrder(osg::Camera::PRE_RENDER);

t_camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT
); 

t_camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

t_camera-setClearColor(
osg::Vec4(GetBackgroundColor()[0],GetBackgroundColor()[1],GetBackgroundC
olor()[2],1.0) );

p_image-allocateImage(p_width, p_height, 1, GL_RGB, GL_UNSIGNED_BYTE);

t_camera-attach(osg::Camera::COLOR_BUFFER, p_image, t_samples,
t_colorSamples);

t_camera-setPostDrawCallback(new MyCameraPostDrawCallback(p_image));

osg::Node* t_oldroot = mOSG-getASG()-getOSGRoot();

t_camera-addChild(mOSG-getASG()-getOSGRoot());

t_parent-addChild(t_camera.get());

mOSG-getViewer()-setSceneData(t_parent.get());

mOSG-getViewer()-frame();

mOSG-getViewer()-setSceneData(t_oldroot);

mOSG-getViewer()-frame();

return true; //Fixme: This should be changed to a bool describing
whether the snapshot was successful.

};

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


Re: [osg-users] How to increase rotation

2009-05-13 Thread Tomlinson, Gordon

The OSG provides some basic motion models or Manipulators which  are
found 

OSG281\src\osgGA
OSG281\Include\osgGA

If none of these are to you liking them you can simply create you own
using one of these as a template ( see OSG281\examples\osgmanipulator
)

First thing I tend to do with any new thing like OSG is to take my old
motion model I wrote years ago in the late 80s and translate into the
new code whay of doing things, this gives me the motion model I like :)
and also shows things are working etc..




Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Fadi
Chehimi
Sent: Wednesday, May 13, 2009 9:14 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] How to increase rotation

Hi,

I am new to all this massive, remarkable graphics engine. really great
and comprehensive work.  

Have been playing around abit trying to view a 3D model (.osg). I just
want to know how can i increase the speed of rotating the model. Now
from my experiments, if i scroll along the screen i get the model
rotated around 90 degrees. I want to make that double that angle. Can
any one direct me? i tried to find the lib responsible of the
transformations but could not locate it yet  

Thank you in advance

Cheers,
Fadi

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





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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Alejandro Aguilar Sierra
Hi Robert,

Me too, hope you get well soon. If this is the swine flu, don't worry, it's
less bad than common influenza.

Neil, evidence suggest that women's immune system is stronger, but not
always. In the case of swine flu, at least in my country, there were
infected more women than men. At the point when the flu becomes mortal
(pneumonia) apparently it doesn't discriminate.

Regards,

-- A.

On Wed, May 13, 2009 at 6:10 AM, neil.hug...@tesco.net wrote:

 Hi Robert,

 Hope you get well soon.

 Coincidently, this article appeared on the bbc today. So manflu does exist
 :-)

 http://news.bbc.co.uk/1/hi/health/8047321.stm

 Kind regards

 Neil.



  Robert Osfield robert.osfi...@gmail.com wrote:
  Hi All,
 
  I've gone down with a bad cold, so am struggling to focus, read and
  think clearly today.  So... please don't expect much support from me
  today, some active threads will just have do without my contribution
  for a couple of days.
 
  Luckily human virus can't be transmitted by email/forums just yet.
 
  Robert.
  ___
  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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Development of Qt support as part of osgViewer

2009-05-13 Thread René Molenaar
Hi Robert,

I have tried a few different 're-invent' paths with different ups and downs.
We use qt 3.3.8 and osg 2.8.0, here is some of my experience.

QGLWidget provides functions like:
  grabFrameBuffer
  renderText

a previous implementation of our software (with Producer) used these
functions. So I
subclassed from QGLWidget to keep this functionality.

When creating a new traits with inheritedWindowData, on windows the event
will not
be form QT, but from windows itself. On Linux you will need to adapt the
event
(using an AdapterWidget). Unfortionately some graphics drivers had problems
creating a valid context (Intel..). So I replaced the code using
GraphicsWindowEmbedded and
always using an AdapterWidget.

Special attention was needed for scroll event and for modifier adaptation.
For example scrolling
in a treeview caused the viewer to zoom and a treeview to scroll
simultaneously (only on widows,
on linux the focus is stolen).

It was nice to see your 'on demand' update scheme. For a viewer in a GUI it
is not always very nice to be continously drawing.
We also got some users with a single processor (which would be drawing with
100% cpu usage). So I made use of your new code.

There are more little details/point of attention that are needed for the
QT/OSG integration (how to setup multiple views/ shared context etc?).

We currently use QT 3.3.8 and not 4.5, so our integration is 'out-dated'.
But we do have the plan to start using 4.5 soon.
I agree with your analysis of the situation and that it would be good to
adress this issue.
Our implementation currently suffices, but since i have some experience I am
interested in this development.

Have you seen David Guthries implementation (posted a few days ago), it uses
windowsystemwrapper to integrate osg/qt?

Have a good one,

Rene Molenaar


2009/5/11 Robert Osfield robert.osfi...@gmail.com

 Hi All,

 There has been lots of support questions relating to Qt integration
 with the OSG over the past year, and especially in the last few
 months.  This a good in terms of see a cross platform GUI toolkit
 becoming more widely spread, bad in terms of the difficulties that
 users still have.  Part of the difficulties is down to Qt being a
 little bit awkward to integrate with making it not entirely straight
 forward, and while we have an example, it's just a guide so lots of
 users are having to go re-invent the wheel each time.  So it'd be good
 to try and address this issue by providing a better Qt/OSG widget for
 users to adopt directly.

 One of the design facets of osgViewer library is that it's designed to
 work with multiple windowing toolkits, with four models of integration
 possible:

 1) GraphicsWindowEmbedded - provides very basic single threaded,
 single context window integration suitable for use with simple apps
 that use SDL/GLUT.

  2) GraphicsWindow core osgViewer implementations (i.e.
 GraphisWindowWin32/X11/Carbon/Cocoa) - full OpenGL + multi-context,
 threadeding and pbuffer capabilities exposed.  You'll find these
 implementation interfaces in include/osgViewer/api/Win32, X11, Carbon
 and Cocoa.

  3) GraphicsWindow subclass (i.e GraphicsWindowWx) - 3rd party
 implementation of a GraphicsWindow, potential for full capabilities if
 all parts of GraphicsWindow are correctly implemented.  For pbuffer
 support one will have to add PixelBuffer implementation as well.

 4)  GraphicsWindow window inheritance - windowing toolkit provides the
 window, while GraphicsWindowWin32/X11/Carbon/Cocoa provide the actual
 OpenGL context implementation.


 Now Item 1) is really just for very simple apps, and is often adopted
 by end users because it's really easy to use, but almost always starts
 limiting you as your project goes on.  I wouldn't recommend 1 for
 anything by GLUT/SDL style apps.

 Items 2 is great for sim and games that don't need any GUI.  You can
 get the full capabilities of the OSG with very little effort on your
 part.   If you want a traditional 2D GUI though then it won't help
 you.

 Item 3 is possible, but rarely do 3rd party window toolkits do OpenGL
 really well, often they won't expose the full capabilities of OpenGL
 or support pbuffers.  It also often requires the most work in
 implementation.

 Item 4 is possible, but a little bit awkward, but potentially can give
 users the best of both worlds - full OpenGL/OSG capabilities and the
 2D GUI.

 --

 So where does that leave the Qt side?  We'll my preference would be to
 work together to get a GraphicsWindowQt and/or a window inheritance
 implemented in a full and flexible way that users could just reuse the
 implementation provided in a new include/osgViewer/api/Qt collection
 of headers.  I would suggest the implementation should be done
 entirely in the headers to avoid the need for linking the osgViewer
 library itself to Qt.

 Now I've tinkered with Qt, but I'm not Qt expert, to get a really good
 implementation we'll need members of the community to pitch in with
 helping 

Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Robert Osfield
HI All,

Thanks to all that have posted for the good will.

It's only a head cold, I might feel pretty grotty, but it's nothing
that a few days of taking it easy won't cure, even with and
underwhelming male immune system ;-)

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


[osg-users] Camera Callback

2009-05-13 Thread Ruiying Wang
Hi, guys

I've been playing adding a camera call back. But I can't figure out why I can 
change the background clear colour, yet I can't set the view matrix of the 
camera? 


Code:


viewer.getCamera()-setUpdateCallback( new CameraUpdateCallback );




... 

Thank you!

Cheers,
Ruiying[/code]

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





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


Re: [osg-users] Camera Callback

2009-05-13 Thread Jean-Sébastien Guay

Hello Ruiying,

I've been playing adding a camera call back. But I can't figure out why I can change the background clear colour, yet I can't set the view matrix of the camera? 


Do you have a camera manipulator on your View? If so, the manipulator's 
calculated view matrix will override whatever you set as your camera's 
view matrix each frame. You either need to remove the manipulator (if 
you want to always set your view matrix in your callback) or set the new 
view position/direction by changing the manipulator's home position.


Hope this helps,

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] View-dependent texture

2009-05-13 Thread zhu liangxiong
Hi all,
I have a shapefile which contains about 6000 polygons, And i have an ive 
terrain file as well. how can i make those polygons to be 3D surfaces close to 
the terrain? And Surfaces from the same polygon will use the same texture then. 
I have heard  that there is a tech named View-Dependent Texture can do this, 
but i do not know how to? does OSG support that?

sincerely

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


[osg-users] Disabling the non power of two option of a loaded model

2009-05-13 Thread Alfonso Callejo Goena
Dear all:

Does anyone know how can I disable the setResizeNonPowerOfTwoHint option
of the textures of a loaded model?
For individual textures it is done in the following way:

 myTexture-setResizeNonPowerOfTwoHint(false);

but in the case of textures which belong to a loaded model like

 osg::ref_ptrosg::Node importedRoad = osgDB::readNodeFile(
roadGeom.ive );

I don't know how to do it. I want to disable this option because when these
road textures are first seen by the camera, the program stops for a moment
to scale them to the power of two and it is quite rough.

Thanks a lot,
Alfonso
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Disabling the non power of two option of a loaded model

2009-05-13 Thread Jean-Sébastien Guay

Hello Alfonso,

I don't know how to do it. I want to disable this option because when 
these road textures are first seen by the camera, the program stops 
for a moment to scale them to the power of two and it is quite rough.


You have a few options, and not all of them are disabling that hint...

1. Of course, you can ask your modelers to use powers of two in texture 
sizes.


2. You can use osgconv to do the resize offline (osgconv in.osg 
out.osg). The resulting model will be the same thing that you get when 
it's done at run time, but the program won't need to scale the textures, 
they'll already be scaled. You can even take this opportunity to make 
other things more efficient, like if you choose .ive as your output 
format the loading will likely take less time, and if you use the 
--compressed argument you'll get compressed textures that take less 
texture memory on the video card.


These two options are good because they don't force you to use video 
cards that support NPOT textures. These are quite common now, but if you 
have a wide user/customer base (or you want to) then you want to support 
as wide an array of hardware as possible, and using POT textures is one 
factor in that.


3. If you really want to disable the resizeNPOTHint, you need to write a 
visitor that you'll run just after loading a model. This visitor will 
traverse the loaded graph and for each node and drawable, check if the 
stateset contains a texture, and if so disable the hint. No such visitor 
exists right now, but you can take inspiration from the 
osgUtil::Optimizer::TextureVisitor which does this for other texture 
settings.


I was planning on extending osgUtil::Optimizer::TextureVisitor to 
support this option sometime, but it's a wish list item so it could 
take some time for me to get to it. If you want to do something like 
that, I encourage you to do it there and submit the modified files so 
that all could have this added capability in a future version of OSG.


Hope this helps,

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] Non-model elements in scenegraph

2009-05-13 Thread Martin Beckett
Quick question about how you typically handle non-model objects in the scene, 
eg grids, coordinate axis icons, north arrows, bounding cubes.

The problem with just attaching them to the nodes is that statesets, picking 
and save operation apply to them. So a pick might find the grid and changing 
points/mesh/surface or lighting also effects the grid.

I have tried having a separate tree from the root so I can apply visitors to 
only the model branch but it would be nice to associate a grid or bounding cube 
with a particular node.
Another alternative is to set a particular value for the name or user data 
field and modify all the visitor operations to skip this.

Is there a common pattern for this?

Cheers,
Martin

ps. To save re-inventing the wheel does anyone have any examples of a 
coordinate axis icon? Ideally one that can act like a billboard and stay in the 
same place on the screen as the camera/model is moved?

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





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


Re: [osg-users] Non-model elements in scenegraph

2009-05-13 Thread Art Tevs
Hi Martin,

as in my case, I always do derive a non-model class from osg::Group and use it 
as a base class of the non-model object. Deriving from Group gives you the 
possibility to include the object somewhere in the scene graph if it is 
required, so that the nodes to which it belongs can be placed as childs to this 
object.

Other idea would be to derive your objects from osg::Referenced and place them 
as user data into any node you need, see osg::Object::setUserData().

Cheers,
Art

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





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


Re: [osg-users] World space bounding box

2009-05-13 Thread Paul Martz
It's not at all clear to me what your code, below, is doing. If I wanted the
world coordinate bounding box of a given node, I'd do the following:

const osg::MatrixList m = node-getWorldMatrices();
osg::ComputeBoundsVisitor cbv;
node-accept( cbv );
osg::BoundingBox bb = cbv.getBoundingBox();
osg::Vec3 minV = bb._min * m.front();
osg::Vec3 maxV = bb._max * m.front();
osg::notify( osg::ALWAYS )  minV  std::endl  maxV  std::endl;

No regard for multiparenting there, but you could easily add code to iterate
over the MatrixList if you wanted that.

Hope that helps.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Harold
Comere
Sent: Wednesday, May 13, 2009 2:50 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] World space bounding box

Hi all,

I wonder if there is any osg function computing any node world space
bounding box.

If not, i have done it but i think it can be optimized a bit..
Here i'm computing it for a drawable, i compute box vertices coordinates in
world space then i do some min max on them.



Code:
osg::BoundingBox boundingBox = drawable-getBound ( );

osg::Vec3d p1 = osg::Vec3d ( boundingBox.xMin ( ), boundingBox.yMin ( ),
boundingBox.zMin ( ) ); osg::Vec3d p2 = osg::Vec3d ( boundingBox.xMin ( ),
boundingBox.yMin ( ), boundingBox.zMax ( ) ); osg::Vec3d p3 = osg::Vec3d (
boundingBox.xMin ( ), boundingBox.yMax ( ), boundingBox.zMin ( ) );
osg::Vec3d p4 = osg::Vec3d ( boundingBox.xMin ( ), boundingBox.yMax ( ),
boundingBox.zMax ( ) ); osg::Vec3d p5 = osg::Vec3d ( boundingBox.xMax ( ),
boundingBox.yMin ( ), boundingBox.zMin ( ) ); osg::Vec3d p6 = osg::Vec3d (
boundingBox.xMax ( ), boundingBox.yMin ( ), boundingBox.zMax ( ) );
osg::Vec3d p7 = osg::Vec3d ( boundingBox.xMax ( ), boundingBox.yMax ( ),
boundingBox.zMin ( ) ); osg::Vec3d p8 = osg::Vec3d ( boundingBox.xMax ( ),
boundingBox.yMax ( ), boundingBox.zMax ( ) );

osg::Vec3d p1w = p1 * matrix;
osg::Vec3d p2w = p2 * matrix;
osg::Vec3d p3w = p3 * matrix;
osg::Vec3d p4w = p4 * matrix;
osg::Vec3d p5w = p5 * matrix;
osg::Vec3d p6w = p6 * matrix;
osg::Vec3d p7w = p7 * matrix;
osg::Vec3d p8w = p8 * matrix;

double xMinw = std::min ( p1w.x ( ), std::min ( p2w.x ( ), std::min ( p3w.x
( ), std::min ( p4w.x ( ), std::min ( p5w.x ( ), std::min ( p6w.x ( ),
std::min ( p7w.x ( ), p8w.x ( ) ) ) ) ) ) ) ); double yMinw = std::min (
p1w.y ( ), std::min ( p2w.y ( ), std::min ( p3w.y ( ), std::min ( p4w.y ( ),
std::min ( p5w.y ( ), std::min ( p6w.y ( ), std::min ( p7w.y ( ), p8w.y ( )
) ) ) ) ) ) ); double zMinw = std::min ( p1w.z ( ), std::min ( p2w.z ( ),
std::min ( p3w.z ( ), std::min ( p4w.z ( ), std::min ( p5w.z ( ), std::min (
p6w.z ( ), std::min ( p7w.z ( ), p8w.z ( ) ) ) ) ) ) ) );

double xMaxw = std::max ( p1w.x ( ), std::max ( p2w.x ( ), std::max ( p3w.x
( ), std::max ( p4w.x ( ), std::max ( p5w.x ( ), std::max ( p6w.x ( ),
std::max ( p7w.x ( ), p8w.x ( ) ) ) ) ) ) ) ); double yMaxw = std::max (
p1w.y ( ), std::max ( p2w.y ( ), std::max ( p3w.y ( ), std::max ( p4w.y ( ),
std::max ( p5w.y ( ), std::max ( p6w.y ( ), std::max ( p7w.y ( ), p8w.y ( )
) ) ) ) ) ) ); double zMaxw = std::max ( p1w.z ( ), std::max ( p2w.z ( ),
std::max ( p3w.z ( ), std::max ( p4w.z ( ), std::max ( p5w.z ( ), std::max (
p6w.z ( ), std::max ( p7w.z ( ), p8w.z ( ) ) ) ) ) ) ) );

osg::Vec3d minWorld = osg::Vec3d(xMinw, yMinw, zMinw); osg::Vec3d maxWorld =
osg::Vec3d(xMaxw, yMaxw, zMaxw);



It looks like an horrible code ... but it works.
Does anyone know a most efficient way to compute it ?

Thank you for attention,
Regards,
Harold

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





___
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] two-sided lighting

2009-05-13 Thread Butler, Lee Mr CIV USA USAMC
I didn't find anything in the archives which succinctly answered this,
so I thought I'd post my solution to getting two-sided lighting.  It is
not pretty from an encapsulation standpoint, but it works:

void setLightingTwoSided(osgViewer::Viewer viewer)
{
LightModel *lm = new LightModel;
lm-setTwoSided(true);
lm-setAmbientIntensity(osg::Vec4(0.1f,0.1f,0.1f,1.0f));

osg::StateSet *ss;

for (int i=0 ; i  2 ; i++ ) {
ss = ((osgViewer::Renderer *)
viewer.getCamera()-getRenderer())-getSceneView(i)-getGlobalStateSet();


//ss-removeAttribute(ss-getAttribute(osg::StateAttribute::LIGHTMODEL));
ss-setAttributeAndModes(lm, osg::StateAttribute::ON);
}
}

I use it like this:

osg::Viewer viewer(arguments);
setLightingTwoSided(viewer);

If anyone has a better solution let me know.

Lee

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


Re: [osg-users] Disabling the non power of two option of a loaded model

2009-05-13 Thread Jean-Sébastien Guay

Hi Alfonso,

I have turned the .ive model into a --compressed .ive model and now it 
works perfectly. It is certainly the most simple solution. 


Good to know it was an acceptable solution and worked for you.

I'm sorry but 
at the moment I don't have enough knowledge to write the TextureVisitor. 
However, I will be very glad to contribute to OSG when I can.


It really wouldn't be hard (just a few variables to add, and setting the 
parameter if needed) but it's ok, I'll get to it someday :-)


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] Non-model elements in scenegraph

2009-05-13 Thread Martin Beckett

art wrote:
 as in my case, I always do derive a non-model class from osg::Group and use 
 it as a base class of the non-model object. Deriving from Group gives you the 
 possibility to include the object somewhere in the scene graph if it is 
 required, so that the nodes to which it belongs can be placed as childs to 
 this object.

Would visitors still apply to it as with any other node in the graph - I don't 
see how that helps?


 Other idea would be to derive your objects from osg::Referenced and place 
 them as user data into any node you need, see osg::Object::setUserData().

Would they still get rendered?

Martin

ps. TheButler - did you mean to post your message as a reply to this thread?

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





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


Re: [osg-users] osgviewer question

2009-05-13 Thread Martin Beckett
Take a look in the submissions forum, there is a SphericalManipulator that may 
do exactly what you want and some changes to TrackballManipulator that I 
submitted.

Cheers,
Martin

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





___
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-05-13 Thread Sergey Bocharov
Hi, ALL

I spend my time and here is му test case for Dinamic Line Drawing

As I see , we dont need no setUseDisplayList(false), no dirtyBound()

It works fine. 

Now i will search why it dont works in my application. 

Test case in attach. run it and just press any key.

... 

Thank you!

Cheers,
Sergey

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





osgDinamicLine.cpp
Description: Binary data
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Non-model elements in scenegraph

2009-05-13 Thread Art Tevs
Hi Martin,


mgb_osg wrote:
 
 Would visitors still apply to it as with any other node in the graph - I 
 don't see how that helps?

Of course they would, however nodes are not drawable things, nodes are there 
just to organize the scene graph. I thought, you want to include something 
non-drawable into your scene graph.


 Would they still get rendered?

No, for this case you have to derive your objects from osg::Drawable and 
implement the neccessary rendering functionality.

You could even create your own geodes, which will then use your drawables in 
the special way as you need.

Maybe, I didn't understood what you exactly want to achieve, however this is 
the way how I always do such kind of things.

regards,
art

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





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


Re: [osg-users] Non-model elements in scenegraph

2009-05-13 Thread Martin Beckett
No - I want the exact opposite!

I want things that are drawn in the scene (eg gridlines) but do not respond to 
other scenegraph events so they can't be picked, saved, or be affected by 
lighting/drawing changes.

Some of this I can do with stateattribute so that eg. a gridline is always 
drawn with no lighting but for things like picking the intersector visitor must 
explicitly know to ignore a grid.

The point was to make a distinction between real model elements and 
'decoration' elements - I just wondered if there was a common practice way of 
doing this.

Cheers,
Martin

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





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


Re: [osg-users] Non-model elements in scenegraph

2009-05-13 Thread Jean-Sébastien Guay

Hi Martin,


Some of this I can do with stateattribute so that eg. a gridline is always 
drawn with no lighting but for things like picking the intersector visitor must 
explicitly know to ignore a grid.

The point was to make a distinction between real model elements and 
'decoration' elements - I just wondered if there was a common practice way of 
doing this.


Why not just devote a bit in the nodemask for such elements? Then you 
set the intersection visitor's traversal mask to ignore those elements.


const unsigned int NODEMASK_UNPICKABLE = 0x1000;// whatever
iv-setTraversalMask(~NODEMASK_UNPICKABLE);

That's how we do 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] osgviewer question

2009-05-13 Thread Jean-Sébastien Guay

Hi Keith,


I want to set up an initial view matrix that looks down the Z-axis, approaching 
a 2D mode. I can currently do the effect I want but I have to use the mouse to 
reposition the view. This is not that big a deal but would be some help in 
manipulating the current view frustum. What is the best method to call to set 
this up?


By default, camera manipulators will override any changes you make 
directly to the view matrix in your camera, so you should set the home 
position on your camera manipulator to get the effect you want 
programmatically. If you're using osgviewer and calling viewer.run() to 
initiate your frame loop, then the viewer is setting a default 
osgGA::TrackballManipulator as your camera manipulator.


You can use viewer-getCameraManipulator()-setHomePosition(eye, center, 
up) to do what you want (eye is the camera position, center is the point 
you're looking at, and up is the up-vector). Call home(0) afterwards for 
the new settings to take.


Hope this helps,

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] View-dependent texture

2009-05-13 Thread Wojciech Lewandowski
Hi,

Sounds like you should look at osgSim::OverlayNode. I believe that 
osgsimulation example shows how to use it.

Cheers,
Wojtek


From: zhu liangxiong 
Sent: Thursday, May 14, 2009 8:41 AM
To: osg-users@lists.openscenegraph.org 
Subject: [osg-users] View-dependent texture


Hi all,
I have a shapefile which contains about 6000 polygons, And i have an ive 
terrain file as well. how can i make those polygons to be 3D surfaces close to 
the terrain? And Surfaces from the same polygon will use the same texture then. 
I have heard  that there is a tech named View-Dependent Texture can do this, 
but i do not know how to? does OSG support that?

sincerely

zhu liangxiong





___
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] Non-model elements in scenegraph

2009-05-13 Thread Art Tevs

Skylark wrote:
 Hi Martin,
 
 Why not just devote a bit in the nodemask for such elements? Then you 
 set the intersection visitor's traversal mask to ignore those elements.
 
 const unsigned int NODEMASK_UNPICKABLE = 0x1000;// whatever
 iv-setTraversalMask(~NODEMASK_UNPICKABLE);
 
 That's how we do it.
 


Yep, this is also a possibility. Just setup all the used visitors in the proper 
way, so that they don't perform their actions on the nodes you don't need.

cheers,
art

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





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


Re: [osg-users] fast path with these settings?

2009-05-13 Thread Christian Sam
hi bryan, thank you for your reply.


 
 
  
  according to documentation: Fast paths use vertex arrays, and
  glDrawArrays/glDrawElements. 
  
 
 Which documentation?
 


- sorry, i meant according to (doxygen) reference 
(http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00267.html#fe139bb2f71cbafc1a8fc9e707ca5397)


 
 
  - what is the difference between vertex arrays and glDrawArrays, or is
  it meant as generic term for glDrawArrays/glDrawElements? 
  
 
 Usually vertex arrays means using glVertexPointer() instead of a
 series of glVertexf().
 


- solved


 
 
  
  will the use of something like this drop me into slow path mode?
  
  Code:
  
  osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,4,4|
  *colorIndexArray; 
  colorIndexArray = new osg::TemplateIndexArray |unsigned int,
  osg::Array::UIntArrayType,4,4|; 
  colorIndexArray-push_back(0);
  
 
 Using index arrays will drop you into slow path mode, as will binding
 any of your data arrays PER_PRIMITIVE. See
 osg::Geometry::drawImplementation() for the exact conditions.
 


- as far as i have understood osg::Geometry::drawImplementation():  
regardless of what a indexed array is indexing (vertex, color, normals, etc.) 
it will drop me into slow path mode.
but does type glDrawElements also falls under this rule - they are indexed too? 
but according to reference: Fast paths use vertex arrays, and 
DrawArrays/glDrawElements. 

- whats the difference between BIND_PER_PRIMITIVE_SET and
BIND_PER_PRIMITIVE? in the tutorials these types are never used, but i assume 
if i have a geometry consisting of 4 quads, i could define a colorarray with 4 
entries and bind them with BIND_PER_PRIMITIVE_SET, so the vertices of quad_1 
get color_1, quad_2's vertices color_2, and so on, meaning every quad gets its 
own color. 


 
 
  
  if not, i'm looking for a way to assign normals to vertices per
  indexed array, like the colorindexarray above. does this work in the same 
  way?
  
  Code:
  
  osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,3,4|
  *normalsIndexArray; 
  normalsIndexArray = new osg::TemplateIndexArray|unsigned int,
  osg::Array::UIntArrayType,3,4|; 
  normalsIndexArray-push_back(0);
  
 
 It's most likely faster (because you'll be avoiding the slow path) to
 copy your vertices and normals so you can bind the normals PER_VERTEX,
 even though you'll get duplicates in the array. There was a thread on
 the mailing list about how to do this recently; I suggest you search the
 archives for it.
 


- solved

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





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


[osg-users] Camera view frustum to Polytope

2009-05-13 Thread Simon Hammett
Hi Everyone,

Is there a quick and easy way to populate a osg::Polytope with a
cameras view frustum?
I've tried stepping though osg::Viewer::frame(), but there's so much
code I've either
not stepped into the right function or just missed it and searching
the mail achieve just
brings up too many false results.

tia, Simon.

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


Re: [osg-users] fast path with these settings?

2009-05-13 Thread Thrall, Bryan
Christian Sam wrote on Wednesday, May 13, 2009 3:19 PM:
 according to documentation: Fast paths use vertex arrays, and
 glDrawArrays/glDrawElements. 
 
 
 Which documentation?
 
 - sorry, i meant according to (doxygen) reference

(http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs
/a00267.html#fe139bb2f71cbafc1a8fc9e707ca5397)
 

Thanks, it's good to know where you're starting from :)

 will the use of something like this drop me into slow path mode?
 
 Code:
 
 osg::TemplateIndexArray |unsigned int,
osg::Array::UIntArrayType,4,4|
 *colorIndexArray; colorIndexArray = new osg::TemplateIndexArray
|unsigned
 int, osg::Array::UIntArrayType,4,4|;
 colorIndexArray-push_back(0);
 
 
 Using index arrays will drop you into slow path mode, as will binding
 any of your data arrays PER_PRIMITIVE. See
 osg::Geometry::drawImplementation() for the exact conditions.
 
 
 
 - as far as i have understood osg::Geometry::drawImplementation(): 
 regardless of what a indexed array is indexing (vertex, color,
normals, etc.)
 it will drop me into slow path mode.  
 but does type glDrawElements also falls under this rule - they are
indexed
 too? but according to reference: Fast paths use vertex arrays, and
 DrawArrays/glDrawElements.  

glDrawElements does not fall under this rule; it specifies the indices
in the PrimitiveSet, you only fall into the slow path when you use an
index array.

 - whats the difference between BIND_PER_PRIMITIVE_SET and
 BIND_PER_PRIMITIVE? in the tutorials these types are never used, but i
assume
 if i have a geometry consisting of 4 quads, i could define a
colorarray with
 4 entries and bind them with BIND_PER_PRIMITIVE_SET, so the vertices
of
 quad_1 get color_1, quad_2's vertices color_2, and so on, meaning
every quad
 gets its own color.  

BIND_PER_PRIMITIVE_SET lets you set the color per PrimitiveSet (so if
you have 2 PrimitiveSets added to the Geometry, you can specify a color
for each); BIND_PER_PRIMITIVE lets you change the color of each
primitive in each PrimitiveSet (so, for each quad). Both require using
the slow path.

I think it's a good thing the examples and tutorials don't use these; we
want to encourage people to use the fast path!

HTH,
-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] nodemask culling and picking questions

2009-05-13 Thread Jean-Sébastien Guay

Hello Lee,


What does it take to get display culling of objects based on NodeMask
values?  I'm setting the NodeMask on nodes (Geodes) in the scenegraph
and calling view-getCamera()-setCullMask(value) but I'm not seeing any
change in the geometry displayed.  Is there something I need to enable?


You should set the CullMask to ~value. Traversals compare the traversal 
mask and the node's nodemask with a bitwise , so you're effectively 
saying render only what has this node mask. You should be saying 
render what does not have this node mask.



I've also noticed when using LineSegmentIntersector that geometry that
is clipped by ClipNode clipping planes is showing up in the intersection
list returned.  Anything I can do about that?


I think ClipNode only affects rendering, not traversals. Others will 
correct me on this if needed, I've never used them personally.


Hope this helps,

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] Repost: Top 10 debugging tips

2009-05-13 Thread Paul Martz
Hi Simon and Marciej --
 
On Windows, I can already do the following:
set OSG_NOTIFY_LEVEL=DEBUG
osgviewer cow.osg  foo.txt
All of the notify output goes to the foo.txt text file.
 
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com http://www.skew-matrix.com/ 
+1 303 859 9466
 

  _  

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Maciej Krol
Sent: Tuesday, May 12, 2009 11:35 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Repost: Top 10 debugging tips


Hi Simon, Paul et al,

Yesterday I've posted to osg-submissions notification redirection interface.
For windows you could redirect messages to debug output with single line of
code.

osg::setNotifyHandler(new osg::WinDebugNotifyHandler)

You can define custom notification sinks by implementing osg::NotifyHandler
interface:

class MyNotifyHandler : public osg::NotifyHandler
{
  void notify(osg::NotifySeverity severity, const char *message)
  {
 printf(severity %d: %s, severity, message);
  }
}

Apart from visual studio debugger output I use DebugView
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx all the time,
it is a little tool from SysInternals (now Microsoft) that shows debug
messages from all applications. Very handy when You try to solve problems
with released application at target system and no debugger is available.

Regards,
Maciej


2009/5/13 Simon Hammett s.d.hamm...@googlemail.com


Many, (most?) osg users are using windozes.
So redirecting osg::notify messages should be in that list.

(Plz somebody give me a job developing for *ix.!)

2009/5/12 Paul Martz pma...@skew-matrix.com:

 I've created the following list of debugging tips to help new OSG
developers
 become productive faster:
   http://www.skew-matrix.com/bb/viewtopic.php?f=6
http://www.skew-matrix.com/bb/viewtopic.php?f=6t=5 t=5

 I hope you find it useful. Feedback appreciated.

 Paul Martz
 Skew Matrix Software LLC
 http://www.skew-matrix.com
 +1 303 859 9466


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





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





-- 
Regards,
Maciej Krol

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


Re: [osg-users] Makefile question

2009-05-13 Thread Ismail Pazarbasi
On Wed, May 13, 2009 at 11:25 PM, Wyatt Earp wyattbsearp1...@gmail.com wrote:
 I am writing my own make files for my osg app... when I link to GL, or GLUT,
 I use -lGL or -lGLUT... what is the equivalent for osg libraries?  Would it
 be something like -losgViewer for libosgViewer.so?

 W.E.


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



Hi Wyatt,

yes, it's -losg. For debug versions of OSG libraries, you can append
d to library name; e.g. -losgd. Note that linking only with osg may
not be enough; you may need to link with OpenThreads and other osg
libraries as well (e.g. -losgViewer).

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


[osg-users] Makefile question

2009-05-13 Thread Wyatt Earp
I am writing my own make files for my osg app... when I link to GL, or GLUT,
I use -lGL or -lGLUT... what is the equivalent for osg libraries?  Would it
be something like -losgViewer for libosgViewer.so?

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


Re: [osg-users] [osgPlugins] osgDB OBJ Plugin

2009-05-13 Thread Robert Youngren
Hi,

For reasons that aren't relevant I'm trying to merge multiple .obj files into 
one.  Each .obj file fairly small and includes  the typical mtllib, usemtl 
statements then is followed by the g group name then the list of vertices v 
then a list of facets, f.  All very normal, I can load and view the files no 
problem.  

So maybe this isn't the best way to do this but to merge I'm doing:

osgDB.writeNodeFile(osgDB.readNodeFiles(objFileList,mergedObjFileName)

where, objFileList is a list of the file paths to each of the .obj files to 
merge, mergedObjFileName is the output .obj file name.

This does, technically, work.  However, in the final, merged, .obj file I've 
lost what I specified for mtllib, usemtl and the group g names  It looks 
like all those have been auto generated?  Am I missing something?  I know there 
is the ability for osgDB.readNodeFiles and osgDB.writeNodeFiles to take other 
command line parameters?  So should I be specifying some?  Help!  Any guidance 
would be appreciated!

Is there a better way to handle the merge?


Thank you!

Cheers,
Robert

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





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


Re: [osg-users] osgviewer question

2009-05-13 Thread Chris 'Xenon' Hanson
Keith Steffen wrote:
 Hi all,
 I want to set up an initial view matrix that looks down the Z-axis,
 approaching a 2D mode.  I can currently do the effect I want but I have
 to use the mouse to reposition the view. This is not that big a deal but
 would be some help in manipulating the current view frustum. What is the
 best method to call to set this up?

  More context is needed. What kind of camera setup are you using? Do you have a
manipulator attached to it?

 Thanks in advance.
 Keith

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Non-model elements in scenegraph

2009-05-13 Thread Chris 'Xenon' Hanson
Jean-Sébastien Guay wrote:
 const unsigned int NODEMASK_UNPICKABLE = 0x1000;// whatever
 iv-setTraversalMask(~NODEMASK_UNPICKABLE);
 That's how we do it.

  This is what I do too. I have a flag called INTANGIBLE and anything I don't 
want hit
by picking (clouds, etc) is flagged that way.

 J-S

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] osgDB OBJ Plugin

2009-05-13 Thread Chris 'Xenon' Hanson
Robert Youngren wrote:
 This does, technically, work.  However, in the final, merged, .obj file I've 
 lost what I specified for mtllib, usemtl and the group g names  It 
 looks like all those have been auto generated?  Am I missing something?  I 
 know there is the ability for osgDB.readNodeFiles and osgDB.writeNodeFiles to 
 take other command line parameters?  So should I be specifying some?  Help!  
 Any guidance would be appreciated!

  AFAIK, OSG doesn't need those names and structure for rendering, so they are 
discarded
during load.

  Maybe if you explain what your goal is in merging them, we can offer a better 
suggestion.

 Thank you!
 Cheers,
 Robert

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] View-dependent texture

2009-05-13 Thread Chris 'Xenon' Hanson
zhu liangxiong wrote:
 Hi all,
 I have a shapefile which contains about 6000 polygons, And i have an ive
 terrain file as well. how can i make those polygons to be 3D surfaces
 close to the terrain?

  And possibly look into osgGIS as well.

http://osggis.org

 sincerely
 zhu liangxiong

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Non-model elements in scenegraph

2009-05-13 Thread Martin Beckett

Skylark wrote:
 
 Why not just devote a bit in the nodemask for such elements? Then you 
 set the intersection visitor's traversal mask to ignore those elements.
 
 That's how we do it.

That seems to make most sense.

Thanks
Martin

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





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


Re: [osg-users] osgOcean release

2009-05-13 Thread Chris 'Xenon' Hanson
Jean-Sébastien Guay wrote:
 Yes, that's one of the tested libraries in the FFTW benchmark:
 http://www.fftw.org/speed/CoreDuo-3.0GHz-icc/
 http://www.fftw.org/benchfft/ffts.html

See also:

http://cr.yp.to/djbfft.html
http://cr.yp.to/djbfft/bench-notes.html

  Old, but at one time was faster than FFTW. And free.

 J-S

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Is osggis updated? Re: shp file and ive file

2009-05-13 Thread Alejandro Aguilar Sierra
It helps, it apparently finishes the task. Then I run osggis_mapper
and it dies noisily, droping a lot of hardware info:

[osgGIS] Loading map default
[osgGIS] Opened feature store at
source/boston-buildings-downtown-utm19n-meters.shp
   Extent = (326354.28860, 4687724.18966 = 332731.03306, 4693913.93281)
   SRS = PROJCS[UTM Zone 19, Northern Hemisphere,GEOGCS[Geographic
Coordinate System,DATUM[NAD83,SPHEROID[GRS
1980,6378137,298.2572220960423]],PRIMEM[Greenwich,0],UNIT[degree,0.0174532925199433]],PROJECTION[Transverse_Mercator],PARAMETER[latitude_of_origin,0],PARAMETER[central_meridian,-69],PARAMETER[scale_factor,0.9996],PARAMETER[false_easting,50],PARAMETER[false_northing,0],UNIT[Meter,1]]
[...]
4a000-b7f4c000 rwxp  00:0d 1232   /dev/zero
b7f4c000-b7f4e000 rw-p b7f4c000 00:00 0
b7f4e000-b7f4f000 r-xp b7f4e000 00:00 0  [vdso]
b7f4f000-b7f6b000 r-xp  08:04 150996684  /lib/ld-2.9.so
b7f6b000-b7f6c000 r--p 0001b000 08:04 150996684  /lib/ld-2.9.so
b7f6c000-b7f6d000 rw-p 0001c000 08:04 150996684  /lib/ld-2.9.so
bfb57000-bfb6b000 rwxp bffeb000 00:00 0  [stack]
bfb6b000-bfb6c000 rw-p b000 00:00 0
Aborted


Any hint?

-- A.



2009/5/8 Glenn Waldron gwald...@gmail.com:
 Try using the --threads 1 option and see if that helps.

 osggis_build --threads 1 project.xml


 Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
 +1.703.652.4791


 2009/5/8 Alejandro Aguilar Sierra algsie...@gmail.com

 Hi Jason,

 When I run osggis_build, it get stuck at some point. Sometimes at 37%,
 some others at 46% or 81%. I could left it running for hours and never
 go further.

 ...
 [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y5.ive:
 started
 [osgGIS] 38/49 tasks (77%) complete, 00:00:00 remaining
 [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y6.ive:
 started
 [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y6.ive:
 completed, time = 6e-06s
 [osgGIS] 39/49 tasks (79%) complete, 00:00:00 remaining
 [osgGIS] 0 out/buildings/gL0_X4_Y3.ive: completed, time = 2.62004s
 [osgGIS] 40/49 tasks (81%) complete, 00:00:00 remaining


 -- A.

 2009/5/8 Jason Beverage jasonbever...@gmail.com:
  Hi Alejandro,
 
  When you say it gets stuck, does it get stuck building the VPB database
  or
  does it get stuck when you try to run the osggis_build?
 
  Jason
 
  2009/5/8 Alejandro Aguilar Sierra algsie...@gmail.com
 
  Hi,
 
  Good to know, but recently I tried to compile osggis with the current
  OSG and VPB branches. It compiles without a problem, but the example
  doesn't work. It is stucked building the example.
 
  Does anybody has been successful building the example?
 
  Regards,
 
  -- A.
 
 
  2009/5/8 Jason Beverage jasonbever...@gmail.com:
   Hi Andrew,
  
   I would recommend using osgGIS for this.  It has the capability to
   make
   a
   paged database from a vector dataset like a shapefile and clamp it to
   an
   existing terrain database (like an IVE).
  
http://www.osggis.org
  
   Thanks!
  
   Jason
  
   2009/5/8 Jakob Ruhe jakob.r...@gmail.com
  
   Hi Andrewxie!
  
   The ESRIShapeReaderWriter plugin can read ESRI shape files so if you
   build that plugin and the ive plugin you can convert a shape file
   with
   something like this:
  
   osg::Node* node = osgDB::readNodeFile(myshape.shp);
   osgDB::writerNodeFile(*node, myhsape.ive);
  
   Good luck!
  
   /Jakob Ruhe
  
   2009/5/8 Andrewxie rongyao...@163.com:
Hi,
how to clamp a shp file onto a ive file?
   
--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=11667#11667
   
   
   
   
   
___
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 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 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 mailing list
 osg-users@lists.openscenegraph.org
 

[osg-users] Multiple ClearNodes in a scene, or 2D layering of 3D geometry

2009-05-13 Thread Chris 'Xenon' Hanson
[Resending because the copy I sent from GMail earlier hasn't shown up... 
Apologies if it
does and dupes. ]



Paul Martz and I have discussed this this afternoon, and I think that
I'm pursuing a dead end with this technique, but I thought I'd throw
it out there in case anyone sees an easy hack for it before I throw it
out and try the more complex option.

The scene:
Two pieces of geometry in the scene, objects A and B. Both are 3D and
need z-buffering in order to render properly.

The Goal: Render both of them, but with object A _always_ obscured by
object B, regardless of what their Z values (which are mostly
coincident) would normally dictate.

The Constraints:
I'd rather avoid Render To Texture and tricks like that if possible.
I'd like this to be a technique that I can store in a .osg file and
have work self-contained (so it can be moved between computers with
various different versions of OSG 2.8+).

The Theory:
So, my aim was to clear the RGBZ buffers, render object A (with normal
Z test), then clear just the Z buffer and render object B (also with
normal Z test), resulting in B always overwriting A's pixels. It's
pretty simple in basic OpenGL. But structuring a .OSG file to recreate
this effect seems tricky.

The Technique:
I figured maybe I could get away with putting A into the root of the
Scene Graph, and B underneath a ClearNode with only Z clear enabled
and with its StateSet's RenderBin set to render later. ClearNode and
StateSet both are well represented in a .OSG file.

The Code: (insert in place of viewer.setSceneData() in osgviewer.cpp
for testing)

{ // test code
   osg::ref_ptrosg::Group magicZGroup = new osg::Group;
   osg::ref_ptrosg::Node ObjectA = osgDB::readNodeFile(ObjectA.osg);
   osg::ref_ptrosg::Node ObjectB = osgDB::readNodeFile(ObjectB.osg);
   osg::ref_ptrosg::ClearNode magicZClear = new osg::ClearNode;

   // This RenderBin number (1) must be later than default (0, which
ObjectA currently uses)
   // (or change RenderBin of ObjectA to be earlier than default:0)
   // set ClearNode's StateSet to utilize this RenderBin
magicZClear-getOrCreateStateSet()-setRenderBinDetails(1,RenderBin);

   // this clears the Z buffer before drawing children of this group
   magicZClear-setClearMask(GL_DEPTH_BUFFER_BIT);

   magicZGroup-addChild(ObjectA.get());
   magicZGroup-addChild(magicZClear.get());
   magicZClear-addChild(ObjectB.get());

   viewer.setSceneData( magicZGroup.get());
   } // end test code

The Problem:
Besides the fact it gives trippy trails (because nobody ever clears
undrawn parts of the screen), it looks like the Z-Clear operation is
actually done at the beginning of the Scene draw, not at the start of
drawing the children of the ClearNode. So, the ClearNode children
inherit a z-buffer that still has ObjectA's Z values in it.

Paul told me it wouldn't work (you can now say I told you so!), but
I wanted to try it because it's cleaner than the obvious alternative,
which is to use RenderStages (which have clearing capability built
into them). Paul suggested using multiple Camera objects in the Scene
and playing with the heirarchy, reference frame and identity matrix to
make a sub-camera track its parent. I am going to dive into this and
try it next, but I figured I'd see if ClearNode was clearly out first.

Interested in any feedback about the ClearNode tactic, or the
RenderStage/Camera alternative. I'll summarize whatever I find to
work.
-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Hide mouse pointer and set mouse pointer position

2009-05-13 Thread Paul
Hi,
Im creating a music application using osg, i wish to hide and show the mouse 
pointer and set its position so when I click on a knob or volume level fader 
the pointer disapears during the drag and reaperars in the same position as 
before the drag.

Any ideas?
Im saving the mouse position before the drag with:


Code:

case(osgGA::GUIEventAdapter::PUSH):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view)
{
mouseDown = true;
mouseResetX = ea.getX();
mouseResetY = ea.getY();
// somehow hide the mouse pointer here!!
}

return false;
}



I need a way to hide the mouse in the above code
and show the mouse and set its position in the code below.


Code:
case(osgGA::GUIEventAdapter::RELEASE):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view)
{
// somehow show the mouse pointer and set its position here!!
}

return false;
}


... 

Thank you!

Cheers,
Paul

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





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


Re: [osg-users] Hide mouse pointer and set mouse pointer position

2009-05-13 Thread Chris 'Xenon' Hanson
Paul wrote:
 Hi,
 Im creating a music application using osg, i wish to hide and show the mouse 
 pointer and set its position so when I click on a knob or volume level fader 
 the pointer disapears during the drag and reaperars in the same position as 
 before the drag.
 Any ideas?

  You don't say what OS you're on.

  You can show/hide the cursor with osgViewer's GraphicsWindow::setCursor() and 
request it
be repositioned with GraphicsWindow::requestWarpPointer().

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Hide mouse pointer and set mouse pointer position

2009-05-13 Thread Paul
Hi,
Im creating a music application using osg, i wish to hide and show the mouse 
pointer and set its position so when I click on a knob or volume level fader 
the pointer disapears during the drag and reaperars in the same position as 
before the drag.

Any ideas?
Im saving the mouse position before the drag with:


Code:

case(osgGA::GUIEventAdapter::PUSH):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view)
{
mouseDown = true;
mouseResetX = ea.getX();
mouseResetY = ea.getY();
// somehow hide the mouse pointer here!!
}

return false;
}



I need a way to hide the mouse in the above code
and show the mouse and set its position in the code below.


Code:
case(osgGA::GUIEventAdapter::RELEASE):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view)
{
// somehow show the mouse pointer and set its position here!!
}

return false;
}


... 

Heres a screenshot of the chrome  look 3D GUI system ive created so far using 
osg. Dragging the mouse around, the reflections look quite impressive.

[Image: http://img401.imageshack.us/img401/8212/pichbu.jpg ]

Thank you!

Cheers,
Paul

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





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


Re: [osg-users] Hide mouse pointer and set mouse pointer position

2009-05-13 Thread Paul
Im on windows but hope to do linux and mac too one day.

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





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


Re: [osg-users] Visual Studio Setup Woes

2009-05-13 Thread Dwight House
Thanks for the info Skylark. I got it working today and made a blog post about 
the process in extremely simplified terms:
http://dwightdesign.com/2009/05/installing-openscenegraph-280/

I've added a link to this tutorial on the tutorial originally giving me 
problems, so hopefully it will help others in the future.

I actually do know about computer graphics and programming. I'm mainly using 
OSG so that I can avoid building my own OO wrapper for OpenGL (again, mine 
wasn't very robust) and have built-in model loading to speed up my development 
time. I've done a fair amount of graphics work in an academic setting, but I've 
never worked with a large open source project designed for Unix systems. That's 
why I understood some of what was going on, but not all of it.

I imagine most of my questions from now on will be related to how to use OSG 
libraries in terms of what functions to use to get the desired result.

Thanks for your help everyone!


Skylark wrote:
 Helo Dwight,
 
 
  However, as I suspected, one can develop using the precompiled binaries. My 
  only problem is that I don't know how to do that. At least not with a 
  project this large. One library maybe, but OSG is huge. 
  
 
 Well, there are two parts to your question: how do I use OSG (i.e. what 
 settings do I have to use in my project to be able to compile something 
 using OSG) and how do I use OSG (i.e. how do I learn the API and use it 
 to make something).
 
 -
 The first part is actually the same as for any other library.
 
 1. Set the include paths to point to the OSG include directory.
 2. Set the library path to point to the OSG lib directory.
 3. Add the necessary libraries to the linker settings.
 4. Make sure your path contains the necessary directories so that 
 dynamic libraries are found at run time.
 
 That's also the same thing you'd do on Linux or Mac OS X. C++ 
 development is more or less the same on any platform, it's just the 
 tools that change.
 
 For 1, you'll find that in the project settings under C/C++ - General - 
 Additional Include Directories.
 
 For 2, you'll find that in the project settings under Linker - General - 
 Additional Library Directories.
 
 For 3, you'll find that in the project settings under Linker - Input - 
 Additional Dependencies. Now, the hard part is figuring out what 
 libraries you need. The basic set would likely be osg.lib, osgUtil.lib, 
 osgDB.lib, osgViewer.lib, osgGA.lib, osgText.lib (add a 'd' to each in 
 your Debug project's settings). After that, if you get any linker 
 errors, examine the error and you'll figure out which library you need 
 to add (for example, if it says it has an unresolved symbol 
 osgAnimation::Something::doSomething(), you need osgAnimation.lib).
 
 For 4, you have a few options. You can add your OSG install's bin 
 directory to your system PATH variable. Or in your project settings 
 under Debugging - Environment, you can put PATH=$(OSG_BIN_PATH) (and 
 make sure Merge Environment is set to Yes) and that will add the OSG bin 
 path to your PATH when you run your app under the Visual Studio debugger 
 (but leave the system PATH untouched, which is useful in case some other 
 app needs another version of OSG for example). Or you can put the OSG 
 DLLs directly in the same directory as your application's executable 
 (search the archives if you want to do this, there are a few gotchas for 
 this method to work well).
 
 Number 4 under Linux is a separate environment variable called 
 LD_LIBRARY_PATH, but on Windows it's all just the PATH. It's used for 
 both executables and dynamic libraries.
 
 I generally set up the settings for both the debug and release 
 configurations right at the start so that I know I can readily switch 
 from one to the other without problems. The only things that change 
 between the two - apart from default settings that VS sets differently - 
 are the 'd' suffix to library names and _DEBUG instead of NDEBUG in the 
 debug configuration.
 
 I also normally start with a copy of 
 OSG_sources/applications/osgviewer/osgviewer.cpp , and if that 
 compiles and runs in both debug and release, I know I've got the include 
 and linker settings right. From there I modify the code and add new 
 files as I see fit for my project.
 
 If you need any more in-depth info about what libraries are, what such 
 and such a setting does, etc, just Google it and you'll find out. A big 
 part of learning your tools is experimenting and finding out things by 
 doing.
 
 -
 The second part, how do I learn to use the OSG API, is a very common 
 question here. I'll give you some useful links while I discuss this...
 
 First, you can search the archives (I like to use 
 http://dir.gmane.org/gmane.comp.graphics.openscenegraph.user but there 
 are other sources) to see what was suggested in other discussions. 
 Search for documentation or learning and you'll probably  get 
 interesting results.
 
 Second, 

Re: [osg-users] Is osggis updated? Re: shp file and ive file

2009-05-13 Thread Glenn Waldron
No clue. Can you run in debug and produce a stack trace?


Glenn Waldron : Pelican Mapping


2009/5/13 Alejandro Aguilar Sierra algsie...@gmail.com

 It helps, it apparently finishes the task. Then I run osggis_mapper
 and it dies noisily, droping a lot of hardware info:

 [osgGIS] Loading map default
 [osgGIS] Opened feature store at
 source/boston-buildings-downtown-utm19n-meters.shp
   Extent = (326354.28860, 4687724.18966 = 332731.03306, 4693913.93281)
   SRS = PROJCS[UTM Zone 19, Northern Hemisphere,GEOGCS[Geographic
 Coordinate System,DATUM[NAD83,SPHEROID[GRS

 1980,6378137,298.2572220960423]],PRIMEM[Greenwich,0],UNIT[degree,0.0174532925199433]],PROJECTION[Transverse_Mercator],PARAMETER[latitude_of_origin,0],PARAMETER[central_meridian,-69],PARAMETER[scale_factor,0.9996],PARAMETER[false_easting,50],PARAMETER[false_northing,0],UNIT[Meter,1]]
 [...]
 4a000-b7f4c000 rwxp  00:0d 1232   /dev/zero
 b7f4c000-b7f4e000 rw-p b7f4c000 00:00 0
 b7f4e000-b7f4f000 r-xp b7f4e000 00:00 0  [vdso]
 b7f4f000-b7f6b000 r-xp  08:04 150996684  /lib/ld-2.9.so
 b7f6b000-b7f6c000 r--p 0001b000 08:04 150996684  /lib/ld-2.9.so
 b7f6c000-b7f6d000 rw-p 0001c000 08:04 150996684  /lib/ld-2.9.so
 bfb57000-bfb6b000 rwxp bffeb000 00:00 0  [stack]
 bfb6b000-bfb6c000 rw-p b000 00:00 0
 Aborted


 Any hint?

 -- A.



 2009/5/8 Glenn Waldron gwald...@gmail.com:
  Try using the --threads 1 option and see if that helps.
 
  osggis_build --threads 1 project.xml
 
 
  Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
  +1.703.652.4791
 
 
  2009/5/8 Alejandro Aguilar Sierra algsie...@gmail.com
 
  Hi Jason,
 
  When I run osggis_build, it get stuck at some point. Sometimes at 37%,
  some others at 46% or 81%. I could left it running for hours and never
  go further.
 
  ...
  [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y5.ive:
  started
  [osgGIS] 38/49 tasks (77%) complete, 00:00:00 remaining
  [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y6.ive:
  started
  [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y6.ive:
  completed, time = 6e-06s
  [osgGIS] 39/49 tasks (79%) complete, 00:00:00 remaining
  [osgGIS] 0 out/buildings/gL0_X4_Y3.ive: completed, time = 2.62004s
  [osgGIS] 40/49 tasks (81%) complete, 00:00:00 remaining
 
 
  -- A.
 
  2009/5/8 Jason Beverage jasonbever...@gmail.com:
   Hi Alejandro,
  
   When you say it gets stuck, does it get stuck building the VPB
 database
   or
   does it get stuck when you try to run the osggis_build?
  
   Jason
  
   2009/5/8 Alejandro Aguilar Sierra algsie...@gmail.com
  
   Hi,
  
   Good to know, but recently I tried to compile osggis with the current
   OSG and VPB branches. It compiles without a problem, but the example
   doesn't work. It is stucked building the example.
  
   Does anybody has been successful building the example?
  
   Regards,
  
   -- A.
  
  
   2009/5/8 Jason Beverage jasonbever...@gmail.com:
Hi Andrew,
   
I would recommend using osgGIS for this.  It has the capability to
make
a
paged database from a vector dataset like a shapefile and clamp it
 to
an
existing terrain database (like an IVE).
   
 http://www.osggis.org
   
Thanks!
   
Jason
   
2009/5/8 Jakob Ruhe jakob.r...@gmail.com
   
Hi Andrewxie!
   
The ESRIShapeReaderWriter plugin can read ESRI shape files so if
 you
build that plugin and the ive plugin you can convert a shape file
with
something like this:
   
osg::Node* node = osgDB::readNodeFile(myshape.shp);
osgDB::writerNodeFile(*node, myhsape.ive);
   
Good luck!
   
/Jakob Ruhe
   
2009/5/8 Andrewxie rongyao...@163.com:
 Hi,
 how to clamp a shp file onto a ive file?

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





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

[osg-users] VPB troubleshooting wiki page

2009-05-13 Thread Chris 'Xenon' Hanson
I've created a new wiki page for Virtual Planet Builder troubleshooting, since 
it seems to
be a common problem-spot:

http://www.openscenegraph.org/projects/VirtualPlanetBuilder/wiki/TroubleshootingTips

I've added the few things I can think of or that have burned me before. Please 
stop by and
try to recall any problems you might have already solved, so the next guy won't 
have to
suffer the same way.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Is osggis updated? Re: shp file and ive file

2009-05-13 Thread Jason Beverage
Hi Alejandro,

I just tried the latest osgGIS against OSG 2.8.0 on Linux and get segfaults
as well.  I'm doing a debug build of OSG and osgGIS to hopefully track down
what is going on.  Ill probably get to it sometime tommorow.

Thanks!

Jason

2009/5/13 Glenn Waldron gwald...@gmail.com

 No clue. Can you run in debug and produce a stack trace?


 Glenn Waldron : Pelican Mapping


 2009/5/13 Alejandro Aguilar Sierra algsie...@gmail.com

 It helps, it apparently finishes the task. Then I run osggis_mapper
 and it dies noisily, droping a lot of hardware info:

 [osgGIS] Loading map default
 [osgGIS] Opened feature store at
 source/boston-buildings-downtown-utm19n-meters.shp
   Extent = (326354.28860, 4687724.18966 = 332731.03306, 4693913.93281)
   SRS = PROJCS[UTM Zone 19, Northern Hemisphere,GEOGCS[Geographic
 Coordinate System,DATUM[NAD83,SPHEROID[GRS

 1980,6378137,298.2572220960423]],PRIMEM[Greenwich,0],UNIT[degree,0.0174532925199433]],PROJECTION[Transverse_Mercator],PARAMETER[latitude_of_origin,0],PARAMETER[central_meridian,-69],PARAMETER[scale_factor,0.9996],PARAMETER[false_easting,50],PARAMETER[false_northing,0],UNIT[Meter,1]]
 [...]
 4a000-b7f4c000 rwxp  00:0d 1232   /dev/zero
 b7f4c000-b7f4e000 rw-p b7f4c000 00:00 0
 b7f4e000-b7f4f000 r-xp b7f4e000 00:00 0  [vdso]
 b7f4f000-b7f6b000 r-xp  08:04 150996684  /lib/ld-2.9.so
 b7f6b000-b7f6c000 r--p 0001b000 08:04 150996684  /lib/ld-2.9.so
 b7f6c000-b7f6d000 rw-p 0001c000 08:04 150996684  /lib/ld-2.9.so
 bfb57000-bfb6b000 rwxp bffeb000 00:00 0  [stack]
 bfb6b000-bfb6c000 rw-p b000 00:00 0
 Aborted


 Any hint?

 -- A.



 2009/5/8 Glenn Waldron gwald...@gmail.com:
  Try using the --threads 1 option and see if that helps.
 
  osggis_build --threads 1 project.xml
 
 
  Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
  +1.703.652.4791
 
 
  2009/5/8 Alejandro Aguilar Sierra algsie...@gmail.com
 
  Hi Jason,
 
  When I run osggis_build, it get stuck at some point. Sometimes at 37%,
  some others at 46% or 81%. I could left it running for hours and never
  go further.
 
  ...
  [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y5.ive:
  started
  [osgGIS] 38/49 tasks (77%) complete, 00:00:00 remaining
  [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y6.ive:
  started
  [osgGIS] 1 /home/ale/3d/gis/boston-sample/out/buildings/gL0_X6_Y6.ive:
  completed, time = 6e-06s
  [osgGIS] 39/49 tasks (79%) complete, 00:00:00 remaining
  [osgGIS] 0 out/buildings/gL0_X4_Y3.ive: completed, time = 2.62004s
  [osgGIS] 40/49 tasks (81%) complete, 00:00:00 remaining
 
 
  -- A.
 
  2009/5/8 Jason Beverage jasonbever...@gmail.com:
   Hi Alejandro,
  
   When you say it gets stuck, does it get stuck building the VPB
 database
   or
   does it get stuck when you try to run the osggis_build?
  
   Jason
  
   2009/5/8 Alejandro Aguilar Sierra algsie...@gmail.com
  
   Hi,
  
   Good to know, but recently I tried to compile osggis with the
 current
   OSG and VPB branches. It compiles without a problem, but the example
   doesn't work. It is stucked building the example.
  
   Does anybody has been successful building the example?
  
   Regards,
  
   -- A.
  
  
   2009/5/8 Jason Beverage jasonbever...@gmail.com:
Hi Andrew,
   
I would recommend using osgGIS for this.  It has the capability to
make
a
paged database from a vector dataset like a shapefile and clamp it
 to
an
existing terrain database (like an IVE).
   
 http://www.osggis.org
   
Thanks!
   
Jason
   
2009/5/8 Jakob Ruhe jakob.r...@gmail.com
   
Hi Andrewxie!
   
The ESRIShapeReaderWriter plugin can read ESRI shape files so if
 you
build that plugin and the ive plugin you can convert a shape file
with
something like this:
   
osg::Node* node = osgDB::readNodeFile(myshape.shp);
osgDB::writerNodeFile(*node, myhsape.ive);
   
Good luck!
   
/Jakob Ruhe
   
2009/5/8 Andrewxie rongyao...@163.com:
 Hi,
 how to clamp a shp file onto a ive file?

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





 ___
 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 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
  
  
 

Re: [osg-users] Change cursor with object under mouse

2009-05-13 Thread Paul Speed
Admittedly, I don't know exactly how you are setting up your window in 
Java... but why not use Java to set the cursor?


That's what we did.
-Paul

Romain Charbit wrote:

Hi,

Thanks for the answer,  that's what I was afraid of. But in fact, the graphic 
context of the app that I'am working on is made by Java, so I need this 
GraphicsWindowEmbedded. I'am gonna do it in another way :D

Thank you!

Cheers,
Romain


Romain Charbit

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





___
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] projection matrix and modelview matrix in osg

2009-05-13 Thread Dongpyo Hong

Hi,

Using osgViewer, I wanted to setup projection matrix
and modelview matrix by using intrinsic and extrinsic
parameter of a camera (which is not osg camera, but
actual camera).

My problem is that I want to rotate and translate a model
by using a matrix form (+z-axis is inward screen, i.e., opposite to  
opengl),
so simply changing translation vector in the matrix by the negation  
(i.e., -z) didn't

work because translation was fine at least z-axis but rotation was not.

I tested the same projection matrix and modelview matrix in OpenGL  
which was working.

But not in osg or osgViewer.

Any idea? or explanation?

Cheers,
Dongpyo

Dongpyo Hong
Research Assistant
GIST U-VR Lab.
http://uvr.gist.ac.kr
http://uvr.gist.ac.kr/~dhong
Tel. +82-62-970-3157
Fax. +82-62-970-2204
Email. dh...@gist.ac.kr
dongpyo.h...@gmail.com








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


Re: [osg-users] Taking it easy for a couple of days

2009-05-13 Thread Paul Speed
If you ever need a quick breather to clear your head... drink 
pineapple juice.  Something in it cuts through the crud but it doesn't 
last long.


...sometimes it's just enough to keep one sane, though. :)

-Paul

Robert Osfield wrote:

HI All,

Thanks to all that have posted for the good will.

It's only a head cold, I might feel pretty grotty, but it's nothing
that a few days of taking it easy won't cure, even with and
underwhelming male immune system ;-)

Cheers,
Robert.
___
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] removal of OSG specific environment variables from find modules

2009-05-13 Thread Philip Lowman
Hi all,

Does anyone depend on the OSG_ROOT, OSGDIR, and OSG_DIR environment and/or
registry session variables in the non-OSG related CMake find modules in
CMakeModules?
Are there any objections to removing these variables?

FindCOLLADA.cmake
FindFFmpeg.cmake
FindFLTK.cmake
etc.

If you have the old OSG 2.2/2.4 binary package installed, these find modules
end up detecting libraries within C:\Program Files\OpenSceneGraph.  This is
rather annoying when configuring a MinGW build and could cause weird errors
on newer builds of the OSG as well as dependencies, compilers, etc. are
updated.

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