Re: [osg-users] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Paul Melis

Art Tevs wrote:

Hi folks,

I've setted up a Rule-page http://forum.openscenegraph.org/rules.php describing the etiquette of forum/mailing list use. I have 

Hmmm, the rules page seems unaccessible (just like the rest of the forum):

*Warning*: mysql_connect() [function.mysql-connect 
http://forum.openscenegraph.org/function.mysql-connect]: Host 
'alpha.ip.elowar.com' is blocked because of many connection errors; 
unblock with 'mysqladmin flush-hosts' in 
*/var/www/tevs.eu/subdomains/osgforum/httpdocs/db/mysql4.php* on line *48*


*Warning*: mysql_error(): supplied argument is not a valid MySQL-Link 
resource in 
*/var/www/tevs.eu/subdomains/osgforum/httpdocs/db/mysql4.php* on line *330*


*Warning*: mysql_errno(): supplied argument is not a valid MySQL-Link 
resource in 
*/var/www/tevs.eu/subdomains/osgforum/httpdocs/db/mysql4.php* on line *331*

phpBB : *Critical Error*

Could not connect to the database



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


Re: [osg-users] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Art Tevs
Hi,

corrected. There was some database error, I had to restart it. Check it out.

Cheers,
art

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





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


Re: [osg-users] osgShadowMap Problems

2009-03-18 Thread Robert Osfield
HI ??? Could you please sign with your name so we know who to address.

Try moving the light source to under the ShadowedScene node.

Robert.

2009/3/17 tuandov...@gmail.com

   I’m trying to use osgShadow, I read examples on osg website and try to
 run this code

 But the shadow appears strangely like this picture:

 http://i475.photobucket.com/albums/rr113/tek3D/shadow.jpg

 Here is the code I tested:

 int main()

 {

osgViewer::Viewer viewer;



osg::ref_ptrosg::Group root = new osg::Group;

// create light source.

osg::LightSource* lightsource = new osg::LightSource;

osg::Light* light = new osg::Light;

lightsource-setLight(light);

light-setDirection(osg::Vec3(0,10,0));

light-setPosition(osg::Vec4(0,0,90,1.0f));

light-setAmbient(osg::Vec4(0.00f,0.00f,0.08f,1.0f));

light-setDiffuse(osg::Vec4(1.0f,1.0f,1.0f,1.0f));

root-addChild(lightsource);



//shadow

const int ReceivesShadowTraversalMask = 0x1;



const int CastsShadowTraversalMask = 0x2;



 osg::ref_ptrosgShadow::ShadowedScene shadowedScene = new
 osgShadow::ShadowedScene;




 shadowedScene-setReceivesShadowTraversalMask(ReceivesShadowTraversalMask);

 shadowedScene-setCastsShadowTraversalMask(CastsShadowTraversalMask);



 osg::ref_ptrosgShadow::ShadowMap sm = new osgShadow::ShadowMap;

 shadowedScene-setShadowTechnique(sm.get());



 int mapres = 1024;

 sm-setTextureSize(osg::Vec2s(mapres,mapres));

sm-setLight(light);



 osg::Node* cessna1 = osgDB::readNodeFile(car68/car68.3DS);

 cessna1-setNodeMask(CastsShadowTraversalMask);



 osg::Node* cessna2 = osgDB::readNodeFile(lai.flt);

 cessna2-setNodeMask(ReceivesShadowTraversalMask);



 osg::MatrixTransform* positioned = new osg::MatrixTransform;

osg::Matrix mat = osg::Matrix::rotate(2.7, osg::Vec3(0,0,1));


 positioned-setMatrix(mat*positioned-getMatrix()*osg::Matrix::translate(10,40,2));

 positioned-addChild(cessna1);



shadowedScene-addChild(positioned);

shadowedScene-addChild(cessna2);



root-addChild(shadowedScene);



viewer.setSceneData(root);

return viewer.run();

 }



 Could anyone help me with this problem? Thanks in advance!

 ___
 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] [forum] New feature: removed default email adress

2009-03-18 Thread Robert Osfield
Hi Art,

I love it, and it works, and it's a tech solution too rather than a social
engineering one it's low ongoing overhead.  Kudos ;-)

Robert.

On Tue, Mar 17, 2009 at 11:11 PM, Art Tevs arti_t...@yahoo.de wrote:

 Hi folks,

 I have changed now the forum's scripts slightly to remove the default email
 adress osgfo...@tevs.eu from the mails sent by the forum users. Now all
 posts which are forwarded to the mailing lists will use user's email adress
 in the From:  header tag. This is a default behavior and can be disabled
 in your profile settings.

 However please note that you still have not to be registered on the mailing
 list, because mails are sent now with the Sender: osgfo...@tevs.eu
 header tag allowing your posts still be delivered to the mailing list.

 If this message comes through to the mailing list, then everything works
 fine ;)

 Best regards,
 Art

 P.S. For usual users: you do not have to do anything. Everything should
 work without any profile changes or any other special kind of behavior.

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





 ___
 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] Draw a triangle with front and back faces

2009-03-18 Thread Robert Osfield
Hi Ruqin,

The OSG uses exactly the same name conventions and state granularity as
OpenGL, typically you just need to change glName to osg::Name to find the
right class to work with.

In your case are you simply looking for two sided lighting?

Robert.

2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Hi,

 I am trying to draw a triangle with filled front and back faces. In this
 way,
 even the normal of it has a wrong direction, I can still have it rendered
 correctly.
 I know how to do this in OpenGL, while didn't figure it out in OSG. Has
 anyone
 done this before? Please help me out with some sample code. Thanks a lot!

 Ruqin

 ___
 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] Flat file (xyz points) reader writer plugin

2009-03-18 Thread Robert Osfield
Hi Martin,

Is this a submision?  Is it just a call for assistance?  I'm not sure what
you are wanting others to do here.

Cheers,
Robert.

2009/3/17 Martin Beckett osgfo...@tevs.eu

 Here is a first pass at a reader/writer plugin for flat file x,y,z point
 data.
 It works reading (2d/3d) and writing (3d) points.

 It has options to specify the field separator on write and an output file
 header. On input you can specify the default Normal and point color.
 BUT I don't know how to specify them to the writeNodeFile() call so I can't
 test them.

 I hope to extend it to be able to read GPS/NMEA tracks and plot them as a
 path. It should also serve as a starting point for writing your own plugins.

 Can anyone who understands the plugin architecture take a look.
 Building is just a matter of cloning the Obj plugin and changing the names.

 Thanks
 Martin

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




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


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


Re: [osg-users] [osgPlugins] Collada Commands

2009-03-18 Thread Robert Osfield
Hi Adam,

On Tue, Mar 17, 2009 at 11:00 PM, Adam Wise arw...@smcm.edu wrote:

 DynamicLibrary::failed loading osgPlugins-2.8.0/osgdb_daed.dll
 Warning: Could not find plugin to write nodes to file new.dae.

 So it's likely that I didn't build the OSG collada plugin. The closest
 thing I could find to that plugin was osgdb_daed.dll.embed.manifest. Which
 was located in
 C:\OpenSceneGraph-2.8.0\build\src\osgPlugins\dae\osgdb_dae.dir\Debug. It was
 well hidden for the most part. So, just to clarify, using visual studio
 2008, how would I  build the collada dom library?


Could it be that you've build the debug version of the plugin but the not
the release, or built the debug version of the Collada DOM but not the
release or visa versa?

VisualStudio is one awful pain w.r.t mixing release and debug binaries.
Best thing to do is writing you app in with an operating system that doesn't
throw in really silly issues like this.

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


Re: [osg-users] Multithreading crashduetoosgDb::Registry::instance()

2009-03-18 Thread Robert Osfield
HI Anthony,

2009/3/18 I-Nixon, Anthony D anthony.d.ni...@boeing.com

  I'll have a crack at it, unless someone else is already doing it.  I've
 got an environment here that exercises the issue consistently.


This would be great, as if you have a case that cases problems then any
changes will be able to will have an observable effect on the issue i.e if
the problem goes away there is good chance that you've fixed it.


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


Re: [osg-users] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-18 Thread Robert Osfield
Hi John,

I'm afraid it's kinda difficult for me to help debug this remotely.
Changing the new of our FindFreeType.cmake so it's more distinct i.e.
something like FindOurFreeType.cmake might be sensible, or perhaps just
removing our local one completely so you can then rely upon the one in
Cmake.

Another thing to try would be adding the MESSAGE(..) macro into our
FindFreeType.cmake to track which variables are being set to what and which
script branches are being taken.  This might provide some clues to why
FREETYPE_INCLUDE_DIRS is not being defined.  Another change would be the
freetype plugins CMakeList.txt so that it uses the individual include
directories rather than FREETYPE_INCLUDE_DIRS.

Robert.

On Tue, Mar 17, 2009 at 6:27 PM, john casu osgfo...@tevs.eu wrote:

 the workaround of setting FREETYPE_FOUND to NO works, so CMake is
 definitely picking the local version of FindFreeType.cmake

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





 ___
 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] a limit of osg::ReaderWriter interface

2009-03-18 Thread Robert Osfield
Hi Ren,

Perhaps we could put the orignal filename into the ReaderWriter::Options
passed to the gz plugin to help it get over this hurdle.  This will require
tweaks of the curl + gz plugins to enable this.

The other route would be to get the .ive plugin itself to compress itself
using it's own inbuilt zlib support.  Then you'd be able to just use the
aa.ive directly.  To compress you can do:

 osgconv myfile.ive compressedfile.ive -O compressed

Robert.

2009/3/18 lwren ren...@hotmail.com

  Hi all,
 I notice that osg::ReaderWriter includes a series of interface like
 readNode(std::istream ,const Options*) which read data from stream buffer
 and has no file name passed in.  There is a problem here when reading the
 file with a name like aa.ive.gz.curl.
 The curl plugin read file data into a stream buffer, and then call plugin
 gz across the interface shown above which not realized in gz to read it
 further, so it failed!
 The interface CAN'T be realized in gz for lack of a file name which is
 needed in gz to determini which  pluin to use in the followed step.

 regards,
 ren

 ___
 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] Random values and OSG

