Re: [osg-users] problems with new version OSG 2.6.0

2008-07-28 Thread GMD GammerMaxyandex.ru
Ok, I'll make small example and show where problem occures. I'll try do this 
today.

28.07.08, 00:33, sherman wilcox [EMAIL PROTECTED]:

 Can you make a small and simple prototype that *reliably* reproduces
 the problem? You have a better chance of getting help that way.
 On Sun, Jul 27, 2008 at 2:50 AM, GMD GammerMaxyandex.ru
 [EMAIL PROTECTED] wrote:
  Some offers of OSG 2.6.0( problems with new version).
  Let's wait with OSG 2.6.0 release.  I asked this because I found a problem 
  with osgUtil::LineSegmentIntersector function.
  In OSG v 2.5.5 version of OSG function viewer-computeIntersections(x,y, 
  hlist) works very strange - when cursor movements over object is short 
  it(cursor) falls throught the object and function returns name of object 
  which is behind current(object over which cursor is). In earlyer(less 
  2.5.2) versions of OSG this error has never appeared. How can I solve this 
  problem in this(2.5.5) version of OSG?
  It is necessary to solve the problem until  OSG 2.6.0 release.
  Thanks in advance.  Best regards, Max.
  ___
  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

-- 
Зал славы: все победители конкурсов на Яндекс.Фотках 
http://fotki.yandex.ru/contests.xml
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to scale rotations ?

2008-07-28 Thread J.P. Delport

Hi,

I normally like to think about the heading, attitude and bank as just 
rotations about certain axes. In osg you can make a quat using e.g.:


// angles in radians, yaw, pitch, roll
double y,p,r;

osg::Quat ori = osg::Quat(r, osg::Vec3(1,0,0),
  p, osg::Vec3(0,1,0),
  y, osg::Vec3(0,0,1));

Change the order/axes for your app. Try to do all the scaling using 
quats. Either by multiplying them together, or changing the r,p,y values 
in the code above.


jp

Janusz wrote:

Dear all:

Appreciate any answer on the topic:

I am reading an orientation / rotation matrix info from a sensor, then 
visualizing the rotation of an object on screen with OSG. Given the 
matrix or the resulting quaternion I need to be able to scale the 
rotations independently, i.e.


heading_scale*heading_angle, heading_scale=0,1
attitude_scale*attitude_angle
bank_scale*bank_angle

in order to be able to control them on its own or restrict the rotation 
to one angle only.


I have written 2 functions. The first one converts a quaternion to the 
Euler angles, the other one does the opposite. In between the calls to 
the functions I am trying to scale the rotations or switch them on/off 
as needed.


The results are not quite good, however, and I often get trapped in the 
famous gimbal lock as probably expected. :-)


Q: Is there any other possibility to handle rotations on its own? Is 
there a way to do that without running the conversion, scaling, then 
converting back to quat ?


All I have is the rotation matrix.

Appreciate any answer/advice or pointing me in the right direction.

Best regards,
Janusz Goldasz

--
void getEulerFromQuat(osg::Quat q, double heading, double attitude, 
double bank)

{
   double sqx = q.x()*q.x(); double sqy = q.y()*q.y(); double 
sqz = q.z()*q.z();


   double t = q.x()*q.y() + q.z()*q.w();
   if (t0.4)
   {
   heading = 2 * atan2(q.x(),q.w());
   attitude = osg::PI_2;
   bank = 0;
   }
   else if (t-0.4)
   {
   heading = -2 * atan2(q.x(),q.w());
   attitude = - osg::PI_2;
   bank = 0;
   }
   else
   {
   heading = atan2(2*q.y()*q.w()-2*q.x()*q.z() , 1 - 2*sqy - 2*sqz);
   attitude = asin(2*t);
   bank = atan2(2*q.x()*q.w()-2*q.y()*q.z() , 1 - 2*sqx - 2*sqz);
   }
}




void getQuatFromEuler(double heading, double attitude, double bank, 
osg::Quat q)

{
   double c1 = cos(heading/2); double s1 = sin(heading/2); 
double c2 = cos(attitude/2); double s2 = sin(attitude/2); double 
c3 = cos(bank/2); double s3 = sin(bank/2);

   double c1c2 = c1*c2;double s1s2 = s1*s2;

   double w =c1c2*c3 - s1s2*s3;
   double x =c1c2*s3 + s1s2*c3;
   double y =s1*c2*c3 + c1*s2*s3;
   double z =c1*s2*c3 - s1*c2*s3;

   q[0] = x; q[1] = y;
   q[2] = z; q[3] = w;
}

___
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] Defining Local Coordinate Center For Every Node

2008-07-28 Thread Alberto Luaces
Hi Ümit,

