Re: [osg-users] mac -install_name

2008-05-27 Thread Martins Innus

Andy,

	I use install_name_tool -change . and install_name_tool -id ... 
in a script as a Run Script Build phase.  I don't know if you can do it 
in XCode directly.  Seems to work.  Let me know if you need more info 
and I'll dig up the exact script.


Martins

Andy Skinner wrote:

I’ll admit to being a little past the limit of my knowledge here ...

 

We would like to specify the –install_name arg with which we link the 
shared libraries.  I think it is because we don’t want the paths where 
these things were built to be in the files.  We’re trying to replace the 
value with something like: [EMAIL PROTECTED]/filename”.


 


Is there a way to specify the –install_name argument on the Mac?

 

I tried setting it in our linker flags, then saw it was in there 
already, and I think it is added by the OSG build.


 

I have looked at the gmane archive, and found some mention of 
–install_name, but nothing I can see how to use.


 


thanks

andy

 





___
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] mac -install_name

2008-05-27 Thread Andy Skinner
Thanks, but that's what I'm trying to avoid.  Don't you have to do the -id 
version for every file (changing its own name) and the -change version for 
every dependency in every file?  I'm hoping I can do something in the link 
commands and avoid having to patch up the files.

andy

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martins Innus
Sent: Tuesday, May 27, 2008 1:03 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] mac -install_name

Andy,

I use install_name_tool -change . and install_name_tool -id ...
in a script as a Run Script Build phase.  I don't know if you can do it
in XCode directly.  Seems to work.  Let me know if you need more info
and I'll dig up the exact script.

Martins

Andy Skinner wrote:
 I'll admit to being a little past the limit of my knowledge here ...



 We would like to specify the -install_name arg with which we link the
 shared libraries.  I think it is because we don't want the paths where
 these things were built to be in the files.  We're trying to replace the
 value with something like: @load_path/filename.



 Is there a way to specify the -install_name argument on the Mac?



 I tried setting it in our linker flags, then saw it was in there
 already, and I think it is added by the OSG build.



 I have looked at the gmane archive, and found some mention of
 -install_name, but nothing I can see how to use.



 thanks

 andy




 

 ___
 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] Getting world space normal

2008-05-27 Thread Mike Weiblen
Well, not so much a requirement as OpenGL convention.

GL defines a normal as a 3-component vector (there are only the
glNormal3*() calls, unlike glVertex which has many sizes)

And the GLSL builtins : gl_NormalMatrix is a mat3 and gl_Normal is a vec3.

But sure, you can make the math with larger number of components.

-- mew



On Tue, May 27, 2008 at 9:41 AM, Paul Melis [EMAIL PROTECTED] wrote:
 Mike Weiblen schreef:

 Normals must be transformed by a normal matrix (which is a mat3).  It
 is not correct to promote a normal to a vec4 and try to use the
 transformation matrix (which is a mat4).


 Just curious: the mat3 requirement comes from the OpenGL shading language?
 As mathematically there's nothing wrong with representing a normal with (x,
 y, z, 1) as long as the 4x4 matrix being multiplied with is the inverse
 transponse of the point transformation (as you remarked) and has a zero
 translation part.

 Paul

 You'll need to generate a new normal matrix, which is defined as the
 upper-left mat3 of the inverse transpose of the transformation matrix.

 -- mew




 On Tue, May 27, 2008 at 8:30 AM, zhangguilian [EMAIL PROTECTED]
 wrote:


 Hi,

 I want to get the normal in world space, I can not use
 gl_NormalMatrix because it will translate the normal from local space to
 eye
 space, from you hint I do in this way:

 mat4 ToWorldMatrix = osg_ViewMatrixInverse* gl_ModelViewMatrix;
 WorldPos= ToWorldMatrix * gl_Vertex;

  vec4 normal=vec4(gl_Normal,0.0);
  WorldNrm= (ToWorldMatrix * normal).xyz;
  WorldNrm=normalize(WorldNrm);

 the worldpos seems right, but worldNrm seems has problem, Can I get the
 world space normal in this way?

 Thanks very much for your consideration!

 
 zhangguilian
 2008-05-27
 ___
 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




-- 
Mike Weiblen -- Austin Texas USA -- http://mew.cx/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] mac -install_name