2009-03-18 Thread Guy
Hi all,

 

 I'm suspecting that particle effects I use in my program, doesn't
repeat exactly the same in each run. I saw that in all the projects of
OSG when trying to generate pseudo random numbers, there are calls to
rand().

There is only one place which calls to srand() (besides the examples).
This is the plugin 'txp' which I don't use.

 

 Now, it's pretty good in my opinion that OSG doesn't seed the pseudo
random sequence, but I wanted to be sure, are there in OSG other
mechanisms that generate pseudo numbers which are in use, and might be
seeded by the OSG functions?

 

Thanks,

 Guy.

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


Re: [osg-users] [osgPlugins] Collada Commands

2009-03-18 Thread Roger James




Adam Wise wrote:

  rogerjames99 wrote:
  
  
Adam Wise wrote: 


   
  
  
Robert Osfield wrote:



  On Tue, Mar 17, 2009 at 4:35 PM, Adam Wise  wrote:


  
  
 Question: exactly what does this mean? Warning: Could not find plugin to write nodes to file "new.dae"



  
   
What is means is that it's warning your that it couldn't find the plugin to write the nodes to the file "new.dae".

But then... that's exactly what it says.  I don't know what more to add.

Perhaps you should try asking a different questions... such as WHY it's not able to find a plugin to write the nodes to the file "new.dae"

If you are asking this question then ask the question have you compiled and installed the dae plugin?

Robert.

--
Post generated by Mail2Forum

  

 


That's what I meant...why is it not able to find the plugin? As far as I know, I BUILT the collada package, and viewer in windows. I followed the instructions in the read me. As far as installing it, there were no explicit instructions as to how to do that. Should I create a path to something?



  
   
  

 A fairly fundamental check is to see if you have a file osgdb_dae.[dll|so] in the directory where all your other OSG plugins are located. On a recent windows install this will probably be "c:Program FilesOpenSceneGraphbinosgPlugins-2.8.0. If you have not, then you have not built the OSG Collada plugin. The OSG Collada plugin is built as part of the OSG build, it is not part of the Collada DOM library build.

Roger

 --
Post generated by Mail2Forum

  
  


DynamicLibrary::failed loading "osgPlugins-2.8.0/osgdb_daed.dll"
Warning: Could not find plugin to write nodes to file "new.dae".

So it's likely that I didn't build the OSG collada plugin. The closest thing I could find to that plugin was osgdb_daed.dll.embed.manifest. Which was located in C:\OpenSceneGraph-2.8.0\build\src\osgPlugins\dae\osgdb_dae.dir\Debug. It was well hidden for the most part. So, just to clarify, using visual studio 2008, how would I  build the collada dom library?

  

You should find a file called BuildLog.htm in that directory. That will
tell you where and whether an output file has been built. If you used
default settings the file should under the root of your OSG tree
(c:\OpenSceneGrpah-2.8.0|)  at bin/osgPlugins-2.8.0/osgdb_daed.dll.
You can check up on whether you have a built a Release version by
looking in the Release directory in osgdb_dae.dir (if it exists).
Remember OSG cannot find plugins from the bin directory, you need to
run the INSTALL target (in both Release and Debug mode)  as
admiminstrator if you are on Vista. This will probably copy them into
the right place under "/Program Files/OpenSceneGraph".

The Collada plugin will be only be added to the build if CMake finds
the collada dom library files you can check this by running CMake and
looking for the COLLADA_* values (you may need to select "show advanced
values").

Roger


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


Re: [osg-users] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Art Tevs
Hi Robert,

I've registered for you, you should recieve an activation mail. Please change 
the password as soon as you activated your account. If you would like to have 
different name, then let me know, I change it. As soon as you have activated 
this, I will give you admin/moderator rights, so that you are can perform 
moderation tasks whenever you like. 

As to the Name issue, you are right, we should have some kind of First Last 
Name approach, however I am not sure if everybody would like this, because 
maybe somebody do like staying anonymous. I have already let users with strange 
names knows, that their account will be deactivated if they do not change their 
real name. Let's see what happens in the next days.

cheers,
art

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





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


Re: [osg-users] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Paul Melis
OT: why are all the posts in this thread coming from the forum not 
threading correctly? It seems the mails don't have an in-reply-to 
header. Was this always the case for posts coming from the forum?


Regards,
Paul

Art Tevs wrote:

Hi Robert,

I've registered for you, you should recieve an activation mail. Please change the password as soon as you activated your account. If you would like to have different name, then let me know, I change it. As soon as you have activated this, I will give you admin/moderator rights, so that you are can perform moderation tasks whenever you like. 


As to the Name issue, you are right, we should have some kind of First Last 
Name approach, however I am not sure if everybody would like this, because 
maybe somebody do like staying anonymous. I have already let users with strange 
names knows, that their account will be deactivated if they do not change their 
real name. Let's see what happens in the next days.

cheers,
art

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





___
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] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Art Tevs
Hi Paul,

hmm, yes it seems there are no In-Reply-To header tag, when a message is sent 
through the forum. But I has never recieved any threading issue with the 
message, since my mail client is able to thread them by the subject. You are 
first who raised this issue ;), maybe your mail client has to be setted up 
properly, 

I could try to implement this, however I am not sure now how to do this. I'll 
put it onto my ToDo list...

Best regards,
art



Paul Melis wrote:
 OT: why are all the posts in this thread coming from the forum not 
 threading correctly? It seems the mails don't have an in-reply-to 
 header. Was this always the case for posts coming from the forum?
 
 Regards,
 Paul
 


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





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


[osg-users] [forum] New feature: removed default email adress

2009-03-18 Thread Art Tevs
Hi Robert,

yes, it seems that mailman  can deliver emails if only the Sender header tag 
matches. However I am not sure if this is a good way, since this technique is 
commonly used by spammers. So if you have some filters running on the mailman 
side, then I would like to ask you to configure message sent by the forum to go 
through ;)

cheers,
art


Robert Osfield wrote:
 Hi Art,
 
 I love it, and it works, and it's a tech solution too rather than a social 
 engineering one it's low ongoing overhead.  Kudos ;-)
 
 Robert.
 


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





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


Re: [osg-users] [forum] New feature: removed default email adress

2009-03-18 Thread Robert Osfield
Hi Art,

On Wed, Mar 18, 2009 at 10:54 AM, Art Tevs arti_t...@yahoo.de wrote:

 yes, it seems that mailman  can deliver emails if only the Sender header
 tag matches. However I am not sure if this is a good way, since this
 technique is commonly used by spammers. So if you have some filters running
 on the mailman side, then I would like to ask you to configure message sent
 by the forum to go through ;)


I'm not sure what you mean in your last sentence.  Are you talking about
spam filters?  If so the forum posts are getting through so far.

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


Re: [osg-users] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Robert Osfield
Hi Art,

On Tue, Mar 17, 2009 at 8:32 PM, Art Tevs osgfo...@tevs.eu wrote:

 Ok, this is doable. I am currently working on this. However in order to do
 so, you, Robert, has also to be registered on the forum. I will then give
 you according permissions, so that you are able to see those users and also
 able to approve them.


I have just attempt to subscribe but got kicked out with a message You have
exceeded the number of registration attempts for this session. Please try
again later.   It kept telling me that I'm typed in the cryptic code
incorrectly, I'm pretty sure I got it right each time.

Ok, this is also doable, however one would need to continuosly moderate the
 forum/read all messages. Currently there is only me and Roland who are
 moderating the forum. If we could get some more volunteers  for checking the
 etiquette it would be great! This makes sure that there is always somebody
 who is able to moderate.


I'm able happy to register (once I can) but being an active moderator would
be taking on too much as I'm already overstretched.   I would have thought
that we could avoid having to approach all message, so passive moderation
rather than active one.  i.e. we just keep track of threads/posts and if
something is going off the rails then to moderate.




  Having better user names will certainly help, as a number of recent forum
 subscribers just have two letter user names which mean absolutely nothing in
 any language.  A decent user name gives us the chance of keeping track of
 who's who and who's said what, and who to reply to on different topics.
 

 How about Ed ? No, this is not true. There are names with just 2 letters,
 maybe not in our european languages, but in other there are (chinese?) ;)
 And we could not force users to write there first and last name, because
 maybe they want to have some kind of anonymity, which has to be respected.
 However, I agree that names like Xh or maybe are not acceptable.


Well there are nick names that are two letters, but with a big community
like ours there will almost certainly be more than one person with the same
nick name.  Who gets to choose who can use there nick name and who doesn't?

Going by nick names only really works with small communities, such as
between friends + family.  With large communities communication needn't be
formal, but we need to take into account the fact that breadth of the
community both in size and diversity - and use a longer names that uniquely
distinguish individuals is part of this.  The longer names needn't be actual
names, but they do need to be human readable and travel well across
different countries and be to be distinct.

I've just realised there is a bit of parallel to the code of the
OpenSceneGraph in this topic...  I have a inclination towards long
description names for classes and enums, and prefer it specifically for
communication/recall purposes.  If you have a small number of classes and
functionality you can get away with cryptic names, but with a big library
it's impossible to keep track of things - imagine renaming all our classes
as a two letter name.   Any guesses what Ob, Nd, Gp, Sw, Se, Pd, Ld, Ge, Dr,
Rf, Rp, Md, Mf might be?? ;-)

Robert.



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


Re: [osg-users] What about User-Meeting in Europe - osgInEurope?

2009-03-18 Thread Eike Schumann
Hello QSG Forum!

I am a long term silent listener and 'downloader'. I am fascinated by the idea 
of a user meeting here in Europe. I voted for Paris as destination for that 
meeting. 

Greetings,
Eike

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





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


[osg-users] osgText::readFontFile returns NULL on valid argument

2009-03-18 Thread Jesper D. Thomsen
Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from this 
method:


osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);



The strange part is that when I compile and run the osgText and osgHud 
examples, it works just fine (so it isn't the font-file which is missing). It 
only happens in my own program.
So far I have tested it on both Vista and XP machines in the office, and this 
doesn't seem to affect the problem. However, my program works just fine on a 
single XP machine, but not on any of the other machines. I have tried in both 
debug and release modes, and tried both copying the executable and building it 
on different machines, and so far it is consistent in that the deciding factor 
is which machining is running the program and not which machine it was built on.



I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but have 
tested on XP also).



Since the osg examples work just fine on the same machine, I guess it is 
something I have done in either the project settings or somewhere in the code, 
but I'm running out of ideas. If anybody have tried something like this, or 
knows what could cause this, I would very much appreciate it.


regards, and thanks in advance.

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


Re: [osg-users] osgText::readFontFile returns NULL on valid argument

2009-03-18 Thread Paul Melis

Jesper D. Thomsen wrote:

Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from 
this method:
 


osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);

If you set the environment variable OSG_NOTIFY_LEVEL to DEBUG (tip: run 
in a dos box) you should be able to see in which locations the font file 
is being searched


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


[osg-users] [forum] New feature: removed default email adress

2009-03-18 Thread Art Tevs
Hi Robert,

yes, I am talking about the filters. It is so, that this new feature use the 
Sender:  email header tag, which is widely used by spammers, to hide the real 
sender address. Hence, I was littel bit afraid if there could be some issues 
with this. However it seems that all thins goes fine now, so that we do not 
have to worry about them now.

Cheers,
art



robertosfield wrote:
 
 I'm not sure what you mean in your last sentence.  Are you talking about spam 
 filters?  If so the forum posts are getting through so far.
 


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





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


Re: [osg-users] osgText::readFontFile returns NULL on valid argument

2009-03-18 Thread Cole, Charles E. (LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY]
Hi Jesper,

 

My first inclination is that the path is incorrect, or at least doesn't
match with where the font file actually is.  With the code snippet you
listed, I believe that the file (and path) that you list must be
relative to your project's compiled executable.  That would be the first
thing that I'd check, and Paul's tip on adding the OSG_NOTIFY_LEVEL can
help if you can run your executable from a DOS window.  Another means of
checking is to place the font file in the same directory as your
executable and change the readFontFile parameter to just arial.ttf.
If that works, then that confirms that it's a path issue.

 

Hope that helps.

 

Chuck

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper
D. Thomsen
Sent: Wednesday, March 18, 2009 7:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] osgText::readFontFile returns NULL on valid
argument

 

Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from
this method:

 

osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);

 

The strange part is that when I compile and run the osgText and osgHud
examples, it works just fine (so it isn't the font-file which is
missing). It only happens in my own program. 
So far I have tested it on both Vista and XP machines in the office, and
this doesn't seem to affect the problem. However, my program works just
fine on a single XP machine, but not on any of the other machines. I
have tried in both debug and release modes, and tried both copying the
executable and building it on different machines, and so far it is
consistent in that the deciding factor is which machining is running the
program and not which machine it was built on.

 

I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but
have tested on XP also).

 

Since the osg examples work just fine on the same machine, I guess it is
something I have done in either the project settings or somewhere in the
code, but I'm running out of ideas. If anybody have tried something like
this, or knows what could cause this, I would very much appreciate it.

 

regards, and thanks in advance.

 

Jesper D. Thomsen

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


Re: [osg-users] osgText::readFontFile returns NULL on valid argument

2009-03-18 Thread Jesper D. Thomsen
Thank you for your answers.

I have actually found out that the problem is that my program can't find the 
osgdb_freetype.dll plugin, even though it is in the osgPlugins-2.6.1 directory 
in the private assembly I have created for OSG distribution. I'm currently 
messing about a bit with the manifests to try and get it to find it. Apparently 
it doesn't use it if I just add it to the manifest along with the osg48-osg.dll 
and other dll's, but if I place it in the same directory as my application it 
works just fine.

I don't want to have to add OSG to the path of the computer as I want to 
preserve backwards compatability when my program gets ported to a newer OSG 
version.
BTW: have anybody tried creating an OSG shared assembly?

Jesper D. Thomsen

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cole, Charles E. 
(LARC-B702)[RAYTHEON TECHNICAL SERVICES COMPANY] [charles.e.c...@nasa.gov]
Sent: Wednesday, March 18, 2009 1:54 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgText::readFontFile returns NULL on valid argument

Hi Jesper,

My first inclination is that the path is incorrect, or at least doesn’t match 
with where the font file actually is.  With the code snippet you listed, I 
believe that the file (and path) that you list must be relative to your 
project’s compiled executable.  That would be the first thing that I’d check, 
and Paul’s tip on adding the OSG_NOTIFY_LEVEL can help if you can run your 
executable from a DOS window.  Another means of checking is to place the font 
file in the same directory as your executable and change the readFontFile 
parameter to just “arial.ttf”.  If that works, then that confirms that it’s a 
path issue.

Hope that helps.

Chuck

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jesper D. 
Thomsen
Sent: Wednesday, March 18, 2009 7:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] osgText::readFontFile returns NULL on valid argument

Hi all, I have a rather strange problem.

I'm using osgText in my project, but I'm getting null as return from this 
method:


osgText::Font* t_font = osgText::readFontFile(fonts/arial.ttf);



The strange part is that when I compile and run the osgText and osgHud 
examples, it works just fine (so it isn't the font-file which is missing). It 
only happens in my own program.
So far I have tested it on both Vista and XP machines in the office, and this 
doesn't seem to affect the problem. However, my program works just fine on a 
single XP machine, but not on any of the other machines. I have tried in both 
debug and release modes, and tried both copying the executable and building it 
on different machines, and so far it is consistent in that the deciding factor 
is which machining is running the program and not which machine it was built on.



I'm using OSG 2.6.1 in Visual Studio 2005 sp1 on a Vista machine (but have 
tested on XP also).



Since the osg examples work just fine on the same machine, I guess it is 
something I have done in either the project settings or somewhere in the code, 
but I'm running out of ideas. If anybody have tried something like this, or 
knows what could cause this, I would very much appreciate it.

regards, and thanks in advance.

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


Re: [osg-users] [forum] New feature: removed default email adress

2009-03-18 Thread Robert Osfield
Hi Art,

On Wed, Mar 18, 2009 at 12:47 PM, Art Tevs arti_t...@yahoo.de wrote:

 yes, I am talking about the filters. It is so, that this new feature use
 the Sender:  email header tag, which is widely used by spammers, to hide
 the real sender address. Hence, I was littel bit afraid if there could be
 some issues with this. However it seems that all thins goes fine now, so
 that we do not have to worry about them now.


Mailman seems to be lettting the mail through fine, I do wonder about
mailing list subscribers - their clients might filter out the mail.

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


Re: [osg-users] Forum users rare uses signatures, which is a pain tracking who's who

2009-03-18 Thread Paul Speed
And I am using threading by subject and so they all end up in the same 
thread... but they are out of context within that thread since 
Thunderbird doesn't know which specific post to drop them off of.


A little annoying but at least it's a clear indicator that it is a forum 
post... and therefore likely to be only one or two lines without any 
inline reference to the previous post... and along the lines of Yeah, 
me too. or fifth post!!!... :)  I kid because I care. ;)


-Paul

Paul Melis wrote:

Hi,

Art Tevs wrote:
hmm, yes it seems there are no In-Reply-To header tag, when a message 
is sent through the forum. But I has never recieved any threading 
issue with the message, since my mail client is able to thread them by 
the subject. You are first who raised this issue ;), maybe your mail 
client has to be setted up properly,   
Actually, I use thunderbird and have specifically disabled 
threading-by-subject, as it simply does not work well enough and I have 
too many other mailboxes besides OSG where threading-by-subject would 
lead to incorrect results. I'm not going to enable it globally (and 
there doesn't seem to be a way in thunderbird to enable 
thread-by-subject for a single mailbox).  It happens quite frequently 
that a new thread is started with a subject that matches an older 
thread. With threading-by-subject the new messages will end up in the 
existing (unrelated) thread and therefore in the wrong place. Using the 
in-reply-to headers is the only reliable way to thread, although a few 
heuristics could probably help here.


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


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


[osg-users] OSG 2.8.1

2009-03-18 Thread Andy Skinner
I've built the OSG successfully, but it is going to take me longer to test it 
with our software.

Last time I just built it without updating with our code, and now I'm finding 
that I have to change some of our BoundingSphere code that doesn't compile.  
I'll give feedback on the 2.8.1 as soon as I can.

andy

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


[osg-users] where can i find the vertex positions?

2009-03-18 Thread Christian Sam
Hi,

i' m looking for a way to get the vertex positions of my geometry. i know there 
are methods, provided by osg, to access these vertex positions, but i wanted to 
get some insight how they are handled by osg, so i debugged a simple scene.

i found the geometry object along with the _primitives data member, 
referencing my 5 DrawArrays with the correct indexes. the debugger also 
showed me a _vertexData member, but i couldn't find any reference to the 
actual vertex positions. 

(i set my breakpoint in viewerbase.cpp in the ViewerBase::frame() at the 
eventTraversal() function.)
here is my .osg scene file:

Code:

LOD {
  nodeMask 0x
  cullingActive TRUE
  Radius -1
  RangeMode DISTANCE_FROM_EYE_POINT
  RangeList 1 {
0 1e+010
  }
  num_children 1
  Group {
nodeMask 0x
cullingActive TRUE
num_children 1
MatrixTransform {
  nodeMask 0x
  cullingActive TRUE
  StateSet {
DataVariance STATIC
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
GL_CULL_FACE ON
GL_LIGHTING OFF
CullFace {
  mode BACK
}
  }
  referenceFrame RELATIVE
  Matrix {
1 0 0 0
0 1 0 0
0 0 1 0
682985 5.21326e+006 0 1
  }
  num_children 1
  Geode {
nodeMask 0x
cullingActive TRUE
num_drawables 1
Geometry {
  PrimitiveSets 5
  {
DrawArrays LINE_STRIP 0 5
DrawArrays LINE_STRIP 5 5
DrawArrays LINE_STRIP 10 5
DrawArrays LINE_STRIP 15 5
DrawArrays LINE_STRIP 20 5
  }
  VertexArray Vec3Array 25
  {
218.39 263.092 0
   ...
-19.3272 -195.515 0
  }
  ColorBinding PER_VERTEX
  ColorArray Vec4Array 25
  {
0.001251 0.563585 0.193304 1
...
0.808741 0.585009 0.479873 1
  }
}
  }
}
  }
}