the best way is to have a correct model from the beginning, centered and 
aligned with the origin, but if it couldn't be done, you would have to make 
the geometry child of a transform that would put the mesh at the right place. 
Say you had an object displaced 4 units on the X axis from the origin, then 
you would create a translation transform of (-4,0,0) and make it parent of 
the mesh. Finally you would use that transform in the scene as the real 
object.

Alberto

El Viernes 25 Julio 2008ES 09:59:59 Ümit Uzun escribió:
 Hi all,

 Firstly sorry for simple question, but I can't find related topics on the
 web.

 How can I change my models's center coordinate? I have lots of components,
 I am trying to collect them in one model, and I want to control one part in
 it's local coordinate (for example I want to rotate it around z axes on
 it's local coordinate.)

 But my components default coordinate center is different one by one (for
 example: osgviewer sample.osg axes.osg result is
 http://img61.imageshack.us/my.php?image=sampletn4.png ). I mean, I want to
 control every part of components in their local coordinate center. What
 should I do for changing coordinate system and center for every components?
 I used MatrixTransform, PositionAttitudeTransform CoordinateSystemNode but
 I can't get success.

 Thanks, Best Regards.

 Umit UZUN


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


Re: [osg-users] Getting texture coordinates and normals of each vertex of a loaded model

2008-07-28 Thread Alberto Luaces
Hi Franclin,

The references to the vertices that osg::TriangleFunctor returns point to the 
real data of the geometry, so if you subtract their pointers to the first 
vertex pointer of the geometry, you'll get the index to that vertex and you 
will be able to get its normal and UV coordinates:

Vec3 myvertex; // From the TriangleFunctor, we want to have its normal and UV

int index = (Mygeometry-getVertexArray[0])- myvertex;
Vec3 normal = Mygeometry-getNormalArray[index];
Vec2 uv = (Mygeometry-getTexCoordArray(0))[index];

Alberto

El Domingo 27 Julio 2008ES 11:50:13 Franclin Foping escribió:
 Dear All,
  Is there any algorithm in OSG to compute normals and texture coordinates
 of each vertex of a loaded model? With the osg::TriangleFunctor and
 osg::TriangleIndexFunctor, I can perfectly find out all triangles making up
 of a given node. However, the (big) issue is to be able to find out normals
 and texture coordinates of each vertex of a loaded model. Any help will be
 appreciated.
  Waiting for your reply.
  Franclin.

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


Re: [osg-users] help me!

2008-07-28 Thread Alberto Luaces
Hi,

Sorry, I have no expertise with 3DSMax and/or osgExp, so I cannot help you 
further. Nevertheless, here is the osgExp code download page address:

http://sourceforge.net/svn/?group_id=148454

I suppose there are compilation instructions within the source.

El Viernes 25 Julio 2008ES 07:00:08 monkeymonkey escribió:
 hi!Thank you for your answer!
 I try it as you say,
 but not right also,i think because Texture Coord output of osgExp is not
 right,they are between 0 and 1,it should be 0 to 3. i change it , it is
 OK!, so it is the really reason.
 I must change osgExp scource code,and recompile it? how to do it?

  From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: Wed,
  23 Jul 2008 09:57:33 +0200 Subject: Re: [osg-users] help me!  Hi, 
  El Miércoles 23 Julio 2008ES 08:48:19 monkeymonkey escribió:  hi!   
   i use Texture UV repeat 3.0 in 3dsMax8,but when i output it to ive,then
  use  osgViewer to look,texture is not right.   it seem that repeat is
  not work! why? osgExp is not surport Texture UV repeat? how to
  make it?  Convert your .ive to .osg with osgconv, then look for the
  wrap parameter in  the file like  wrap_s,t,... REPEAT  If there is
  something other word than REPEAT, change it.  Alberto


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


Re: [osg-users] Optimizer options oddity

2008-07-28 Thread Paul Martz
The code in Optimizer.cpp makes this look like a bug. If the two were
intended to be synonymous, I'd expect they would share the same code. They
don't. I'm betting FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS is
supposed to be 0x1.
   -Paul

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Martz
Sent: Sunday, July 27, 2008 2:57 PM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Optimizer options oddity


Hi Glenn - I haven't looked at the code, but I see this in the ChangeLog:
 

2008-06-20 13:16 + [r8474] robert:
* From Terry Welsh, new flatten static transforms visitor that
duplicates subgraphs that are shared beneath differnt static
transforms From Robert Osfield, made a range of changes to
Terry's visitor integrating it into osgUtil::Optimizer and
changing the code to use a style more like the rest of the OSG.

 
Maybe Terry can shed some light on this, or you could search osg-users for
the week leading up to this change to see if anything was said about it. Or
we can put this on a list of things for Robert to check before tagging 2.6.
   -Paul
 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Glenn
Waldron
Sent: Saturday, July 26, 2008 6:48 PM
To: OpenSceneGraph Users
Subject: [osg-users] Optimizer options oddity


I noticed that two of the OptimizerOptions values, COPY_SHARED_NODES and
FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS, have the same enum
value (0x100). Is this intentional? This is in 2.6 RC1.

Glenn

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


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


Re: [osg-users] Optimizer options oddity

2008-07-28 Thread Glenn Waldron
Agreed. I will go ahead and submit the presumptive fix to osg-submissions.

Thanks Paul -gw

On Mon, Jul 28, 2008 at 9:31 AM, Paul Martz [EMAIL PROTECTED] wrote:

  The code in Optimizer.cpp makes this look like a bug. If the two were
 intended to be synonymous, I'd expect they would share the same code. They
 don't. I'm betting FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS is
 supposed to be 0x1.
-Paul



  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Paul Martz
 *Sent:* Sunday, July 27, 2008 2:57 PM
 *To:* 'OpenSceneGraph Users'
 *Subject:* Re: [osg-users] Optimizer options oddity

  Hi Glenn - I haven't looked at the code, but I see this in the ChangeLog:


 2008-06-20 13:16 + [r8474] robert:
 * From Terry Welsh, new flatten static transforms visitor that
 duplicates subgraphs that are shared beneath differnt static
 transforms From Robert Osfield, made a range of changes to
 Terry's visitor integrating it into osgUtil::Optimizer and
 changing the code to use a style more like the rest of the OSG.


 Maybe Terry can shed some light on this, or you could search osg-users for
 the week leading up to this change to see if anything was said about it. Or
 we can put this on a list of things for Robert to check before tagging 2.6.
-Paul


  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Glenn Waldron
 *Sent:* Saturday, July 26, 2008 6:48 PM
 *To:* OpenSceneGraph Users
 *Subject:* [osg-users] Optimizer options oddity

  I noticed that two of the OptimizerOptions values, COPY_SHARED_NODES and
 FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS, have the same enum
 value (0x100). Is this intentional? This is in 2.6 RC1.

 Glenn

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


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




-- 
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Texturing issues second window

2008-07-28 Thread Scott Angster
Hello-

We are seeing an interesting problem that we can not track down.
Several previous postings have been similar but not quite what we are
seeing.  We are hoping someone can point us in a possible direction to
find a solution.

We have an OSG/QT application using multiple windows with views into the
same scene graph.  We use multiple instances of the Viewer to do this.
We are seeing issues in the second/third/etc window for models loaded in
containing textures.  The textures do not load and we get Warning:
detected OpenGL error 'invalid enumerant' after applying attribute
Texture2D when the second window is opened. 

However if we create an object at runtime, say a sphere, and apply a
texture to it, the second/third/etc window do not have problems with it.
If we save out the node we created to an IVE file and reload it, the
problem is there.

I have tried to duplicate this problem using the osgviewer QT example
such that I have a simpler code base to work with, and I can't.  I have
made this example more complex, adding features to it to replicate our
code (HUD, textured background, our update loop for updating dynamic
transform nodes and camera positioning, our state settings, thread
settings, etc).

We seem to have an issue with PagedLOD too in our application for the
second/third windows.  I hope this issue is related so if we focus on
the texture problem, maybe the other will be solved.

We are using OSG 2.4 and currently QT 3.3 (hope to be moving to 4.X
soon).  We are seeing this on both our Linux and Windows machines.

Thanks for any suggestions or insight into this.

Scott





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


[osg-users] Problem using osg::ColorMatrix

2008-07-28 Thread Rahul Jain
Hi all,
I am trying to use OpenFL color matrix functionality through
osg::ColorMatrix but not able to do so. When i apply this to a node
|(cessna.osg) i do not see any effect. I am pasting the code below for
you guys to have a look.
I don't  know what am i doing wrong in this simple piece of code .
cheers RJ


int main(int argc, char** argv)
{
osg::MatrixTransform* cessnaMT = new osg::MatrixTransform;


osg::Node* cessna = osgDB::readNodeFile(cessna.osg);
cessnaMT-addChild(cessna);

 // Set color matrix
osg::ColorMatrix* colorMatrix = new osg::ColorMatrix;
const osg::Matrix cm (0.15, 0.0, 0.0, 0.0,
  0.0,  0.3, 0.0, 0.0,
  0.05, 0.0, 0.0, 0.0,
  0.0,  0.0, 0.0, 1.0);

colorMatrix-setMatrix(cm);

cessnaMT-getOrCreateStateSet()-setAttributeAndModes(colorMatrix,
 osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);

osgViewer::Viewer viewer;

// add model to viewer.
viewer.setSceneData(cessnaMT);

viewer.run();

return 0;

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


Re: [osg-users] Texturing issues second window

2008-07-28 Thread Serge Lages
Hi Scott,

Have you setted the pager to not unref images after applying them ? When you
have multiple contexts, you have to make sure images are not deleted before
each context has applied it.

On Mon, Jul 28, 2008 at 4:12 PM, Scott Angster [EMAIL PROTECTED]wrote:

 Hello-

 We are seeing an interesting problem that we can not track down.
 Several previous postings have been similar but not quite what we are
 seeing.  We are hoping someone can point us in a possible direction to
 find a solution.

 We have an OSG/QT application using multiple windows with views into the
 same scene graph.  We use multiple instances of the Viewer to do this.
 We are seeing issues in the second/third/etc window for models loaded in
 containing textures.  The textures do not load and we get Warning:
 detected OpenGL error 'invalid enumerant' after applying attribute
 Texture2D when the second window is opened.

 However if we create an object at runtime, say a sphere, and apply a
 texture to it, the second/third/etc window do not have problems with it.
 If we save out the node we created to an IVE file and reload it, the
 problem is there.

 I have tried to duplicate this problem using the osgviewer QT example
 such that I have a simpler code base to work with, and I can't.  I have
 made this example more complex, adding features to it to replicate our
 code (HUD, textured background, our update loop for updating dynamic
 transform nodes and camera positioning, our state settings, thread
 settings, etc).

 We seem to have an issue with PagedLOD too in our application for the
 second/third windows.  I hope this issue is related so if we focus on
 the texture problem, maybe the other will be solved.

 We are using OSG 2.4 and currently QT 3.3 (hope to be moving to 4.X
 soon).  We are seeing this on both our Linux and Windows machines.

 Thanks for any suggestions or insight into this.

 Scott





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




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


Re: [osg-users] Problem using osg::ColorMatrix

2008-07-28 Thread Gordon Tomlinson
Having never used a ColorMatrix in OpenGL or OSG

What effect is this supposed to produce ?

Do you have screen grabs of what it should look like if done in raw Opengl ?
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rahul Jain
Sent: Monday, July 28, 2008 10:40 AM
To: 'OpenSceneGraph Users'
Subject: [osg-users] Problem using osg::ColorMatrix

Hi all,
I am trying to use OpenFL color matrix functionality through
osg::ColorMatrix but not able to do so. When i apply this to a node
|(cessna.osg) i do not see any effect. I am pasting the code below for
you guys to have a look.
I don't  know what am i doing wrong in this simple piece of code .
cheers RJ


int main(int argc, char** argv)
{
osg::MatrixTransform* cessnaMT = new osg::MatrixTransform;


osg::Node* cessna = osgDB::readNodeFile(cessna.osg);
cessnaMT-addChild(cessna);

 // Set color matrix
osg::ColorMatrix* colorMatrix = new osg::ColorMatrix;
const osg::Matrix cm (0.15, 0.0, 0.0, 0.0,
  0.0,  0.3, 0.0, 0.0,
  0.05, 0.0, 0.0, 0.0,
  0.0,  0.0, 0.0, 1.0);

colorMatrix-setMatrix(cm);

cessnaMT-getOrCreateStateSet()-setAttributeAndModes(colorMatrix,
 osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);

osgViewer::Viewer viewer;

// add model to viewer.
viewer.setSceneData(cessnaMT);

viewer.run();

return 0;

}
___
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 viewer-computeIntersections

2008-07-28 Thread Фамилия Имя
Hallo.
I have a problem with function viewer-computeIntersections in OSG 2.6.0. When 
I tryed get objects throught which goes line function lost some of them (but 
line definitely goes throught them). It looks like function can't see some 
objects. I tryed run osgpick with my scene but this error occured there (when i 
clicked in different place of object). I hope this error will be repaired in 
this release of OSG. 
Thanks.

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


Re: [osg-users] Problems with viewer-computeIntersections

2008-07-28 Thread Alberto Luaces
Hi,

El Lunes 28 Julio 2008ES 16:45:19 Фамилия Имя escribió:
 Hallo.
 I have a problem with function viewer-computeIntersections in OSG 2.6.0.
 When I tryed get objects throught which goes line function lost some of
 them (but line definitely goes throught them). It looks like function can't
 see some objects. I tryed run osgpick with my scene but this error occured
 there (when i clicked in different place of object). I hope this error will
 be repaired in this release of OSG. Thanks.

Please see this thread from yesterday:

http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg14304.html
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem using osg::ColorMatrix

2008-07-28 Thread Rahul Jain
Hi Gordon,
Color matrix in OpenGL is used for color space conversion, for example
using color matric you can convert RGB to BGR , RGB to CMY.
Unfortunately i do not have any screen grabs for the moment, but i am
trying to achieve night vision effect using this code ,
RJ

Gordon Tomlinson wrote:
 Having never used a ColorMatrix in OpenGL or OSG

 What effect is this supposed to produce ?

 Do you have screen grabs of what it should look like if done in raw Opengl ?
  

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Rahul Jain
 Sent: Monday, July 28, 2008 10:40 AM
 To: 'OpenSceneGraph Users'
 Subject: [osg-users] Problem using osg::ColorMatrix

 Hi all,
 I am trying to use OpenFL color matrix functionality through
 osg::ColorMatrix but not able to do so. When i apply this to a node
 |(cessna.osg) i do not see any effect. I am pasting the code below for
 you guys to have a look.
 I don't  know what am i doing wrong in this simple piece of code .
 cheers RJ


 int main(int argc, char** argv)
 {
 osg::MatrixTransform* cessnaMT = new osg::MatrixTransform;

 
 osg::Node* cessna = osgDB::readNodeFile(cessna.osg);
 cessnaMT-addChild(cessna);

  // Set color matrix
 osg::ColorMatrix* colorMatrix = new osg::ColorMatrix;
 const osg::Matrix cm (0.15, 0.0, 0.0, 0.0,
   0.0,  0.3, 0.0, 0.0,
   0.05, 0.0, 0.0, 0.0,
   0.0,  0.0, 0.0, 1.0);

 colorMatrix-setMatrix(cm);

 cessnaMT-getOrCreateStateSet()-setAttributeAndModes(colorMatrix,
  osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);

 osgViewer::Viewer viewer;

 // add model to viewer.
 viewer.setSceneData(cessnaMT);

 viewer.run();

 return 0;

 }
 ___
 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] Matrix Manipulators and set coordinate frame callback. Different behavior in 2.4?

2008-07-28 Thread Dorosky, Christopher G
 
Hello all,

Under OSG 1.2, I controlled the orientation of an osgGA manipulator
through the use of a coordinate frame callback.

Under 2.4, I am using the same exact code, but the callback never
happens.

Here is the code snippet. Viewer is osgProducer (yes, still).
This loop runs 4 times.

Viewer-getKeySwitchMatrixManipulator()-setHomePosition(eyeECEF,
centerECEF, upECEF, false);
cECEFFrameCB *cb = new cECEFFrameCB;

for(unsigned int i = 0; i
Viewer-getKeySwitchMatrixManipulator()-getNumMatrixManipulators();
i++)
{
osgGA::MatrixManipulator *mm =
Viewer-getKeySwitchMatrixManipulator()-getMatrixManipulatorWithIndex(i
);
if(mm) 
{
mm-setCoordinateFrameCallback(cb);
mm-setHomePosition(eyeECEF, centerECEF, upECEF,
false);
}
}

Where the ECEFFrameCB is derived from the
osgGA:MatrixManipulator::CoordinateFrameCallback.

I put a print in there, and it is never called.
Has this functionality been disabled?

What I am trying to do is set the up, side, and front vectors so that
the manipulator behaves better.

Thanks,

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


[osg-users] Optimizing for CAD Data

2008-07-28 Thread Todd J. Furlong

Hi folks,

We deal with a lot of CAD data that has been translated to OSG, and I am 
looking into ways to enhance the performance in OSG.


One issue we are facing is that the CAD data is very poorly organized 
with regards to the cull process.  We had hoped that the spatialize 
groups optimization would help us out, but our problem seems to go 
deeper than that.  Depending on the source of our data, we get Geodes 
containing numerous Drawables that are spread throughout the scene (all 
instances of one part under one Geode).  As I understand the spatialize 
optimization, it reorganizes Geodes but doesn't go to the Drawable level.


So, the idea now is to insert Geodes  enforce a rule of one Drawable 
per Geode to give the optimizer a chance to succeed.  Does that sound 
like it would work in our situation?


Assuming the idea makes sense, would it be of value to the community if 
we try to implement this as one of the osgUtil::Optimizer options?  If 
so, would it make sense as an improvement to the spatialize groups 
option, or would it be better as an option unto itself?


-Todd

--
Todd J. Furlong
Inv3rsion, LLC
http://www.inv3rsion.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Optimizing for CAD Data

2008-07-28 Thread Paul Martz
Hi Todd -- I'd think the Geode-per-Drawable might improve cull performance
in your case, as it's faster to cull against bounding spheres than boxes.

I've been working with complex CAD data for over a year and have had good
results with some models by inserting OcclusionQueryNodes at strategic
locations. You might take a look at that.

If you are working with PolyTrans to convert the CAD data, you should email
me offline. I've been developing some tools to ease that process.

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


 
 Hi folks,
 
 We deal with a lot of CAD data that has been translated to 
 OSG, and I am looking into ways to enhance the performance in OSG.
 
 One issue we are facing is that the CAD data is very poorly 
 organized with regards to the cull process.  We had hoped 
 that the spatialize groups optimization would help us out, 
 but our problem seems to go deeper than that.  Depending on 
 the source of our data, we get Geodes containing numerous 
 Drawables that are spread throughout the scene (all instances 
 of one part under one Geode).  As I understand the spatialize 
 optimization, it reorganizes Geodes but doesn't go to the 
 Drawable level.
 
 So, the idea now is to insert Geodes  enforce a rule of one 
 Drawable per Geode to give the optimizer a chance to succeed. 
  Does that sound like it would work in our situation?
 
 Assuming the idea makes sense, would it be of value to the 
 community if we try to implement this as one of the 
 osgUtil::Optimizer options?  If so, would it make sense as an 
 improvement to the spatialize groups 
 option, or would it be better as an option unto itself?
 
 -Todd
 
 --
 Todd J. Furlong
 Inv3rsion, LLC
 http://www.inv3rsion.com
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org

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


Re: [osg-users] problems with new version OSG 2.6.0

2008-07-28 Thread GMD GammerMaxyandex.ru
Here is the small example, where described problem appeares. Example is 
modified example of osgpick (chenged code which returns name of object and osg 
scene). To see this problem you must go in the deep of room (way is showen in 
00.jpeg). Then you need make several clicks in different positions (movements 
bitween positions must be small) and you will see that cursor often falls 
throught the object over which cursor is (possible positions is showen on 
11.jpg). There is two archives in attachement (with textures and without them). 
Code is in osgpick.zip file which taken from example osgpick. I hope this is 
enough to illustrate described problem. And I think it will be not good if this 
error appeares in this release (2.6.0).
Thanks, Max.

files:

(download: enter number, click green button)
http://narod.ru/disk/171128/osgpick.zip.html
http://narod.ru/disk/1711073000/00.JPG.html
http://narod.ru/disk/1711279000/11.JPG.html
http://narod.ru/disk/1712663000/museum_with_textures.zip.html

Thanks, Max.



28.07.08, 10:47, GMD GammerMaxyandex.ru [EMAIL PROTECTED]:

 Ok, I'll make small example and show where problem occures. I'll try do this 
 today.
 28.07.08, 00:33, sherman wilcox [EMAIL PROTECTED]:
  Can you make a small and simple prototype that *reliably* reproduces
  the problem? You have a better chance of getting help that way.
  On Sun, Jul 27, 2008 at 2:50 AM, GMD GammerMaxyandex.ru
  [EMAIL PROTECTED] wrote:
   Some offers of OSG 2.6.0( problems with new version).
   Let's wait with OSG 2.6.0 release.  I asked this because I found a 
   problem with osgUtil::LineSegmentIntersector function.
   In OSG v 2.5.5 version of OSG function viewer-computeIntersections(x,y, 
   hlist) works very strange - when cursor movements over object is short 
   it(cursor) falls throught the object and function returns name of object 
   which is behind current(object over which cursor is). In earlyer(less 
   2.5.2) versions of OSG this error has never appeared. How can I solve 
   this problem in this(2.5.5) version of OSG?
   It is necessary to solve the problem until  OSG 2.6.0 release.
   Thanks in advance.  Best regards, Max.
   ___
   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

-- 
Яндекс.Открытки на все случаи жизни http://cards.yandex.ru/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problems with viewer-computeIntersections

2008-07-28 Thread Paul Martz
(As mentioned in the other discussion thread...) If there is a way to
reproduce this issue with osgpick, please provide explicit steps for
reproduction. Of course if you can debug the issue and submit a fix, that
would be even better.
   -Paul


 
 Hi,
 
 El Lunes 28 Julio 2008ES 16:45:19 Фамилия Имя escribió:
  Hallo.
  I have a problem with function viewer-computeIntersections 
 in OSG 2.6.0.
  When I tryed get objects throught which goes line function 
 lost some 
  of them (but line definitely goes throught them). It looks like 
  function can't see some objects. I tryed run osgpick with 
 my scene but 
  this error occured there (when i clicked in different place of 
  object). I hope this error will be repaired in this release 
 of OSG. Thanks.
 
 Please see this thread from yesterday:
 
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org
/msg14304.html
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org
 

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


Re: [osg-users] vpb on cluster example

2008-07-28 Thread Greg Myers
Hi JP,

I'm new and I'm a little fuzzy on the versioning between VPB and OSG.
It looks like for the example you have provided, we need an older
version (2.3.6) of OSG.  Do you know if there are plans to upgrade VPB
to work with the latest releases of OSG or am I totally missing
something?

Thanks for any info.
Greg



On Jul 23, 5:47 am, J.P. Delport [EMAIL PROTECTED] wrote:
 Hi,



 Robert Osfield wrote:
  Hi J.P.

  Many thanks for putting this guide, sure saves me some time and will
  help others.

  In terms of the work flow, there are couple of things that VPB can
  help out with.

  As you note, vpbmaster doesn't like, or actually does not permit
  building on databases where the source data is in different
  coordinates system, this is due to the fact that the parallel osgdem
  runs would end up doing the reprojection themselves each time, which
  is both a waste of compute resources as well as a threading issue.
  Since vpbmaster has this requirement, we have a another tool that can
  do the reprojection for use - vpbcache.

  The vpbcache app can create a file cache that contains a mapping
  between your original source data and reprojected versions of it.  The
  vpbcache tool allows you to create this file cache, and then to do the
  reprojection that is required for the final build.   vpbcache takes as
  input a source file, typically exactly the same source file that
  vpbmaster run will use.

 OK cool, I was wondering what the whole cache thing was about :)





  So what's this about source files  we'll this is an ascii file
  that wraps up all the source data and build options that will use.
  vpbmaster creates a source file and then passes this on to the slaves
  so they no what to process. You can also get vpbmaster to generate a
  master source file for you.

  The rough process is :

  Step 1:

 run vpbmaster with all your source files and then get it to output
  a build.source file, this run does not run the
 actual build.  Add --so build.source to the command line to output
  the source file.

  Step 2:

 run vpbcache with the build.source file, to create a cache file

  Step 3:

 run vpbcache to reproject the source files into the required
  coordinates system for the build

  Step 4:

 run vpbmaster with the cache file, and the build.source file, and a
  master file describing the layout of
 your cluster

  Step 5:

 Wait :-)

 I must say that the new vpb with --terrain is a _lot_ faster than the
 old osgdem used to be. One can now generate quite a bit of data over a
 weekend :)

 jp



  I'm afraid I don't recall the options off the top of my head...

  Robert.
  ___
  osg-users mailing list
  [EMAIL PROTECTED]
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...

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