2008-05-27 Thread Martins Innus
Yeah, thats what I do, but I only have a couple files in my case I need 
to worry about.


Although I just tried adding:

-install_name @executable_path/../Frameworks/file.dylib

to LDFLAGS and that seemed to work.  I do this in a Makefile project and 
use the resulting dylib in a larger XCode project.  Then i didn't have 
to do the install_name_tool voodoo.


Martins

Andy Skinner wrote:

Thanks, but that's what I'm trying to avoid.  Don't you have to do the -id 
version for every file (changing its own name) and the -change version for 
every dependency in every file?  I'm hoping I can do something in the link 
commands and avoid having to patch up the files.

andy

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martins Innus
Sent: Tuesday, May 27, 2008 1:03 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] mac -install_name

Andy,

I use install_name_tool -change . and install_name_tool -id ...
in a script as a Run Script Build phase.  I don't know if you can do it
in XCode directly.  Seems to work.  Let me know if you need more info
and I'll dig up the exact script.

Martins

Andy Skinner wrote:

I'll admit to being a little past the limit of my knowledge here ...



We would like to specify the -install_name arg with which we link the
shared libraries.  I think it is because we don't want the paths where
these things were built to be in the files.  We're trying to replace the
value with something like: @load_path/filename.



Is there a way to specify the -install_name argument on the Mac?



I tried setting it in our linker flags, then saw it was in there
already, and I think it is added by the OSG build.



I have looked at the gmane archive, and found some mention of
-install_name, but nothing I can see how to use.



thanks

andy






___
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


Re: [osg-users] mac -install_name

2008-05-27 Thread Andy Skinner
When I added -install_name something to our LDFLAGS, it complained that the 
option was in there twice.  So I assumed CMAKE was putting it in.  Maybe I 
should look to see if we're doing it somewhere.

andy

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martins Innus
Sent: Tuesday, May 27, 2008 2:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] mac -install_name

Yeah, thats what I do, but I only have a couple files in my case I need
to worry about.

Although I just tried adding:

-install_name @executable_path/../Frameworks/file.dylib

to LDFLAGS and that seemed to work.  I do this in a Makefile project and
use the resulting dylib in a larger XCode project.  Then i didn't have
to do the install_name_tool voodoo.

Martins

Andy Skinner wrote:
 Thanks, but that's what I'm trying to avoid.  Don't you have to do the -id 
 version for every file (changing its own name) and the -change version for 
 every dependency in every file?  I'm hoping I can do something in the link 
 commands and avoid having to patch up the files.

 andy

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martins Innus
 Sent: Tuesday, May 27, 2008 1:03 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] mac -install_name

 Andy,

 I use install_name_tool -change . and install_name_tool -id 
 ...
 in a script as a Run Script Build phase.  I don't know if you can do it
 in XCode directly.  Seems to work.  Let me know if you need more info
 and I'll dig up the exact script.

 Martins

 Andy Skinner wrote:
 I'll admit to being a little past the limit of my knowledge here ...



 We would like to specify the -install_name arg with which we link the
 shared libraries.  I think it is because we don't want the paths where
 these things were built to be in the files.  We're trying to replace the
 value with something like: @load_path/filename.



 Is there a way to specify the -install_name argument on the Mac?



 I tried setting it in our linker flags, then saw it was in there
 already, and I think it is added by the OSG build.



 I have looked at the gmane archive, and found some mention of
 -install_name, but nothing I can see how to use.



 thanks

 andy




 

 ___
 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


Re: [osg-users] Parallel Split Shadow Map (Update)

2008-05-27 Thread Robert Osfield
Hi Adrian,

I have run out of day, in my day long merge spree, so I'll need to
start up again tomorrow, at which point I'll check out your latest
changes.   If you have any further updates to the ones sent of the
23rd May please just send them through,

Cheers,
Robert.