* where can i find them?

* and whats the prefered way to access them finally in my application? 
i think it can be done both with a visitor 
(osg::Drawable::AttributeFunctor::apply() like in the osgprerender example), 
and with a getChild().getVertexArray()

Thanks in advance,
christian

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





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


Re: [osg-users] osgviewerQT example

2009-03-18 Thread John Ivar Haugland
Hi,

I tried to set the QOSGWidget from the examples as central widget in a
QApplication (using setCentralWidget). It did not work (the central
widget  came up empty). Have anyone tried that before, or know what the
problem can be? (A single-threaded QGLWidget based widget will work, but the
QOSGWidget can use all threading models)
Platform: Windows XP 32bit, OpenSceneGraph 2.8.0, QT 4.3.3, Visual Studio
2008 Pro.
John Ivar Haugland
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] distant nodes in orthographic projection turn black

2009-03-18 Thread Peter Amstutz
I am having a puzzling problem that I hope someone might have some 
insight on what is happening:


My application renders a terrain using a top-down, orthographic view, 
and places various icons (simple flat meshes mostly) to represent 
simulation agents (soldiers and vehicles).  One of our testers noticed 
that when you zoom out to a certain distance where the icons are very 
small but still visible, sometimes some of the units (always the medium 
and small icons) turn black.  Zooming in restores the proper color.  It 
is very sensitive to the projection parameters, sometimes it is 
correctly rendered at moderate zoom, turns black after zooming out, and 
then is colored properly again after zooming out even more.


Some details:
The icons are ordinary geode nodes.  They use flat color materials, no 
textures.  The icons are composed of several submeshes, usually text on 
a background with a border.  It's hard to say, but usually only one of 
the submeshes turns black.


The camera is held at a fixed Z elevation, and zooming is accomplished 
by changing the orthographic projection parameters to have a wide view 
or a narrow view.  Panning on the XY axis changes only the XY camera 
position.


The scene is lit with a single downward-facing infinite light.  It casts 
(.8, .8, .8) colored ambient light.


I'm using the default setting for Near-Far culling plane.

Icons are scaled based on a logarithm function of the zoom level 
(meaning that at high zoom levels the icons are scaled up a bit from 
their natural sizes, but not linearly with the zoom level).  I scale the 
icons by updating the transform matrix and calling dirtyBounds().


This behavior is sensitive to the elevation of the camera.  When the 
camera was located at an elevation of 1 units (meters) many of the 
icons would exhibit this problem, when the camera was lowered to 1000 
units, fewer icons rendered improperly, and at 300 units everything 
rendered just fine.


So, tentatively the solution is simply to ensure that the camera is 
placed as close to the action as possible, but if anyone has any ideas 
as to what is really going on here, I would be very curious.  Perhaps I 
am running afoul of some small object optimization, that culls objects 
thought to be too small to show up on screen?


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


Re: [osg-users] OSG 2.8.1

2009-03-18 Thread Robert Osfield
HI Andy,

2009/3/18 Andy Skinner andy.skin...@mathworks.com

  I’ve built the OSG successfully, but it is going to take me longer to
 test it with our software.

Thanks for the testing.  Are you building against OSG-2.8.0 or the OSG-2.8
branch?

 Last time I just built it without updating with our code, and now I’m
 finding that I have to change some of our BoundingSphere code that doesn’t
 compile.  I’ll give feedback on the 2.8.1 as soon as I can.


What problems are you seeing with BoundingSphere code?   The main change was
the introduction of templates to enable use of double and float versions of
BoundingSphere.  The defaults should be the same as before though, i.e.
BoundingSphere - floating point BoundingSphere.


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


Re: [osg-users] Flat file (xyz points) reader writer plugin

2009-03-18 Thread Martin Beckett
It wasn't really finished/tested enough to be a submission.
So I posted it here to discuss/test it with other users. 
Then I noticed the plugins forum!

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





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


Re: [osg-users] distant nodes in orthographic projection turn black

2009-03-18 Thread Robert Osfield
Hi Peter,

Irratic changes of lighting + colour of objects in the scene as your move
the camera is typically due missing normals or colour arrays on the geometry
in the scene that is behaving oddly, as these missing arrays will mean that
their settings will be inherited from geometries that just happen to be
rendered before them.  Have a look at the problem geometry to see if that it
have any normal or colour arrays, and if they don't add them in.

Robert.

On Wed, Mar 18, 2009 at 2:41 PM, Peter Amstutz
peter.amst...@tseboston.comwrote:

 I am having a puzzling problem that I hope someone might have some insight
 on what is happening:

 My application renders a terrain using a top-down, orthographic view, and
 places various icons (simple flat meshes mostly) to represent simulation
 agents (soldiers and vehicles).  One of our testers noticed that when you
 zoom out to a certain distance where the icons are very small but still
 visible, sometimes some of the units (always the medium and small icons)
 turn black.  Zooming in restores the proper color.  It is very sensitive to
 the projection parameters, sometimes it is correctly rendered at moderate
 zoom, turns black after zooming out, and then is colored properly again
 after zooming out even more.

 Some details:
 The icons are ordinary geode nodes.  They use flat color materials, no
 textures.  The icons are composed of several submeshes, usually text on a
 background with a border.  It's hard to say, but usually only one of the
 submeshes turns black.

 The camera is held at a fixed Z elevation, and zooming is accomplished by
 changing the orthographic projection parameters to have a wide view or a
 narrow view.  Panning on the XY axis changes only the XY camera position.

 The scene is lit with a single downward-facing infinite light.  It casts
 (.8, .8, .8) colored ambient light.

 I'm using the default setting for Near-Far culling plane.

 Icons are scaled based on a logarithm function of the zoom level (meaning
 that at high zoom levels the icons are scaled up a bit from their natural
 sizes, but not linearly with the zoom level).  I scale the icons by updating
 the transform matrix and calling dirtyBounds().

 This behavior is sensitive to the elevation of the camera.  When the camera
 was located at an elevation of 1 units (meters) many of the icons would
 exhibit this problem, when the camera was lowered to 1000 units, fewer icons
 rendered improperly, and at 300 units everything rendered just fine.

 So, tentatively the solution is simply to ensure that the camera is placed
 as close to the action as possible, but if anyone has any ideas as to what
 is really going on here, I would be very curious.  Perhaps I am running
 afoul of some small object optimization, that culls objects thought to be
 too small to show up on screen?

 - Peter
 ___
 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] where can i find the vertex positions?

2009-03-18 Thread Peter Amstutz
If you're just interested in the vertices and not the mesh, you can look 
at osg::Geode, get the list of osg::Drawables, cast to osg::Geometry, 
then call osg::Geometry::getVertexArray().


Or you can use osg::TriangleFunctor to iterate over the triangles that 
make up the mesh, this provides you with osg::Vec3 triples representing 
each triangle.


There are likely other ways to get at this data as well, it depends on 
what you want to do with it.


Christian Sam wrote:

Hi,

i' m looking for a way to get the vertex positions of my geometry. i know there 
are methods, provided by osg, to access these vertex positions, but i wanted to 
get some insight how they are handled by osg, so i debugged a simple scene.

i found the geometry object along with the _primitives data member, referencing my 5 DrawArrays with the correct indexes. the debugger also showed me a _vertexData member, but i couldn't find any reference to the actual vertex positions. 


(i set my breakpoint in viewerbase.cpp in the ViewerBase::frame() at the 
eventTraversal() function.)
here is my .osg scene file:

Code:

LOD {
  nodeMask 0x
  cullingActive TRUE
  Radius -1
  RangeMode DISTANCE_FROM_EYE_POINT
  RangeList 1 {
0 1e+010
  }
  num_children 1
  Group {
nodeMask 0x
cullingActive TRUE
num_children 1
MatrixTransform {
  nodeMask 0x
  cullingActive TRUE
  StateSet {
DataVariance STATIC
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
GL_CULL_FACE ON
GL_LIGHTING OFF
CullFace {
  mode BACK
}
  }
  referenceFrame RELATIVE
  Matrix {
1 0 0 0
0 1 0 0
0 0 1 0
682985 5.21326e+006 0 1
  }
  num_children 1
  Geode {
nodeMask 0x
cullingActive TRUE
num_drawables 1
Geometry {
  PrimitiveSets 5
  {
DrawArrays LINE_STRIP 0 5
DrawArrays LINE_STRIP 5 5
DrawArrays LINE_STRIP 10 5
DrawArrays LINE_STRIP 15 5
DrawArrays LINE_STRIP 20 5
  }
  VertexArray Vec3Array 25
  {
218.39 263.092 0
   ...
-19.3272 -195.515 0
  }
  ColorBinding PER_VERTEX
  ColorArray Vec4Array 25
  {
0.001251 0.563585 0.193304 1
...
0.808741 0.585009 0.479873 1
  }
}
  }
}
  }
}




* where can i find them?

* and whats the prefered way to access them finally in my application? 
i think it can be done both with a visitor (osg::Drawable::AttributeFunctor::apply() like in the osgprerender example), and with a getChild().getVertexArray()


Thanks in advance,
christian

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





___
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] Setting alpha channel in Frag Shader does not work.

2009-03-18 Thread Steven Powers

danielh wrote:
 Try attaching a texture to the COLOR_BUFFER0 instead of an image directly.
 That's what worked for me.