Re: [osg-users] help me!

2008-07-28 Thread GMD GammerMaxyandex.ru
 osgExp is not surport Texture UV repeat?
Yes  :( 


28.07.08, 14:43, Alberto Luaces [EMAIL PROTECTED]:

 Hi,
 Sorry, I have no expertise with 3DSMax and/or osgExp, so I cannot help you 
 further. Nevertheless, here is the osgExp code download page address:
 http://sourceforge.net/svn/?group_id=148454
 I suppose there are compilation instructions within the source.
 El Viernes 25 Julio 2008ES 07:00:08 monkeymonkey escribió:
  hi!Thank you for your answer!
  I try it as you say,
  but not right also,i think because Texture Coord output of osgExp is not
  right,they are between 0 and 1,it should be 0 to 3. i change it , it is
  OK!, so it is the really reason.
  I must change osgExp scource code,and recompile it? how to do it?
 
   From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: 
   Wed,
   23 Jul 2008 09:57:33 +0200 Subject: Re: [osg-users] help me!  Hi, 
   El Miércoles 23 Julio 2008ES 08:48:19 monkeymonkey escribió:  hi!   
i use Texture UV repeat 3.0 in 3dsMax8,but when i output it to ive,then
   use  osgViewer to look,texture is not right.   it seem that repeat is
   not work! why? osgExp is not surport Texture UV repeat? how to
   make it?  Convert your .ive to .osg with osgconv, then look for the
   wrap parameter in  the file like  wrap_s,t,... REPEAT  If there is
   something other word than REPEAT, change it.  Alberto
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
Много спама? Пользуйтесь Яндекс.Почтой http://mail.yandex.ru/nospam 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] vpb on cluster example

2008-07-28 Thread Greg Myers
Thanks for the quick reply J-S.

I'll try updating VPB via SVN when I get home.  My proxy won't allow
it at work :(

Thanks a lot for the info, I appreciate it.
Greg

On Jul 28, 12:20 pm, Jean-Sébastien Guay [EMAIL PROTECTED]
labs.com wrote:
 Hello Greg,

  I'm new and I'm a little fuzzy on the versioning betweenVPBand OSG.
  It looks like for theexampleyou have provided, we need an older
  version (2.3.6) of OSG.  Do you know if there are plans to upgradeVPB
  to work with the latest releases of OSG or am I totally missing
  something?

 VPBis a bit of a moving target these days, butVPBfrom SVN should
 always work with OSG from SVN. Plus, you get the latest features too.
 Otherwise, check theVPBweb page
 (http://www.openscenegraph.org/projects/VirtualPlanetBuilder) at the
 bottom of the page for how the older versions correspond to the OSG
 versions.

 Hope this helps,

 J-S
 --
 __
 Jean-Sebastien Guay[EMAIL PROTECTED]
http://www.cm-labs.com/
  http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 [EMAIL 
 PROTECTED]://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] help me!

2008-07-28 Thread Dunhour, Mike (CIV)


Hello

Use osgexp and 3ds Max(v8) all the time, most often with Delta3D, and
have no problems with repeating UV's.

  Open your .osg file 
  Where it describes your 'textureUnit'{ Texture 2d{ 
Look for 
wrap_s and wrap_t  these should both be set to 'REPEAT'

osgEXP should handle this without your needing to modify your file

Mr. D

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


Re: [osg-users] Problem using osg::ColorMatrix

2008-07-28 Thread Ulrich Hertlein

Hi Rahul,

Rahul Jain wrote:
 Color matrix in OpenGL is used for color space conversion, for example
 using color matric you can convert RGB to BGR , RGB to CMY.
 Unfortunately i do not have any screen grabs for the moment, but i am
 trying to achieve night vision effect using this code ,

doesn't the color matrix only affect pixel transfer operations?  Like texture 
upload/download, framebuffer reads and such?  So you can't use it to modify 
object appearance on the fly.


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


[osg-users] DIVERSE BOF at SIGGRAPH, Aug 13, 10:30AM

2008-07-28 Thread Steve Satterfield



DIVERSE BOF

Wednesday, August 13
10:30 - 11:30 am
Los Angeles Convention Center
Room 501A

DIVERSE-Flexible Source VE API
diverse.sourceforge.net

DIVERSE is a cross-platform, open source, API for developing virtual reality
applications that can run almost anywhere. DIVERSE currently runs on Linux, 
OS

X and Windows. The goal of DIVERSE is to enable developers to quickly build
applications that will run on the desktop as well as various immersive
systems. To avoid hindering development DIVERSE is designed without the
center of the universe paradigm; you only use the parts of DIVERSE that you
need. This approach allows DIVERSE to interact with many other APIs and
toolkits like, OpenGL, OpenSceneGraph, VTK and Coin.


BOF Agenda

  1 - John Kelso, Steve Satterfield
  Scientific Applications and Visualization Group, NIST

 Introduction and Overview of DIVERSE

  2 - John Kelso
  Scientific Applications and Visualization Group, NIST

 Description and laptop based demonstration of NIST research using
 DIVERSE based visualization to do virtual measurement

  3 - Dr. Marc Olano
  Computer Science and Electrical Engineering, UMBC
  Scientific Applications and Visualization Group, NIST

 Using Vertex Shaders on the GPU for flip-book style animations

  4 - Questions/Discussion


For more information about the BOF, please contact:
Steve Satterfield: [EMAIL PROTECTED]
John Kelso: [EMAIL PROTECTED]




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


[osg-users] osg make error in mingw

2008-07-28 Thread songbo_1220
hello everyone!
sorry my english is poor.
i working at the mingw, i make the osg, find below some error, can you tell me 
why and how to do?
thanks!
[EMAIL PROTECTED] 
/f/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/build_msys
$ make
Scanning dependencies of target OpenThreads
[  0%] Building CXX object 
src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/WIN32Condition.obj
In file included from 
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32ConditionPrivateData.h:29,
 from 
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/WIN32Condition.cpp:20:
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32ThreadPrivateData.h:22:1:
 warning: _WIN32_WINNT redefined
In file included from 
f:\mingw\build\bin\../lib/gcc/i386-pc-mingw32/4.3.0/../../../../include/windows.h:48,
 from 
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32ConditionPrivateData.h:24,
 from 
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/WIN32Condition.cpp:20:
f:\mingw\build\bin\../lib/gcc/i386-pc-mingw32/4.3.0/../../../../include/windef.h:20:1:
 warning: this is the location of the previous definition
[  0%] Building CXX object 
src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/Win32Mutex.obj
[  0%] Building CXX object 
src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/Win32Thread.obj
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32Thread.cpp:
 In static member function 'static int 
OpenThreads::ThreadPrivateActions::SetThreadSchedulingParams(OpenThreads::Thread*)':
f:/OpenSceneGraph/OpenSceneGraph-2.2.0/OpenSceneGraph/src/OpenThreads/win32/Win32Thread.cpp:196:
 error: 'getenv' was not declared in this scope
make[2]: *** [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/Win32Thread.obj] 
Error 1
make[1]: *** [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/all] Error 2
make: *** [all] Error 2


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


[osg-users] Shadow techniques status

2008-07-28 Thread Dan V .
Hi.  I'm looking at shadow techniques provided by the osgshadow nodekit for use
in a production project.  On the wiki it reads like only ShadowMap is production
ready and all the others have problems.  Is this the case?  Or have the others
been marked as experimental because they do not work across video cards?  

Our software will be used on a controlled hardware platform so if the techniques
are restricted to certain cards it may not be an issue.


Thanks,

Dan.


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