On Fri, May 23, 2008 at 8:11 AM, Adrian Egli OpenSceneGraph (3D)
[EMAIL PROTECTED] wrote:
 Latest Version to Test, i tested this on:

 ATI X1600 M : Windows Vista

 osgshadow --pssm --SingleThreaded --screen 0 -3


 2008/5/21 Adrian Egli OpenSceneGraph (3D) [EMAIL PROTECTED]:

 Hi all again,

 now i came from ATI X1600M test, same artifact as you described, small
 shadowed line. i will try to figure out where it comes from. i guess we have
 to set another polygonoffset. 0.5,0.5 is may not as good as it seams to be.
 may -0.5,-0.5 or -1.0,-1.0 will work for ATI and NVidia. please check this
 with the option
 for polygonoffset and tell me what is a good offset.

 thanks adrian

 2008/5/21 Ralph Kern [EMAIL PROTECTED]:

 Adrian Egli OpenSceneGraph (3D) schrieb:

 Hi all,

 i still come around with some changes. :-) now the near - far clip plane
 are more optimized, but i hope it's shows still correct shadows for all of
 your test cases.

 Its updated with latest PSSM version (from this morning,MEZ)

 http://webaddon3d.assoftware.ch/AE/PSSM_SHADOW_TEST_OpenSceneGraph_WIN32.rar
 (use the demo.bat)

 and in the attachement you will find the latest source.

 test
 osgshadow --pssm --SingleThreaded  --no-base-texture



 just checked again. I removed the other two REM's on PATH and
 LIBRARY_PATH to get the program running.

 Works on WinXP SP2 GeForce FX5700, but slow frame rate (2.3 fps).

 On WinXP SP2 ATI X1600 dual monitor the park scenes run fine using screen
 0 with 70 fps. There is a small lit line ( 1 pix wide) around the buildings
 like a self shadow offset which is to large. Chess scene is still entirely
 black.

 regards Ralph

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



 --
 
 Adrian Egli


 --
 
 Adrian Egli
 ___
 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] Debugging example hangs in Cygwin and need some insight into cygwin_osgdb_osg.dll

2008-05-27 Thread Brian Keener
Robert Osfield wrote:
 The bug certainly seems to be a cygwin bug, unless the OSG's handle is
 being corrupted
 for some reason.  This code works fine on other platforms so I
 wouldn't expect the later
 to be an issue.
 
 Perhaps you could write a small example that just loadeds the osg
 plugin, then unloads
 it all using dlopen/dlclose calls directly rather than using
 osgDB/osgconv, this would isolate
 the problem to just standard unix calls.

I was going to try that but here is another interesting catch - if I do:

osgconvd cow.osg brian.osg (or the equivalent in the debugger) 

I get the hang as I documented but

If I do:

osgconvd cow.osg brian.jpg 

or

osgconvd test.jpg brian.cow

I simply get a message:

Error no data loaded.

This almost seems as if iot has something to do with the actually 
writing of the osg file when it writes the data and then something not 
terminating as it should.

bk





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


Re: [osg-users] Counting visible vertex

2008-05-27 Thread Paul Martz
osgOQ is no longer an extension -- OcclusionQueryNode is part of OSG v2.4.
However, as currently implemented, it does not return to you a count of the
number of visible vertices.
 
OSG, like many rendering doesn't provide direct support to return the number
of visible vertices. However, you should be able to use any general
algorithms that exist to perform this task.
 
To determine the pixel size of a bounding sphere, you can use the distance
and radius along with the combined modelview and projection matrices.
OcclusionQueryNode could probably be modified easily to return a count of
the number of visible pixels of the bounding box, but it doesn't currently
do this, as that was not a design goal.
   -Paul
 
 
 


  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of a.lagnier
Sent: Tuesday, May 27, 2008 10:28 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Counting visible vertex



Hi all,

I want to calculate number of no occlusing vertex. But, I don't know how
determinate visibility. Must I use osgOQ extension? 

I have an other question : how can I access to pixel size of an object on
screen? I think I must use Cullstack::pixelSize(boundingsphere). I want it
for determinate what LOD is visible (with RangeMode PIXEL_SIZE_ON_SCREEN).
Maybe there is an other way to determinate it...




Any idea ?

Thanks,
Aude






Créez votre adresse électronique [EMAIL PROTECTED]
http://www.laposte.net  
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.


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


[osg-users] Please test SVN of OpenSceneGraph and VirtualPlanetBuilder in prep for dev releases

2008-05-27 Thread Robert Osfield
Hi All,