Thats what this code is doing. I've written to COLOR_BUFFER0 and whenever I 
change the shader alpha value to something other than 1 all color values come 
back incorrect.

This will be read correctly:
 
Code:
gl_FragColor = vec4(1,2,3,4, 1);



But this will be read incorrectly:

Code:
gl_FragColor = vec4(1,2,3,4, .5);



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





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


Re: [osg-users] OSG 2.8.1

2009-03-18 Thread Andy Skinner
You know, I was thinking that using SVN was going to get me the latest, but I 
bet I'm just getting SVN from when 2.8.0 was made.  I'm using the line (copied 
from downloads page):

svn co 
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.8.0 
OpenSceneGraph

Was that the wrong thing?

First the BoundingSphere issue was me getting half old and  half new OSG.  I 
got past that and had a problem with BoundingBox, but that turned out to be 
from the forward declaration, and it isn't a class anymore.  Turns out the 
forward decl was unnecessary (we were already including Drawable), so I just 
removed it.

Let me know whether I need to do it again with a more recent version from SVN, 
and what specifically my command should be.

Thanks,
andy

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Wednesday, March 18, 2009 11:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] OSG 2.8.1

HI Andy,
2009/3/18 Andy Skinner 
andy.skin...@mathworks.commailto:andy.skin...@mathworks.com

I've built the OSG successfully, but it is going to take me longer to test it 
with our software.
Thanks for the testing.  Are you building against OSG-2.8.0 or the OSG-2.8 
branch?

Last time I just built it without updating with our code, and now I'm finding 
that I have to change some of our BoundingSphere code that doesn't compile.  
I'll give feedback on the 2.8.1 as soon as I can.

What problems are you seeing with BoundingSphere code?   The main change was 
the introduction of templates to enable use of double and float versions of 
BoundingSphere.  The defaults should be the same as before though, i.e. 
BoundingSphere - floating point BoundingSphere.


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


[osg-users] Arrays GPU memory - system memory selection.

2009-03-18 Thread paulo

Hi,
I'm imagining that there is a way to select if I want a vertex array to 
be on the GPU memory or on the main memory. RIght?


If so, how can I select that?
And while on ram, do we still need to make a call to dirty to update it?

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


Re: [osg-users] Draw a triangle with front and back faces

2009-03-18 Thread Ruqin Zhang
Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D triangular
mesh with osg. For some mesh, the calculated normal points
to the inside. So, I want to draw both the front and back faces, which have
opposite normals. Then you can render the mesh visible.
Is there an example of this? Thanks!

Ruqin

2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,

 The OSG uses exactly the same name conventions and state granularity as
 OpenGL, typically you just need to change glName to osg::Name to find the
 right class to work with.

 In your case are you simply looking for two sided lighting?

 Robert.

 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Hi,

 I am trying to draw a triangle with filled front and back faces. In this
 way,
 even the normal of it has a wrong direction, I can still have it rendered
 correctly.
 I know how to do this in OpenGL, while didn't figure it out in OSG. Has
 anyone
 done this before? Please help me out with some sample code. Thanks a lot!

 Ruqin

 ___
 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] question about qt example

2009-03-18 Thread Ben
Hi,

In the osgViewerQt example ther are 2 approaches, one with adapterwidget and 
one without adapterwidget .what is the differences between this 2 approaches 
using osg and Qt? What is the best way to use OSG in a widget in a Qt  
mainwindows application

Thanks.

Ben

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





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


Re: [osg-users] distant nodes in orthographic projection turn black

2009-03-18 Thread Peter Amstutz
It's not erratic, it's pretty strongly correlated to the projection 
matrix settings (determining the zoom level), camera distance and size 
of the icon.


I looked at the icon model, from inspecting the .osg file (converted 
from .ive with osgconv) it appears that the relevant state settings are:


 GL_CULL_FACE ON
 GL_LIGHTING ON
 GL_NORMALIZE ON
 Material {
   DataVariance STATIC
   ColorMode OFF
   ambientColor 1 0 0 1
   diffuseColor 1 0 0 1
   specularColor 0 0 0 1
   emissionColor 0 0 0 1
   shininess 0
 }
From what I can tell from reading the OpenGL documentation and looking 
at the OSG code, this means it should ignore any per-vertex colors and 
just use the material settings, correct?  Does it still need a color array?


The normals looks fine:
   NormalBinding PER_VERTEX
   NormalArray Vec3Array 6
   {
 0 0 1
 0 0 1
 0 0 1
 0 0 1
 0 0 1
 0 0 1
   }

The original .ive file was produced using OSGExp with 3D Studio Max 2008 
(the plugin is still using OSG 1.2, though.)I don't have much 
control over whether it outputs materials or per-vertex colors, unless I 
go and noodle around with the nodes in code after loading them.  I 
suppose I could modify a file by hand to see if it makes a difference.


Another thing I noticed is that all the icons go black just before the 
camera zooms far enough that the icons are too small to render -- 
although in that case, it isn't very noticeable because the icons are 
already only a few pixels across on screen.


Also, I forgot to mention in my previous email but I'm using Open Scene 
Graph 2.6.1.


Thanks,
- Peter

Robert Osfield wrote:

Hi Peter,

Irratic changes of lighting + colour of objects in the scene as your 
move the camera is typically due missing normals or colour arrays on 
the geometry in the scene that is behaving oddly, as these missing 
arrays will mean that their settings will be inherited from geometries 
that just happen to be rendered before them.  Have a look at the 
problem geometry to see if that it have any normal or colour arrays, 
and if they don't add them in.


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] Shader aliasing

2009-03-18 Thread Wallerman Anders
Hi all,

We are drawing textured terrain tiles, and want to write a shader that uses 
different code paths for different types of terrain. Water surfaces, for 
instance, are to be drawn differently than forested surfaces. To do this we 
have a texture with different discrete values for different classes of terrain 
as a basis for selecting code path.

In the shader, it is obviously not possible to simply use an if statement, and 
select code path depending on values in the classification texture, since that 
would introduce aliasing.

To reduce aliasing I tried to reduce the frequency by filtering the texture 
like this:

vec2 distx = dFdx(texcoord);
vec2 disty = dFdy(texcoord);
float r = texture2D(classmap,texcoord-distx) + 
texture2D(classmap,texcoord+distx) +
texture2D(classmap,texcoord-disty) + 
texture2D(classmap,texcoord+disty) +
texture2D(classmap,texcoord-distx-disty) + 
texture2D(classmap,texcoord+distx+disty) +
texture2D(classmap,texcoord-distx+disty) + 
texture2D(classmap,texcoord+distx-disty) +
texture2D(classmap,texcoord)*2.0;
r = r/10.0;
...and using the value r as basis for the final fragment color. (In this case, 
the classmap only contains two values (0 and 1) and aliasing could be removed 
by using mipmap filtering etc of the classmap texture, but we will extend this 
into using more classes, and then normal texture filtering can't be used. I 
hope this illustrates the aliasing problem anyway.)

This filter is probably too simple, but am I on the correct path? Is it 
possible to create a filter that reduces the aliasing to an acceptable level, 
and if so, what should it look like?

I can't be the first one that wants to use terrain class maps like this, how is 
it generally done?

We're using OSG 2.6.1, RHEL 5.1 and GTX280.

Regards;
Anders Wallerman, Saab AB, Sweden

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


Re: [osg-users] OSG 2.8.1

2009-03-18 Thread Robert Osfield
Hi Andy,

2009/3/18 Andy Skinner andy.skin...@mathworks.com

  You know, I was thinking that using SVN was going to get me the latest,
 but I bet I’m just getting SVN from when 2.8.0 was made.  I’m using the line
 (copied from downloads page):

 svn co
 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.8.0OpenSceneGraph



 Was that the wrong thing?


You're just picking up on the 2.8.0 tag, which is effectively set is stone
now as it maps directly to what the 2.8.0 binaries etc. were built from.

The version of test against is the OSG-2.8 branch, this is what we used to
source the 2.8.0 tag, and where all the patches for the ongoing 2.8.x series
have been applied, and when it comes to making 2.8.1 it'll be sourced
directly from the OSG-2.8.  To get the OSG-2.8 branch us:

svn co 
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8
http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8
OpenSceneGraph-2.8http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.8OpenSceneGraph

2.8 in theory should be like 2.8.0 except for a number of bug fixes that've
been applied.

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


Re: [osg-users] osgShadowMap Problems

2009-03-18 Thread Ricky Do
I moved light source under Shadowed Scene Node but it's still the same:
http://i475.photobucket.com/albums/rr113/tek3D/shadow-1.jpg
What could I do to fix it?


Ricky Do

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





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


Re: [osg-users] Draw a triangle with front and back faces

2009-03-18 Thread Robert Osfield
Hi Ruqin,

2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D
 triangular mesh with osg. For some mesh, the calculated normal points
 to the inside. So, I want to draw both the front and back faces, which have
 opposite normals. Then you can render the mesh visible.
 Is there an example of this? Thanks!


Are you talking about two face lighting of back face culling here??
Originally your email sounded like you were talking about lighting at back
face culling has nothing to do with normals, but this new emails sounds like
you might be refering to back face culling...

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


Re: [osg-users] distant nodes in orthographic projection turn black

2009-03-18 Thread Robert Osfield
Hi Peter,

I would try attaching a single colour entry to the osg::Geometry to see if
that makes any difference.  Also try toggling lighting on/off to see if that
makes any difference.

The only other thing I can think of that might be an issue is mip mapping -
are the problem geometries texture mapped?  Is so could it be that mip
mapping is doing something odd?  Try switching off mipmapping for the
textures to see.  Some OpenGL drivers have bugging mipmapping
implementations.

Robert.

On Wed, Mar 18, 2009 at 4:05 PM, Peter Amstutz
peter.amst...@tseboston.comwrote:

 It's not erratic, it's pretty strongly correlated to the projection matrix
 settings (determining the zoom level), camera distance and size of the icon.

 I looked at the icon model, from inspecting the .osg file (converted from
 .ive with osgconv) it appears that the relevant state settings are:

 GL_CULL_FACE ON
 GL_LIGHTING ON
 GL_NORMALIZE ON
 Material {
   DataVariance STATIC
   ColorMode OFF
   ambientColor 1 0 0 1
   diffuseColor 1 0 0 1
   specularColor 0 0 0 1
   emissionColor 0 0 0 1
   shininess 0
 }
 From what I can tell from reading the OpenGL documentation and looking at
 the OSG code, this means it should ignore any per-vertex colors and just use
 the material settings, correct?  Does it still need a color array?

 The normals looks fine:
   NormalBinding PER_VERTEX
   NormalArray Vec3Array 6
   {
 0 0 1
 0 0 1
 0 0 1
 0 0 1
 0 0 1
 0 0 1
   }

 The original .ive file was produced using OSGExp with 3D Studio Max 2008
 (the plugin is still using OSG 1.2, though.)I don't have much control
 over whether it outputs materials or per-vertex colors, unless I go and
 noodle around with the nodes in code after loading them.  I suppose I could
 modify a file by hand to see if it makes a difference.

 Another thing I noticed is that all the icons go black just before the
 camera zooms far enough that the icons are too small to render -- although
 in that case, it isn't very noticeable because the icons are already only a
 few pixels across on screen.

 Also, I forgot to mention in my previous email but I'm using Open Scene
 Graph 2.6.1.

 Thanks,
 - Peter

 Robert Osfield wrote:

 Hi Peter,

 Irratic changes of lighting + colour of objects in the scene as your move
 the camera is typically due missing normals or colour arrays on the geometry
 in the scene that is behaving oddly, as these missing arrays will mean that
 their settings will be inherited from geometries that just happen to be
 rendered before them.  Have a look at the problem geometry to see if that it
 have any normal or colour arrays, and if they don't add them in.

 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] osgShadowMap Problems

2009-03-18 Thread Robert Osfield
Hi Ricky,

Does osgshadow work for you?  Try it out with your model.

Robert.

2009/3/18 Ricky Do tuandov...@gmail.com

 I moved light source under Shadowed Scene Node but it's still the same:
 http://i475.photobucket.com/albums/rr113/tek3D/shadow-1.jpg
 What could I do to fix it?

 
 Ricky Do

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





 ___
 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] Draw a triangle with front and back faces

2009-03-18 Thread Ruqin Zhang
Sorry about the confusion. Here is the openGL code that works:

*triangle t;*
*const float* pFltArrayN = t.getNormal();*
*const float* pFltArray1 = t.getVert1();*
*const float* pFltArray2 = t.getVert2();*
*const float* pFltArray3 = t.getVert3();*

*glNormal3fv(pFltArrayN);*
*glVertex3fv(pFltArray1);*
*glVertex3fv(pFltArray2);*
*glVertex3fv(pFltArray3);*
**
*a[0] = -pFltArrayN[0];*
*a[1] = -pFltArrayN[1];*
*a[2] = -pFltArrayN[2];*
*glNormal3fv(a);*
*glVertex3fv(pFltArray3);*
*glVertex3fv(pFltArray2);*
*glVertex3fv(pFltArray1);*

I tried to do the same thing in osg, here is my code:

*osg::ref_ptrosg::Material material = new osg::Material();
material-setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4f(0.00f,0.00f,0.00f,0.00f));
osg::ref_ptrosg::PolygonMode polymode = new osg::PolygonMode();
polymode-setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::FILL);
osg::ref_ptrosg::StateSet stateset = new osg::StateSet();
stateset-setAttributeAndModes(material.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
stateset-setAttributeAndModes(polymode.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
stateset-setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
stateset-setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
*

*for(int j = 0; j  mesh-getNumTriangles(); j ++)*
*{*
*osg::DrawElementsUInt* frontTriElement = new
osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
*frontTriElement-push_back(mesh-getTri(j).getVert1Index());*
*frontTriElement-push_back(mesh-getTri(j).getVert2Index());*
*frontTriElement-push_back(mesh-getTri(j).getVert3Index());*
*meshGeometry-addPrimitiveSet(frontTriElement);*
*osg::Vec3f normalVec(mesh-getTri(j).getNormalVec3().x,
mesh-getTri(j).getNormalVec3().y,*
*
mesh-getTri(j).getNormalVec3().z);*
*normalArray-push_back(normalVec);*

*osg::DrawElementsUInt* backTriElement = new
osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
*backTriElement-push_back(mesh-getTri(j).getVert3Index());*
*backTriElement-push_back(mesh-getTri(j).getVert2Index());*
*backTriElement-push_back(mesh-getTri(j).getVert1Index());*
*meshGeometry-addPrimitiveSet(backTriElement);*
*normalArray-push_back(-normalVec);*
*}*
*meshGeometry-setStateSet(stateset.get());*
*meshGeometry-setVertexArray(vertexArray.get());*
*meshGeometry-setNormalArray(normalArray.get());*
*meshGeometry-setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);*

While seems this doesn't work. Any problem or mistake? Thanks a lot!

Ruqin


2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,

 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D
 triangular mesh with osg. For some mesh, the calculated normal points
 to the inside. So, I want to draw both the front and back faces, which
 have opposite normals. Then you can render the mesh visible.
 Is there an example of this? Thanks!


 Are you talking about two face lighting of back face culling here??
 Originally your email sounded like you were talking about lighting at back
 face culling has nothing to do with normals, but this new emails sounds like
 you might be refering to back face culling...

 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] Draw a triangle with front and back faces

2009-03-18 Thread Robert Osfield
Hi Ruqin,

I'm not going to review your code as it's pointless, it's not seeing the
wood from the trees.  Answer the question I asked, is it back face culling
that you are talking about??  In your OpenGL app did you enable/disable back
face culling?

Robert.

2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Sorry about the confusion. Here is the openGL code that works:

 *triangle t;*
 *const float* pFltArrayN = t.getNormal();*
 *const float* pFltArray1 = t.getVert1();*
 *const float* pFltArray2 = t.getVert2();*
 *const float* pFltArray3 = t.getVert3();*

 *glNormal3fv(pFltArrayN);*
 *glVertex3fv(pFltArray1);*
 *glVertex3fv(pFltArray2);*
 *glVertex3fv(pFltArray3);*
 **
 *a[0] = -pFltArrayN[0];*
 *a[1] = -pFltArrayN[1];*
 *a[2] = -pFltArrayN[2];*
 *glNormal3fv(a);*
 *glVertex3fv(pFltArray3);*
 *glVertex3fv(pFltArray2);*
 *glVertex3fv(pFltArray1);*

 I tried to do the same thing in osg, here is my code:

 *osg::ref_ptrosg::Material material = new osg::Material();

 material-setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4f(0.00f,0.00f,0.00f,0.00f));
 osg::ref_ptrosg::PolygonMode polymode = new osg::PolygonMode();
 polymode-setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::FILL);
 osg::ref_ptrosg::StateSet stateset = new osg::StateSet();

 stateset-setAttributeAndModes(material.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setAttributeAndModes(polymode.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
 *

 *for(int j = 0; j  mesh-getNumTriangles(); j ++)*
 *{*
 *osg::DrawElementsUInt* frontTriElement = new
 osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
 *frontTriElement-push_back(mesh-getTri(j).getVert1Index());*
 *frontTriElement-push_back(mesh-getTri(j).getVert2Index());*
 *frontTriElement-push_back(mesh-getTri(j).getVert3Index());*
 *meshGeometry-addPrimitiveSet(frontTriElement);*
 *osg::Vec3f normalVec(mesh-getTri(j).getNormalVec3().x,
 mesh-getTri(j).getNormalVec3().y,*
 *
 mesh-getTri(j).getNormalVec3().z);*
 *normalArray-push_back(normalVec);*

 *osg::DrawElementsUInt* backTriElement = new
 osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
 *backTriElement-push_back(mesh-getTri(j).getVert3Index());*
 *backTriElement-push_back(mesh-getTri(j).getVert2Index());*
 *backTriElement-push_back(mesh-getTri(j).getVert1Index());*
 *meshGeometry-addPrimitiveSet(backTriElement);*
 *normalArray-push_back(-normalVec);*
 *}*
 *meshGeometry-setStateSet(stateset.get());*
 *meshGeometry-setVertexArray(vertexArray.get());*
 *meshGeometry-setNormalArray(normalArray.get());*
 *meshGeometry-setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);*

 While seems this doesn't work. Any problem or mistake? Thanks a lot!

 Ruqin


 2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,


 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D
 triangular mesh with osg. For some mesh, the calculated normal points
 to the inside. So, I want to draw both the front and back faces, which
 have opposite normals. Then you can render the mesh visible.
 Is there an example of this? Thanks!


 Are you talking about two face lighting of back face culling here??
 Originally your email sounded like you were talking about lighting at back
 face culling has nothing to do with normals, but this new emails sounds like
 you might be refering to back face culling...

 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


[osg-users] how to force databasepager before drawing

2009-03-18 Thread Fabien Dachicourt

Hi all,
To make a snapshot i would need to wait for all pagedlod loading before 
drawing,
The databasepager getRequestsInProgress() works well during real time 
rendering, and returns false when everything is loaded, but how could i 
wait for all pagedlod loading without drawing ?


I tried an update/cull loop, but it sometimes locks with remaining file 
requests (FileRequestListSize  0).


Is there anything to do to force the databasepager to handle all 
requests before drawing ?


Thanks for any help
Fabien


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


Re: [osg-users] osgShadowMap Problems

2009-03-18 Thread Ricky Do
I tried with many models but the shadow is not exact like in the pic:
http://i475.photobucket.com/albums/rr113/tek3D/shadow-2.jpg
Is there any problem with my code?
Regard!


Ricky Do

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





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


Re: [osg-users] Draw a triangle with front and back faces

2009-03-18 Thread Ruqin Zhang
Yes, the openGL code enabled the back face culling. I think I didn't do this
in osg, my bad. Where should I look for back face culling in osg?
Something in example? Thanks!

Ruqin

2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,

 I'm not going to review your code as it's pointless, it's not seeing the
 wood from the trees.  Answer the question I asked, is it back face culling
 that you are talking about??  In your OpenGL app did you enable/disable back
 face culling?

 Robert.


 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Sorry about the confusion. Here is the openGL code that works:

 *triangle t;*
 *const float* pFltArrayN = t.getNormal();*
 *const float* pFltArray1 = t.getVert1();*
 *const float* pFltArray2 = t.getVert2();*
 *const float* pFltArray3 = t.getVert3();*

 *glNormal3fv(pFltArrayN);*
 *glVertex3fv(pFltArray1);*
 *glVertex3fv(pFltArray2);*
 *glVertex3fv(pFltArray3);*
 **
 *a[0] = -pFltArrayN[0];*
 *a[1] = -pFltArrayN[1];*
 *a[2] = -pFltArrayN[2];*
 *glNormal3fv(a);*
 *glVertex3fv(pFltArray3);*
 *glVertex3fv(pFltArray2);*
 *glVertex3fv(pFltArray1);*

 I tried to do the same thing in osg, here is my code:

 *osg::ref_ptrosg::Material material = new osg::Material();

 material-setEmission(osg::Material::FRONT_AND_BACK,osg::Vec4f(0.00f,0.00f,0.00f,0.00f));
 osg::ref_ptrosg::PolygonMode polymode = new osg::PolygonMode();

 polymode-setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::FILL);
 osg::ref_ptrosg::StateSet stateset = new osg::StateSet();

 stateset-setAttributeAndModes(material.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setAttributeAndModes(polymode.get(),osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 stateset-setTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
 *

 *for(int j = 0; j  mesh-getNumTriangles(); j ++)*
 *{*
 *osg::DrawElementsUInt* frontTriElement = new
 osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
 *frontTriElement-push_back(mesh-getTri(j).getVert1Index());*
 *frontTriElement-push_back(mesh-getTri(j).getVert2Index());*
 *frontTriElement-push_back(mesh-getTri(j).getVert3Index());*
 *meshGeometry-addPrimitiveSet(frontTriElement);*
 *osg::Vec3f normalVec(mesh-getTri(j).getNormalVec3().x,
 mesh-getTri(j).getNormalVec3().y,*
 *
 mesh-getTri(j).getNormalVec3().z);*
 *normalArray-push_back(normalVec);*

 *osg::DrawElementsUInt* backTriElement = new
 osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES,0);*
 *backTriElement-push_back(mesh-getTri(j).getVert3Index());*
 *backTriElement-push_back(mesh-getTri(j).getVert2Index());*
 *backTriElement-push_back(mesh-getTri(j).getVert1Index());*
 *meshGeometry-addPrimitiveSet(backTriElement);*
 *normalArray-push_back(-normalVec);*
 *}*
 *meshGeometry-setStateSet(stateset.get());*
 *meshGeometry-setVertexArray(vertexArray.get());*
 *meshGeometry-setNormalArray(normalArray.get());*
 *meshGeometry-setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);*

 While seems this doesn't work. Any problem or mistake? Thanks a lot!

 Ruqin


 2009/3/18 Robert Osfield robert.osfi...@gmail.com

 Hi Ruqin,


 2009/3/18 Ruqin Zhang ruzh...@gmail.com

 Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D
 triangular mesh with osg. For some mesh, the calculated normal points
 to the inside. So, I want to draw both the front and back faces, which
 have opposite normals. Then you can render the mesh visible.
 Is there an example of this? Thanks!


 Are you talking about two face lighting of back face culling here??
 Originally your email sounded like you were talking about lighting at back
 face culling has nothing to do with normals, but this new emails sounds like
 you might be refering to back face culling...

 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