Today I've begun clearing the osg-submissions back log.  I've merged
the majority of the backlog, and will continue tomorrow morning and
then put out a OSG-2.5.1 and VPB-0.9.9 dev releases.

There has been lots of build changes checked in, which, fingers
crossed will solve build problems such as when using CMake 2.6, and
without breaking build on prior versions of CMake.  However, all this
needs a serious work out across all platforms so I'd appreciate
testing on SVN before I go a tag a dev release.

Thanks in advance for you time and effort testing,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] mac -install_name

2008-05-27 Thread E. Wing
On 5/27/08, Andy Skinner [EMAIL PROTECTED] wrote:
 I'll admit to being a little past the limit of my knowledge here ...

 We would like to specify the -install_name arg with which we link the shared
 libraries.  I think it is because we don't want the paths where these things
 were built to be in the files.  We're trying to replace the value with
 something like: @load_path/filename.

 Is there a way to specify the -install_name argument on the Mac?

 I tried setting it in our linker flags, then saw it was in there already,
 and I think it is added by the OSG build.

 I have looked at the gmane archive, and found some mention of -install_name,
 but nothing I can see how to use.

 thanks
 andy


The old, now mostly defunc Xcode project set the install_name via the
normal Xcode mechanisms. We set the path to
@executable_path/../Frameworks

In addition to manually adding the flags to the generic CMake flags,
CMake has new direct support for this property. We're adding this to
the framework build in CMake. (dylibs are less clear about what the
default convention should be.) Also, regardless, CMake also builds
with the max path padding so you can use the install_name_tool to
redefine the install_name after the fact.

I'm struggling with time constraints to finish the CMake/OS X
integration. If anybody wants to help, please let me know. I currently
have put up a Mercurial repository at:
http://www.assembla.com/wiki/show/OpenSceneGraphHg
There is an example of the install_name stuff in CMake in
CMakeModules/OsgMacroUtils.cmake. (Grep for 'FRAMEWORK').

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


Re: [osg-users] Please test SVN of OpenSceneGraph and VirtualPlanetBuilder in prep for dev releases

2008-05-27 Thread Jean-Sébastien Guay

Hi Robert,


There has been lots of build changes checked in, which, fingers
crossed will solve build problems such as when using CMake 2.6, and
without breaking build on prior versions of CMake.  However, all this
needs a serious work out across all platforms so I'd appreciate
testing on SVN before I go a tag a dev release.


Windows Vista, MS Visual Studio 2005, both CMake 2.4.7 and CMake 2.6

On both CMake versions, OSG built fine. VPB will need some of the same 
changed made to OSG to support CMake 2.6 correctly, but it builds fine 
with CMake 2.4.7.


Good work,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   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] Please test SVN of OpenSceneGraph and VirtualPlanetBuilder in prep for dev releases

2008-05-27 Thread Rahul Jain
Hi Robert,

OSG built fine on  linux (suse 10.3) with cmake 2.4.7. Checked examples
also they are working properly

cheers
RJ

Robert Osfield wrote:
 Hi All,

 Today I've begun clearing the osg-submissions back log.  I've merged
 the majority of the backlog, and will continue tomorrow morning and
 then put out a OSG-2.5.1 and VPB-0.9.9 dev releases.

 There has been lots of build changes checked in, which, fingers
 crossed will solve build problems such as when using CMake 2.6, and
 without breaking build on prior versions of CMake.  However, all this
 needs a serious work out across all platforms so I'd appreciate
 testing on SVN before I go a tag a dev release.

 Thanks in advance for you time and effort testing,
 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] threading trouble with slave cameras

2008-05-27 Thread Terry Welsh
Hi,
I just tried to replace SceneView with osgViewer::Viewer to take
advantage of threading.  My scene has 3 views of the same scene with
cameras set up like this:

 Viewer camera
/   | \
far_cam1far_cam2 far_cam3
|   |   |
near_cam1  near_cam2  near_cam3
(POST_RENDER)  (POST_RENDER)(POST_RENDER)
 \  |  /
  scene

The viewer camera is only used for clearing.  The near and far
cameras are used to render different depth ranges of my scene to
prevent a lot of z-fighting; each pair of near/far cameras draws into
the same viewport.

With no threading, I use 1 core at 100%.  With
CullThreadPerCameraDrawThreadPerContext I use 1 core at 100% and
another core at about 25%.  There are still 2 cores that are nearly
unused.  The other threading modes do not appear to help.

I tried to trace through the threading code in ViewerBase a little.
In cameras (the vector of osg::Cameras) there is only 1 camera, but
I expected to find 7.  Is it impossible to have 7 cull threads in this
situation, or am I just setting something up wrong?
- Terry
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Please test SVN of OpenSceneGraph and VirtualPlanetBuilder in prep for dev releases

2008-05-27 Thread Paul Martz
Bravo, Robert! Works great:
* Mac OSX 10.5, cmake 2.4.8 producing gcc makefiles;
* WinXP SP3, cmake 2.6 producing VS2005 sln/vcproj files.
   -Paul


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


[osg-users] Openthreads problem on 64 bit windows system.

2008-05-27 Thread Cysneros, Nelson SPAWAR


I'm having a problem with an existing application that runs well on a
32-bit windows XP (VS 2003) system, but does not seem to work when ran
on a 64-bit windows XP (VS 2003) system.  

I narrowed down the problem to Openthreads, seems that my threaded while
loop never (or rarely) gets called.  I was able to recreate the problem
with this simple program below. It runs two threads, both printing a
message to the screen.  Only one message is displayed on a 64bit
machine.  I turned on OSG notification to DEBUG, but no extra
information is displayed.

Has anyone else experience this problem?  Am I doing something wrong?
Thanks in advance.


///
//Header file MutexTest.h
///
#ifndef __MUTEXTEST_H_
#define __MUTEXTEST_H_

#include OpenThreads/Thread
#include OpenThreads/Mutex
#include OpenThreads/Barrier
#include OpenThreads/Block
#include OpenThreads/ScopedLock
#include iostream

class MutexTest : public OpenThreads::Thread
{
  public:
  MutexTest();
  ~MutexTest();
  //Functions
  virtual void run();
  void quit();
  void printHello();
  void setMutex(OpenThreads::Mutex* newValue);
  OpenThreads::Mutex* getMutex();

  private:
mutable OpenThreads::Mutex*  _mutex;
  };
#endif


///
//Source file MutexTest.cpp
///

#include MutexTest.h

MutexTest::MutexTest(){
_mutex = new OpenThreads::Mutex();
}

MutexTest::~MutexTest(){
std::coutMutexTest Test Shuting
down.std::endl;
}

void MutexTest::setMutex(OpenThreads::Mutex* newValue){
_mutex = newValue;
}

OpenThreads::Mutex* MutexTest::getMutex(){
return _mutex;
}

void MutexTest::quit() {

}

void MutexTest::printHello(){
OpenThreads::ScopedLockOpenThreads::Mutex
lock(*_mutex);
std::cout-- Mutex Class: Hello --std::endl;
}

void MutexTest::run() {
   while(true){


//
   //This only gets called once when running on 64bit
system

/
printHello();
//sleep
OpenThreads::Thread::microSleep(5000);
}//while
}//run

//

---
//
//   main
//
//