___
osg-users mailing list
osg-users@lists.openscenegraph.org

Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-18 Thread J.P. Delport

Hi,

I haven't read your code, but I'm sure alpha channel works just fine.

Attached is a modified osgmultiplerendertargets example. Run it with
osgmultiplerendertargets --image
which should print a=128

or with
osgmultiplerendertargets --hdr --image
which should print a=-1.1

You can adjust the values in gl_FragData[0].

rgds
jp


Steven Powers wrote:

danielh wrote:

Try attaching a texture to the COLOR_BUFFER0 instead of an image directly.
That's what worked for me.




Thats what this code is doing. I've written to COLOR_BUFFER0 and whenever I 
change the shader alpha value to something other than 1 all color values come 
back incorrect.

This will be read correctly:
 
Code:

gl_FragColor = vec4(1,2,3,4, 1);



But this will be read incorrectly:

Code:
gl_FragColor = vec4(1,2,3,4, .5);



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





___
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] FFmpeg plugin

2009-03-18 Thread Carlos Sanches
Hi Robert.
I m seeing that my /usr/local/lib/osgPlugins-2.9.1  directory dont have the
plugin for ffmpeg .
this is correct ?
I put this in my code ...
std::string libName =
osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
osgDB::Registry::instance()-loadLibrary(libName);

but how I know if it is using ffmpeg ?

tks




2009/3/16 Robert Osfield robert.osfi...@gmail.com

 Hi Carlos,

 Have a look at the osgmovie example for guidance, it'll boil down to
 reading a image, and assing to the a textured quad.  Right now you'll need
 to preload the ffmpeg plugin as osgDB won't yet automatically alias the
 movie extensions to ffmpeg.  On the movie command line you use the option -e
 ffmpeg to pre load the plugin.  Programatically you'd use:

 std::string libName =
 osgDB::Registry::instance()-createLibraryNameForExtension(ffmpeg);
 osgDB::Registry::instance()-loadLibrary(libName);

 Robert.

 2009/3/16 Carlos Sanches ces...@gmail.com


 Hi all !
 I downloaded osg 2.9.1 . I m using  pImageStream =
 dynamic_castosg::ImageStream*(hudImage);
 to open a movie.
 What have I to do to use ffmpeg to read my movies ?

 tks




 ___
 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] Setting alpha channel in Frag Shader does not work.

2009-03-18 Thread Steven Powers
Thanks JP but I dont see any attached code.

Also I'm running OSG 2.2 which doesnt have the multiplerendertargets example.

Could this be a bug with OSG2.2 ??

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





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


[osg-users] getDistanceToViewPoint not implemented in osgUtil::IntersectionVisitor

2009-03-18 Thread Jason Beverage
Hi Robert,

I'm using LOD's in one of my apps to control the distance at which models
first begin to appear and noticed that the IntersectionVisitor will still
hit these nodes even if they are not visible.

I tried setting the LODSelectionMode to
USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION but it still selected invisible
nodes.  After looking through the code I noticed that the
getDistanceToViewPoint function is used by the LOD class but is not
implemented by the IntersectionVisitor, so will always have the value of 0.

I made a small class deriving from IntersectionVisitor that just returned
getDistanceToEyePoint (which is overriden by IntersectionVisitor) and things
seemed to behave more appropriately.

class MyIntersectionVisitor : public osgUtil::IntersectionVisitor
{
public:
MyIntersectionVisitor(osgUtil::Intersector* intersector=0,
osgUtil::IntersectionVisitor::ReadCallback* readCallback=0)
:IntersectionVisitor(intersector, readCallback)
{
}

virtual float getDistanceToViewPoint(const osg::Vec3 pos, bool
useLODScale) const
{
   return getDistanceToEyePoint(pos, useLODScale);
}
};

Would this change, or something similar, be appropriate for inclusions in
OSG?

Thanks!

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


[osg-users] My own main loop witout viewer.run()

2009-03-18 Thread Вячеслав
Hi,

I learn osg now and want to use it for 3D-game. So the architecture based on 
viewer.run() can't be used.
In OpenSceneGraph Quick Start Guide about other approach was explained in a 
pretty general sense:

 3.1 Rendering
 OSG doesn’t hide any functionality. OSG exposes the lowest levels of its 
 functionality
 to your application. If you want complete scene graph rendering control, you 
 can write
 code to perform the following operations in your application.
  •   Develop your own view management code to modify the OpenGL model-
  view matrix.
  •   Create a window and an OpenGL context, and make them current. Write 
 the
  code to manage multiple windows and contexts if your application 
 requires it.
  •   If your application uses paged databases, start the 
 osgDB::DatabasePager.
  •   Instantiate osgUtil::UpdateVisitor, osgUtil::CullVisitor, and
  osgUtil::RenderStage objects to implement the update, cull, and draw
  traversals. If you really want total control, design your own 
 classes to perform
  these traversals.
  •   Write a main loop that handles events from the operating system. 
 Call into
  your view code to update the model-view matrix.
  •   Call glClear() before rendering a frame. Execute update, cull, and 
 draw
  ...


So how to use osg as a complement to OpenGL but without letting osg to control 
OpenGL (and my main loop) fully?
Any references will be helpful.

Thank you.

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





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


Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-18 Thread J.P. Delport

the file

J.P. Delport wrote:

Hi,

I haven't read your code, but I'm sure alpha channel works just fine.

Attached is a modified osgmultiplerendertargets example. Run it with
osgmultiplerendertargets --image
which should print a=128

or with
osgmultiplerendertargets --hdr --image
which should print a=-1.1

You can adjust the values in gl_FragData[0].

rgds
jp


Steven Powers wrote:

danielh wrote:
Try attaching a texture to the COLOR_BUFFER0 instead of an image 
directly.

That's what worked for me.




Thats what this code is doing. I've written to COLOR_BUFFER0 and 
whenever I change the shader alpha value to something other than 1 all 
color values come back incorrect.


This will be read correctly:
 
Code:

gl_FragColor = vec4(1,2,3,4, 1);



But this will be read incorrectly:

Code:
gl_FragColor = vec4(1,2,3,4, .5);



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





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


/* OpenSceneGraph example, osgmultiplerendertargets.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the Software), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

#include osg/GLExtensions
#include osg/Node
#include osg/Geometry
#include osg/Notify
#include osg/MatrixTransform
#include osg/Texture2D
#include osg/TextureRectangle
#include osg/ColorMask
#include osg/Material

#include osgGA/TrackballManipulator
#include osgGA/FlightManipulator
#include osgGA/DriveManipulator

#include osgViewer/Viewer

#include iostream
#include stdio.h

//
// Below is relatively straight forward example of using the OpenGL multiple render targets (MRT) extension
// to FrameBufferObjects/GLSL shaders.
//
// Another, more sophisticated MRT example can be found in the osgstereomatch example.
//


// The callback modifies an input image.
struct MyCameraPostDrawCallback : public osg::Camera::DrawCallback
{
MyCameraPostDrawCallback(osg::Image* image):
_image(image)
{
}

virtual void operator () (const osg::Camera /*camera*/) const
{
if (_image  _image-getPixelFormat()==GL_RGBA  _image-getDataType()==GL_UNSIGNED_BYTE)
{
// we'll pick out the center 1/2 of the whole image,
int column_start = _image-s()/4;
int column_end = 3*column_start;

int row_start = _image-t()/4;
int row_end = 3*row_start;

// and then halve their contribution
for(int r=row_start; rrow_end; ++r)
{
unsigned char* data = _image-data(column_start, r);
for(int c=column_start; ccolumn_end; ++c)
{
(*data) = (*data)/2; ++data;
(*data) = (*data)/2; ++data;
(*data) = (*data)/2; ++data;
(*data) = 255; ++data;
}
}

_image-dirty();

//print out the first three values
unsigned char* data = (unsigned char*)_image-data(0, 0);
fprintf(stderr,Unsigned char pixel data: r %d g %d b %d a %d\n, data[0], data[1], data[2], data[3]);
}
else if (_image  _image-getPixelFormat()==GL_RGBA  _image-getDataType()==GL_FLOAT)
{
// we'll pick out the center 1/2 of the whole image,
int column_start = _image-s()/4;
int column_end = 3*column_start;

int row_start = _image-t()/4;
int row_end = 3*row_start;

// and then halve their contribution
for(int r=row_start; rrow_end; ++r)
{

Re: [osg-users] Setting alpha channel in Frag Shader does not work.

2009-03-18 Thread J.P. Delport

Hi,

sorry, I can't remember when the MRT support was added, you'll have to 
search the archives.


You'll have to modify the example to not use MRT to see if it can work 
with gl_FragColor and a single color buffer attached.


jp

Steven Powers wrote:

Thanks JP but I dont see any attached code.

Also I'm running OSG 2.2 which doesnt have the multiplerendertargets example.

Could this be a bug with OSG2.2 ??

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





___
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] [build] osgdb_freetype build problem on Mac OS/X 10.5.6

2009-03-18 Thread john casu
Robert,

I put debugging messages in FindFreeType.cmake, and the behavior is as expected 
within that cmake file, i.e. FREETYPE_INCLUDE_DIRS gets set correctly.

The issue, as far as I can tell, is why cmake on os/x either isn't exporting 
FREETYPE_INCLUDE_DIRS, or there's a typo somewhere outside that file so that 
the variable isn't getting picked up.

I spent a little time trying to debug this, but I'm not really getting 
anywhere, given that I have little cmake experience.  But, everything does seem 
to be working as expected, so it's a little bit of a mystery. 

certainly, the code in Find3rdPartyDependencies.cmake doesn't seem to be 
traversed, and src/osgPlugins/freetype/CMakeLists.txt seems to be correct.

Unfortunately, I don't have enough time, right now, to devote to debugging this 
in any depth.   And since I do have a workaround, I'm not blocked.

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





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


Re: [osg-users] where can i find the vertex positions?

2009-03-18 Thread Christian Sam
hi,

thanks for the hints, after searching for some of the terms i stumbled over 
http://www.openscenegraph.org/projects/osg/wiki/Support/ProgrammingGuide/AnalysingAScenegraph;
 which proved very helpful. (maybe someone references it in the tutorial 
section)

best regards,
christian

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





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


Re: [osg-users] My own main loop witout viewer.run()

2009-03-18 Thread Art Tevs
Hi, Слава

have you already took a look in to the OSG Faq, can be found here 
http://www.3drealtimesimulation.com/osg/osg_faq_1.htm
It is pretty old, but maybe there are some usefull information for you.

I've attached some part of my code, which uses OSG without the viewer.run() 
method. I know this is out of context, however maybe this would be helpfull for 
you. Take a look into ViewerTask::updateTask() method.

Cheers,
art

P.S. Please write your name with latin letters (Vjacheslav) or similar, because 
we are like to have some neutral language in the community. Спасибо за 
понимание ;)

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



/***
 * *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or *
 *   (at your option) any later version.   *
 * *
 ***/

#include ViewerTask.h
#include App.h

using namespace nrEngine;

//--
SharedPtrViewerTask ViewerTask::mSingleton;

//--
ViewerTask* ViewerTask::instance()
{
if (mSingleton == NULL)
mSingleton.reset(new ViewerTask(App::instance()));
return mSingleton.get();
}

//--
SharedPtrViewerTask ViewerTask::shared_instance(bool release)
{
if (mSingleton == NULL) mSingleton.reset(new ViewerTask(App::instance()));
if (release == true) mSingleton.reset();

return mSingleton;
}

#if 1
//
ScriptFunctionDec(resizeWindow, ViewerTask)
{
// check if the parameter count is valid
if (args.size() = 2  param.size() != 1){
return ScriptResult(std::string(resizeWindow(w,h) - wrong parameter count));
}

// convert the given values
nrEngine::int32 width = 0;
nrEngine::int32 height = 0;
try{
width = boost::lexical_castnrEngine::int32(args[1]);
height = boost::lexical_castnrEngine::int32(args[2]);
}catch(...){
return ScriptResult(std::string(Given values are not valid!));
}

// get viewer of the application
ViewerTask* viewer = ScriptEngine::parameter_castViewerTask*(param[0]);
osgViewer::Viewer::Windows windows;
viewer-getWindows(windows);

// resize window
windows[0]-setWindowRectangle(0,0,width,height);
viewer-mApp-mWindowWidth = width;
viewer-mApp-mWindowHeight = height;

return ScriptResult();
}

//
ScriptFunctionDec(setWindowTitle, ViewerTask)
{
// check if the parameter count is valid
if (args.size() = 1  param.size() != 1){
return ScriptResult(std::string(setWindowTitle(title) - wrong parameter count));
}

// combine the values
std::string title;
for (uint32 i=1; i  args.size(); i++)
title += (args[i] +  );

// get viewer of the application
ViewerTask* viewer = ScriptEngine::parameter_castViewerTask*(param[0]);
osgViewer::Viewer::Windows windows;
viewer-getWindows(windows);

// set title
windows[0]-setWindowName(title);

return ScriptResult();
}

//
ScriptFunctionDec(openWindow, ViewerTask)
{

// check if the parameter count is valid
if (args.size() = 3  param.size() != 1){
return ScriptResult(std::string(openWindow(w,h,full[,bpp,depth,stencil]) - wrong parameter count));
}

// convert given values
int32 w,h;
int32 bpp = 32;
int32 depth = 16;
int32 stencil = 8;
bool full = false;

try{

w = boost::lexical_castint32(args[1]);
h = boost::lexical_castint32(args[2]);
full = boost::lexical_castbool(args[3]);
if (args.size()  4) bpp = boost::lexical_castint32(args[4]);
if (args.size()  5) depth = boost::lexical_castint32(args[5]);
if (args.size()  6) stencil = boost::lexical_castint32(args[6]);

}catch(...){
return ScriptResult(std::string(Wrong parameters used!));
}

// get viewer of the application
ViewerTask* viewer = ScriptEngine::parameter_castViewerTask*(param[0]);

osg::DisplaySettings* display = viewer-getDisplaySettings();
if (display == NULL) display = new osg::DisplaySettings;

// create window
if (full == false)
{
unsigned int 

Re: [osg-users] osgviewerQT example

2009-03-18 Thread John Ivar Haugland
 I forgot to initialize the ViewerQOSG with a pointer (this) to the
QMainWindow  _viewer = new ViewerQOSG(this). It is ok now.
John Ivar Haugland

On Wed, Mar 18, 2009 at 3:20 PM, John Ivar Haugland john.haugl...@gmail.com
 wrote:

 Hi,

 I tried to set the QOSGWidget from the examples as central widget in a
 QApplication (using setCentralWidget). It did not work (the central
 widget  came up empty). Have anyone tried that before, or know what the
 problem can be? (A single-threaded QGLWidget based widget will work, but the
 QOSGWidget can use all threading models)
 Platform: Windows XP 32bit, OpenSceneGraph 2.8.0, QT 4.3.3, Visual Studio
 2008 Pro.
 John Ivar Haugland

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


Re: [osg-users] osgShadowMap Problems

2009-03-18 Thread Ulrich Hertlein

Hi Ricky,

On 19/3/09 4:36 AM, Ricky Do wrote:

I tried with many models but the shadow is not exact like in the pic:
http://i475.photobucket.com/albums/rr113/tek3D/shadow-2.jpg
Is there any problem with my code?


Look's like it (sorry ;-)

Please test osgshadow (with your model and its default scene).
If that is okay then it's problem in your code.  (If osgshadow shows a problem as well 
then it might be a driver issue.)


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


Re: [osg-users] OpenGL EXTENSION support

2009-03-18 Thread Ben Axelrod
I just get them right out of OpenGL.  But you have to have the current OpenGL 
context.

const char* extensions = (const char*)glGetString(GL_EXTENSIONS);

-Ben


From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of ami guru
Sent: Wednesday, March 18, 2009 5:09 PM
To: OpenSceneGraph Users
Subject: [osg-users] OpenGL EXTENSION support

Hello forum,

Is there any class or interface in OSG that can query and print out the 
supported extensions within the OpenGL driver ?


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