---
int main(int argC, char* argV[])
{
//Create a mutex we can share
OpenThreads::Mutex* mutable my_mutex = new OpenThreads::Mutex;
MutexTest* testMutex = new MutexTest();
testMutex-setMutex(my_mutex);  

//Start thread
testMutex-start();

while(true)
{
OpenThreads::ScopedLockOpenThreads::Mutex
lock(*my_mutex);
std::cout Main: Hello std::endl;
//sleep
OpenThreads::Thread::microSleep(2000);

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


Re: [osg-users] Getting world space normal

2008-05-27 Thread guilianzhang
Hello Mike and Paul,

I can easily get the point transformation matrix in this way:
 mat4 ToWorldMatrix = osg_ViewMatrixInverse* gl_ModelViewMatrix;
 WorldPos= ToWorldMatrix * gl_Vertex;

How can I get the inverse transpose of the ToWorldMatrix and set its 
translation part to zero? There seems to be no inverse and transpose funtions 
in glsl.

Thank you very much!



guilianzhang
2008-05-28



发件人: Mike Weiblen
发送时间: 2008-05-28 01:36:52
收件人: OpenSceneGraph Users
抄送: 
主题: Re: [osg-users] Getting world space normal

Well, not so much a requirement as OpenGL convention.

GL defines a normal as a 3-component vector (there are only the
glNormal3*() calls, unlike glVertex which has many sizes)

And the GLSL builtins : gl_NormalMatrix is a mat3 and gl_Normal is a vec3.

But sure, you can make the math with larger number of components.

-- mew



On Tue, May 27, 2008 at 9:41 AM, Paul Melis  [EMAIL PROTECTED]  wrote:
 Mike Weiblen schreef:
 
  Normals must be transformed by a normal matrix (which is a mat3).  It
  is not correct to promote a normal to a vec4 and try to use the
  transformation matrix (which is a mat4).
 

 Just curious: the mat3 requirement comes from the OpenGL shading language?
 As mathematically there's nothing wrong with representing a normal with (x,
 y, z, 1) as long as the 4x4 matrix being multiplied with is the inverse
 transponse of the point transformation (as you remarked) and has a zero
 translation part.

 Paul
 
  You'll need to generate a new normal matrix, which is defined as the
  upper-left mat3 of the inverse transpose of the transformation matrix.
 
  -- mew
 
 
 
 
  On Tue, May 27, 2008 at 8:30 AM, zhangguilian  [EMAIL PROTECTED] 
  wrote:
 
  
   Hi,
  
   I want to get the normal in world space, I can not use
   gl_NormalMatrix because it will translate the normal from local space to
   eye
   space, from you hint I do in this way:
  
   mat4 ToWorldMatrix = osg_ViewMatrixInverse* gl_ModelViewMatrix;
   WorldPos= ToWorldMatrix * gl_Vertex;
  
vec4 normal=vec4(gl_Normal,0.0);
WorldNrm= (ToWorldMatrix * normal).xyz;
WorldNrm=normalize(WorldNrm);
  
   the worldpos seems right, but worldNrm seems has problem, Can I get the
   world space normal in this way?
  
   Thanks very much for your consideration!
  
   
   zhangguilian
   2008-05-27
   ___
   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




-- 
Mike Weiblen -- Austin Texas USA -- http://mew.cx/
___
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] issues with geometry and 2.4.0 multi-threaded

2008-05-27 Thread Jason Coposky

i have just freshly build 2.4.0 from source acquired from the
zip file on the downloads page for VC8 on WinXP.  i have ran
the osgviewer app using both a custom obj file and the cow.osga
from the new osg data archive.  it seems that in all instances of
multithreaded applications the loaded geometry becomes disorganized
into a horrible mess.  if set the threading model to single threaded 
for the viewer, all is well.  i can only imagine im missing something
rather obvious

thanks

~jason coposky



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


Re: [osg-users] issues with geometry and 2.4.0 multi-threaded

2008-05-27 Thread Paul Martz
Are you on a multimonitor NVIDIA system by any chance? If so, this is a
known issue in the NVIDIA device driver. Not sure what the workaround was --
I think it had something to do with additional MakeCurrent calls. You should
check the archives; this was discussed within the past month. You might try
the current SVN head to see if it resolves this issue.

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


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Jason Coposky
 Sent: Tuesday, May 27, 2008 8:22 PM
 To: osg-users
 Subject: [osg-users] issues with geometry and 2.4.0 multi-threaded
 
 
 i have just freshly build 2.4.0 from source acquired from the
 zip file on the downloads page for VC8 on WinXP.  i have ran
 the osgviewer app using both a custom obj file and the cow.osga
 from the new osg data archive.  it seems that in all instances of
 multithreaded applications the loaded geometry becomes 
 disorganized
 into a horrible mess.  if set the threading model to 
 single threaded 
 for the viewer, all is well.  i can only imagine im 
 missing something
 rather obvious
 
 thanks
 
 ~jason coposky
 
 
 
   
 ___
 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] can't remove all PrimitiveSet

2008-05-27 Thread IceSharK
Paul , thank you.

Yes, the right way is : *geometry-removePrimitiveSet( 0 ,
geometry-getNumPrimitiveSets() );*

The problem is caused by my another code.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org