Re: [osg-users] Shader composer and position state

2013-09-05 Thread Robert Milharcic

On 4.9.2013 15:39, Robert Osfield wrote:

Hi Robert,

When implementing the osg::ShaderComposer functionality I had in mind that
ability to have a custom StateAttribute/ShaderAttribute::apply() compute
the view dependent uniform state and apply this to the osg::State.  The
apply() method would get the modelview matrix from the osg::State and apply
this to the local uniform before passing it on to osg::State.


Might this work for you?


No, I don't think so. I'm basically trying to implement a special 
uniform or maybe custom shader attribute, having a global scope, but to 
be set localy at the node or stateset. Special uniform would then be 
multiplied with a local modelview matrix and applied to all programs.  
This is analogus to position state handling already implemented for FFP 
(LightSource/Light for example).


Best Regards
Robert Milharcic


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


[osg-users] osgText::Text, a question about line breaker \n

2013-09-05 Thread Fan ZHANG
Hi all,

Sorry to disturb but I have a question about the line breaker '\n'.

If I use text-setText(This is the first line \n This is the second line);

It works and gets the result as:

This is the first line
This is the second line

But if I read the string from a variable, it does not work, namely,

String str = This is the first line \n This is the second line;
text-setText(str);

The result will be:

This is the first line \n This is the second line


Anyone knows why and how to deal with it?

I have to read lots of texts from external files.
So it is impossible to do it in the first way to directly put the texts there, 
but to read texts each time.



Thanks in advance for any kind reply!

Cheers,

Fan

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





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


Re: [osg-users] osgText::Text, a question about line breaker \n

2013-09-05 Thread Sebastian Messerschmidt

Hi Fan,

Could you try:

String str = This is the first line \\n This is the second line;
text-setText(str);

(note the double \)

cheers
Sebastian

Hi all,

Sorry to disturb but I have a question about the line breaker '\n'.

If I use text-setText(This is the first line \n This is the second line);

It works and gets the result as:

This is the first line
This is the second line

But if I read the string from a variable, it does not work, namely,

String str = This is the first line \n This is the second line;
text-setText(str);

The result will be:

This is the first line \n This is the second line


Anyone knows why and how to deal with it?

I have to read lots of texts from external files.
So it is impossible to do it in the first way to directly put the texts there, 
but to read texts each time.



Thanks in advance for any kind reply!

Cheers,

Fan

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





___
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] osgText::Text, a question about line breaker n

2013-09-05 Thread Fan ZHANG
Thanks for your reply but it still does not work:(



Sebastian Messerschmidt wrote:
 Hi Fan,
 
 Could you try:
 
 String str = This is the first line \\n This is the second line;
 text-setText(str);
 
 (note the double \)
 
 cheers
 Sebastian
 
  Hi all,
  
  Sorry to disturb but I have a question about the line breaker '\n'.
  
  If I use text-setText(This is the first line \n This is the second line);
  
  It works and gets the result as:
  
  This is the first line
  This is the second line
  
  But if I read the string from a variable, it does not work, namely,
  
  String str = This is the first line \n This is the second line;
  text-setText(str);
  
  The result will be:
  
  This is the first line \n This is the second line
  
  
  Anyone knows why and how to deal with it?
  
  I have to read lots of texts from external files.
  So it is impossible to do it in the first way to directly put the texts 
  there, but to read texts each time.
  
  
  
  Thanks in advance for any kind reply!
  
  Cheers,
  
  Fan
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=56110#56110
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


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





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


Re: [osg-users] osgText::Text, a question about line breaker n

2013-09-05 Thread Wojciech Lewandowski
Hi,

Its just a guess, but I believe your call:
   text-setText(This is the first line \n This is the second line);
is done implicit conversion to std::string and calling following method:
  TextBase::setText( const std::string  );
so in your code I would try declaring str variable as std::string (not a
String as you did).

Cheers,
Wojtek Lewandowski




2013/9/5 Fan ZHANG oceane...@gmail.com

 Thanks for your reply but it still does not work:(



 Sebastian Messerschmidt wrote:
  Hi Fan,
 
  Could you try:
 
  String str = This is the first line \\n This is the second line;
  text-setText(str);
 
  (note the double \)
 
  cheers
  Sebastian
 
   Hi all,
  
   Sorry to disturb but I have a question about the line breaker '\n'.
  
   If I use text-setText(This is the first line \n This is the second
 line);
  
   It works and gets the result as:
  
   This is the first line
   This is the second line
  
   But if I read the string from a variable, it does not work, namely,
  
   String str = This is the first line \n This is the second line;
   text-setText(str);
  
   The result will be:
  
   This is the first line \n This is the second line
  
  
   Anyone knows why and how to deal with it?
  
   I have to read lots of texts from external files.
   So it is impossible to do it in the first way to directly put the
 texts there, but to read texts each time.
  
  
  
   Thanks in advance for any kind reply!
  
   Cheers,
  
   Fan
  
   --
   Read this topic online here:
   http://forum.openscenegraph.org/viewtopic.php?p=56110#56110
  
  
  
  
  
   ___
   osg-users mailing list
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 
  ___
  osg-users mailing list
 
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
   --
  Post generated by Mail2Forum


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





 ___
 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] osgText::Text, a question about line breaker n

2013-09-05 Thread Fan ZHANG
Thanks for your reply.

In my codes, I did declare it as std::String str.

Just simply put String here to illustrate:)


Wojtek wrote:
 Hi,
 
 
 Its just a guess, but I believe your call:   text-setText(This is the first 
 line n This is the second line);
 is done implicit conversion to std::string and calling following method:
   TextBase::setText( const std::string  );
 
 so in your code I would try declaring str variable as std::string (not a 
 String as you did).
 
 
 Cheers,
 Wojtek Lewandowski
 
 
 
 
 
 
 2013/9/5 Fan ZHANG  ()
 
  Thanks for your reply but it still does not work:(
  
  
  
  Sebastian Messerschmidt wrote:
  
   Hi Fan,
   
   Could you try:
   
   String str = This is the first line \n This is the second line;
   text-setText(str);
   
   (note the double )
   
   cheers
   Sebastian
   
   
Hi all,

Sorry to disturb but I have a question about the line breaker 'n'.

If I use text-setText(This is the first line n This is the second 
line);

It works and gets the result as:

This is the first line
This is the second line

But if I read the string from a variable, it does not work, namely,

String str = This is the first line n This is the second line;
text-setText(str);

The result will be:

This is the first line n This is the second line


Anyone knows why and how to deal with it?

I have to read lots of texts from external files.
So it is impossible to do it in the first way to directly put the texts 
there, but to read texts each time.



Thanks in advance for any kind reply!

Cheers,

Fan

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





___
osg-users mailing list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)


   
   ___
   osg-users mailing list
   
   http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
   (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
   
    --
   Post generated by Mail2Forum
   
  
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=56116#56116 
  (http://forum.openscenegraph.org/viewtopic.php?p=56116#56116)
  
  
  
  
  
  ___
  osg-users mailing list
   ()
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
  
 
 
  --
 Post generated by Mail2Forum


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





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


Re: [osg-users] osgText::Text, a question about line breaker n

2013-09-05 Thread Wojciech Lewandowski
Hi,

Hmm, still have doubts. Because of uppercase String name yu just wrote.
std::String does not exist. I would be ok, though, if you wrote you did
declare it as std::string (lowercase) ;-). But lets assume you did just
that and it still does not work, so then I would suggest to enter setText
call with debugger and see what version of it is called. Is it setText(
const osgText::String  ) or setText( const std::string  ) or
setText(const wchar_t* text) ? See which one is this and then select proper
type as your type for declaring str variable.

Cheers,
Wojtek


2013/9/5 Fan ZHANG oceane...@gmail.com

 Thanks for your reply.

 In my codes, I did declare it as std::String str.

 Just simply put String here to illustrate:)


 Wojtek wrote:
  Hi,
 
 
  Its just a guess, but I believe your call:   text-setText(This is the
 first line n This is the second line);
  is done implicit conversion to std::string and calling following method:
TextBase::setText( const std::string  );
 
  so in your code I would try declaring str variable as std::string (not a
 String as you did).
 
 
  Cheers,
  Wojtek Lewandowski
 
 
 
 
 
 
  2013/9/5 Fan ZHANG  ()
 
   Thanks for your reply but it still does not work:(
  
  
  
   Sebastian Messerschmidt wrote:
  
Hi Fan,
   
Could you try:
   
String str = This is the first line \n This is the second line;
text-setText(str);
   
(note the double )
   
cheers
Sebastian
   
   
 Hi all,

 Sorry to disturb but I have a question about the line breaker 'n'.

 If I use text-setText(This is the first line n This is the
 second line);

 It works and gets the result as:

 This is the first line
 This is the second line

 But if I read the string from a variable, it does not work, namely,

 String str = This is the first line n This is the second line;
 text-setText(str);

 The result will be:

 This is the first line n This is the second line


 Anyone knows why and how to deal with it?

 I have to read lots of texts from external files.
 So it is impossible to do it in the first way to directly put the
 texts there, but to read texts each time.



 Thanks in advance for any kind reply!

 Cheers,

 Fan

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





 ___
 osg-users mailing list


 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org(
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)


   
___
osg-users mailing list
   
   
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org(
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
   
 --
Post generated by Mail2Forum
   
  
  
   --
   Read this topic online here:
   http://forum.openscenegraph.org/viewtopic.php?p=56116#56116 (
 http://forum.openscenegraph.org/viewtopic.php?p=56116#56116)
  
  
  
  
  
   ___
   osg-users mailing list
()
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org(
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
  
 
 
   --
  Post generated by Mail2Forum


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





 ___
 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] osgText::Text, a question about line breaker n

2013-09-05 Thread Fan ZHANG
Forgive my silly typo, I did mean std::string.

It is strange that now

std::string str = This is the first line \n This is 
the second line;
text-setText(str);
works!!!

I don't know why it failed two hours ago.

But if I change the str content with things read from external files, the \n 
does not work again'(

When creating the external text files, I already added the breaker into the 
contents.

Thanks anyway!!!




Wojtek wrote:
 Hi,
 
 Hmm, still have doubts. Because of uppercase String name yu just wrote. 
 std::String does not exist. I would be ok, though, if you wrote you did 
 declare it as std::string (lowercase) ;-). But lets assume you did just that 
 and it still does not work, so then I would suggest to enter setText call 
 with debugger and see what version of it is called. Is it setText( const 
 osgText::String  ) or setText( const std::string  ) or setText(const 
 wchar_t* text) ? See which one is this and then select proper type as your 
 type for declaring str variable.
 
 
 Cheers,
 Wojtek
 
 
 
 2013/9/5 Fan ZHANG  ()
 
  Thanks for your reply.
  
  In my codes, I did declare it as std::String str.
  
  Just simply put String here to illustrate:)
  
  
  Wojtek wrote:
  
   Hi,
   
   
   Its just a guess, but I believe your call:   text-setText(This is the 
   first line n This is the second line);
   is done implicit conversion to std::string and calling following method:
     TextBase::setText( const std::string  );
   
   so in your code I would try declaring str variable as std::string (not a 
   String as you did).
   
   
   Cheers,
   Wojtek Lewandowski
   
   
   
   
   
   
   
  
  
   2013/9/5 Fan ZHANG  ()
   
   
Thanks for your reply but it still does not work:(



Sebastian Messerschmidt wrote:


 Hi Fan,
 
 Could you try:
 
 String str = This is the first line n This is the second line;
 text-setText(str);
 
 (note the double )
 
 cheers
 Sebastian
 
 
 
  Hi all,
  
  Sorry to disturb but I have a question about the line breaker 'n'.
  
  If I use text-setText(This is the first line n This is the second 
  line);
  
  It works and gets the result as:
  
  This is the first line
  This is the second line
  
  But if I read the string from a variable, it does not work, namely,
  
  String str = This is the first line n This is the second line;
  text-setText(str);
  
  The result will be:
  
  This is the first line n This is the second line
  
  
  Anyone knows why and how to deal with it?
  
  I have to read lots of texts from external files.
  So it is impossible to do it in the first way to directly put the 
  texts there, but to read texts each time.
  
  
  
  Thanks in advance for any kind reply!
  
  Cheers,
  
  Fan
  
  --
  Read this topic online here:
  
 

   
  
  
  
   

 
  http://forum.openscenegraph.org/viewtopic.php?p=56110#56110 
  (http://forum.openscenegraph.org/viewtopic.php?p=56110#56110) 
  (http://forum.openscenegraph.org/viewtopic.php?p=56110#56110 
  (http://forum.openscenegraph.org/viewtopic.php?p=56110#56110))
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
   
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
   
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
   
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
  
  
  
 
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
  
 (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
 
  --
 Post generated by Mail2Forum
 
 


--
Read this topic online here:

   
  
  
   
http://forum.openscenegraph.org/viewtopic.php?p=56116#56116 
(http://forum.openscenegraph.org/viewtopic.php?p=56116#56116) 
(http://forum.openscenegraph.org/viewtopic.php?p=56116#56116 
(http://forum.openscenegraph.org/viewtopic.php?p=56116#56116))





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

Re: [osg-users] osgText::Text, a question about line breaker n

2013-09-05 Thread Fan ZHANG
Here is what I get:

Set the text using a std::string,  which is converted to an internal TextString.

I think I should find out the secret of TextString.



Oceane wrote:
 Forgive my silly typo, I did mean std::string.
 
 It is strange that now
 
   std::string str = This is the first line \n This is 
 the second line;
   text-setText(str);
 works!!!
 
 I don't know why it failed two hours ago.
 
 But if I change the str content with things read from external files, the \n 
 does not work again'(
 
 When creating the external text files, I already added the breaker into the 
 contents.
 
 Thanks anyway!!!
 
 
 
 
 Wojtek wrote:
  Hi,
  
  Hmm, still have doubts. Because of uppercase String name yu just wrote. 
  std::String does not exist. I would be ok, though, if you wrote you did 
  declare it as std::string (lowercase) ;-). But lets assume you did just 
  that and it still does not work, so then I would suggest to enter setText 
  call with debugger and see what version of it is called. Is it setText( 
  const osgText::String  ) or setText( const std::string  ) or 
  setText(const wchar_t* text) ? See which one is this and then select proper 
  type as your type for declaring str variable.
  
  
  Cheers,
  Wojtek
  
  
  
  2013/9/5 Fan ZHANG  ()
  
   Thanks for your reply.
   
   In my codes, I did declare it as std::String str.
   
   Just simply put String here to illustrate:)
   
   
   Wojtek wrote:
   
Hi,


Its just a guess, but I believe your call:   text-setText(This is the 
first line n This is the second line);
is done implicit conversion to std::string and calling following method:
  TextBase::setText( const std::string  );

so in your code I would try declaring str variable as std::string (not 
a String as you did).


Cheers,
Wojtek Lewandowski







   
   
2013/9/5 Fan ZHANG  ()


 Thanks for your reply but it still does not work:(
 
 
 
 Sebastian Messerschmidt wrote:
 
 
  Hi Fan,
  
  Could you try:
  
  String str = This is the first line n This is the second line;
  text-setText(str);
  
  (note the double )
  
  cheers
  Sebastian
  
  
  
   Hi all,
   
   Sorry to disturb but I have a question about the line breaker 'n'.
   
   If I use text-setText(This is the first line n This is the 
   second line);
   
   It works and gets the result as:
   
   This is the first line
   This is the second line
   
   But if I read the string from a variable, it does not work, 
   namely,
   
   String str = This is the first line n This is the second line;
   text-setText(str);
   
   The result will be:
   
   This is the first line n This is the second line
   
   
   Anyone knows why and how to deal with it?
   
   I have to read lots of texts from external files.
   So it is impossible to do it in the first way to directly put the 
   texts there, but to read texts each time.
   
   
   
   Thanks in advance for any kind reply!
   
   Cheers,
   
   Fan
   
   --
   Read this topic online here:
   
  
 

   
   
   

 
  
   http://forum.openscenegraph.org/viewtopic.php?p=56110#56110 
   (http://forum.openscenegraph.org/viewtopic.php?p=56110#56110) 
   (http://forum.openscenegraph.org/viewtopic.php?p=56110#56110 
   (http://forum.openscenegraph.org/viewtopic.php?p=56110#56110))
   
   
   
   
   
   ___
   osg-users mailing list
   
   http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

   (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)

   (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

   (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
   
   
   
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
   
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
   
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
   
  (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
  
   --
  Post generated by Mail2Forum
  
  
 
 
 --
 Read this topic online here:
 

   
   

 http://forum.openscenegraph.org/viewtopic.php?p=56116#56116 
 (http://forum.openscenegraph.org/viewtopic.php?p=56116#56116) 
 

Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Chris Stankevitz
On Wed, Sep 4, 2013 at 5:47 PM, Roland Hill
roland.h...@fourwindstechnology.com.au wrote:
 In point 7, while you pass a raw Camera* to viewer.addSlave, you will
 probably find that it then stores that pointer in a
 osg::ref_ptrosg::Camera, which then increments the reference count.
 Therefore the reference count is decremented to 1 (not 0) at the end of the
 block.

Roland,

Thank you.  I did not expect that behavior, although I knew I was
wrong about something.  There must be some interesting plumbing that
allows an osg::ref_ptr being constructed from a raw pointer inside
osg::viewer to recognize that there is another osg::ref_ptr inside
main() that holds the same raw pointer.  I do not see any mechanism
for this in the ref_ptr header. :-/

Thanks again,

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


Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Chris Stankevitz
On Thu, Sep 5, 2013 at 6:26 AM, Chris Stankevitz
chrisstankev...@gmail.com wrote:
 Thank you.  I did not expect that behavior, although I knew I was
 wrong about something.  There must be some interesting plumbing that
 allows

I see now.  osg::ref_ptr is more like an intrusive_ptr than a
shared_ptr.  The reference counts are stored within the object, not
within the smart pointer.

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


Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Sebastian Messerschmidt

Hi Chris,

On Wed, Sep 4, 2013 at 5:47 PM, Roland Hill
roland.h...@fourwindstechnology.com.au wrote:

In point 7, while you pass a raw Camera* to viewer.addSlave, you will
probably find that it then stores that pointer in a
osg::ref_ptrosg::Camera, which then increments the reference count.
Therefore the reference count is decremented to 1 (not 0) at the end of the
block.

Roland,

Thank you.  I did not expect that behavior, although I knew I was
wrong about something.  There must be some interesting plumbing that
allows an osg::ref_ptr being constructed from a raw pointer inside
osg::viewer to recognize that there is another osg::ref_ptr inside
main() that holds the same raw pointer.  I do not see any mechanism
for this in the ref_ptr header. :-/


This doesn't require any magic. The pointer is not a shared but an 
intrusive pointer.

So reference count is inside the Referenced object not in the pointer.

cheers
Sebastian



Thanks again,

Chris
___
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] osgText::Text, a question about line breaker n

2013-09-05 Thread Fan ZHANG
Problem solved!

Because I read texts from XML files, so I just put '
' instead of '\n'.

Thanks for all the replies above!

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





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


Re: [osg-users] OSG errors when running on a virtual machine

2013-09-05 Thread Marcel Pursche
Hi,

it looks like the driver in your virtual machine does not support OpenGL =2.0. 
The function pointers for some newer features can not be found. So things like 
shaders, occlusion queries, framebuffers and instancing will not work.
If fear there is nothing much you can do about that. You can only try to update 
VMWare, VirtualBox or whatever product you are using and hope it fixes the 
problem. The 3D hardware acceleration in a virtual machine is generally not 
that good. 

Thank you!

Cheers,
Marcel

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





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


Re: [osg-users] OSG errors when running on a virtual machine

2013-09-05 Thread Marcel Pursche
Hi,

according to the homepage of VMWare they support DirectX 9.0 and OpenGL 2.1 and 
VirtualBox has DirectX 9.0 and OpenGL(no version mentioned) support.
So hardware accelaration should work, if a new version of VMWare or VirtualBox 
is used.

Thank you!

Cheers,
Marcel

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





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


[osg-users] Winding up to the OpenSceneGraph-3.2.1 stable release

2013-09-05 Thread Robert Osfield
Hi All,

This month I'm planning on making a OpenSceneGraph-3.2.1 that will wrap up
some bug and build fixes that slipped through testing of 3.2.0.

I believe the OpenSceneGraph-3.2 branch in subversion should be pretty
close to 3.2.1 now so believe it's a good time for the community to start
testing this branch with a view to make tagging a 3.2.1-rc1 in the next
week.

The branch to test is:

http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2

Could users test this branch on their systems and against their
applications and let me know of success/failure. If this look to be
cleaning and running cleanly I'll tag 3.2.1-rc1 and start making prep for
the 3.2.1 release.

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


Re: [osg-users] OSG errors when running on a virtual machine

2013-09-05 Thread Jordi Torres
Hi Marcel,


2013/9/5 Marcel Pursche marcel.purs...@student.hpi.uni-potsdam.de

 Hi,

 according to the homepage of VMWare they support DirectX 9.0 and OpenGL
 2.1 and VirtualBox has DirectX 9.0 and OpenGL(no version mentioned) support.
 So hardware accelaration should work, if a new version of VMWare or
 VirtualBox is used.


Don't expect the drivers of the virtual machine for OpenGL to be fully
implemented. They may not have all extensions or features you need. At
least not yet.

Cheers.



 Thank you!

 Cheers,
 Marcel

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





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




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


[osg-users] Short-circuiting 3rd party lib detection

2013-09-05 Thread James Turner
Hello,

I need to short-circuit the CMake detection of FreeType, for annoying reasons 
on Mac (users being pestered to install Xquartz at odd points during the app 
when the osgFT plugin is loaded).

OSG_3RDPARTY_BIN seems like it was designed to do this, based on my reading of 
Find3rdPartyDependencies.cmake, but there's no examples of using it anywhere 
that Google can find. Can someone provide one?

I have:

workspace/dist
lib/
include/
workspace/OpenSceneGraph
(the source checkout)
workspace/osgbuild
(my build dir I'm running cmake from)

'dist' contains the compiled+installed FreeType files. workspace/dist is also 
the CMAKE_INSTALL_PREFIX. I am guessing I can simply set OSG_3RDPARTY_BIN to 
workspace/dist, but I'd like to be sure (I am trying it anyway).

The freetype detection seems a little complex (lots of freetypeXYZ version 
directories being probed), is this to deal with binary freetype releases on 
WIndows maybe?

Regards,
James

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


Re: [osg-users] OSG errors when running on a virtual machine

2013-09-05 Thread Aurelien Albert
Hi,

I've got some bad experience with virtual machines.


 The 3D hardware acceleration in a virtual machine is generally not that good.


In fact, hardware acceleration is usualy not available at all on a Virtual 
Machine. Because this is a virtual machine.

Just like a remote session on windows : you can't access directly to the 
hardware.

There is 2 potential solutions :
 - try finding a virtual macine system which allow direct access to the 
hardware (don't know the status, but NVidia made a lot of efforts on this since 
last year)
 - try a full software openGL implementation, like MESA


Cheers,
Aurelien

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





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


[osg-users] Android build fails with osg from git

2013-09-05 Thread Preet
Hiya,

I think some of the recent code wrt osgPresentation is causing the Android
build to fail. Here's my cmake config call:

cmake \
-DOSG_BUILD_PLATFORM_ANDROID=ON \
-DANDROID_NDK=/home/preet/Dev/env/sys/android-ndk-r8e \
-DCMAKE_INSTALL_PREFIX=/home/preet/Dev/env/android/osg-git-debug \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOSG_GL_LIBRARY_STATIC=OFF \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DOSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_PLATFORM=8 \
-DANDROID_STL=gnustl_shared \
-DANDROID_DEBUG=ON \
../osg-src

Here's the resulting error:
make[3]: *** No rule to make target
`/home/preet/Downloads/build/osg/src/osgPresentation/Model.cpp', needed by
`obj/local/armeabi-v7a/objs-debug/osgPresentation/Model.o'.  Stop.

Also... I get a bunch of warnings during compile (unrelated to the
presentation error -- this is with older commits as well). The following
line is output 100's of times.

Android NDK: WARNING: Invalid LOCAL_CPP_EXTENSION values: cpp

This doesn't seem normal... Should I be concerned about it?


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


Re: [osg-users] Short-circuiting 3rd party lib detection

2013-09-05 Thread James Turner

On 5 Sep 2013, at 17:23, James Turner zakal...@mac.com wrote:

 OSG_3RDPARTY_BIN seems like it was designed to do this, based on my reading 
 of Find3rdPartyDependencies.cmake, but there's no examples of using it 
 anywhere that Google can find. Can someone provide one?

My reading was wrong, I've seen the code that searches sourcedir/../3rdparty 
now. This mechanism seems very Windows-centric, so I'm left wondering the 
correct way to tailor *just* the FreeType detection without disturbing anything 
else.

Regards,
James

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


Re: [osg-users] Short-circuiting 3rd party lib detection

2013-09-05 Thread Robert Osfield
Hi James,

The Find3rdPartyDepedendencies.cmake is written specific for Windows
pre-built dependency package and isn't appropriate for other platforms.
Other platforms we just rely on the standard CMake find scripts to find
each dependencies independently.

If the default Cmake find scripts don't find the lib you are looking from
using ccmake . to bring up the console based UI for setting various build
variables such as paths to the 3rd Party libs.

Robert.


On 5 September 2013 16:40, James Turner zakal...@mac.com wrote:


 On 5 Sep 2013, at 17:23, James Turner zakal...@mac.com wrote:

 OSG_3RDPARTY_BIN seems like it was designed to do this, based on my
 reading of Find3rdPartyDependencies.cmake, but there's no examples of using
 it anywhere that Google can find. Can someone provide one?


 My reading was wrong, I've seen the code that searches
 sourcedir/../3rdparty now. This mechanism seems very Windows-centric, so
 I'm left wondering the correct way to tailor *just* the FreeType detection
 without disturbing anything else.

 Regards,
 James


 ___
 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] Android build fails with osg from git

2013-09-05 Thread Robert Osfield
Hi Preet,

Yesterday afternoon I missed a svn add for the Model.cpp, this morning I
fixed it, so you should you be able to do a update and get the Model.cpp,
unless the git mirror is falling behind too much, in which case I'd suggest
using svn/trunk.

Robert.


On 5 September 2013 16:37, Preet prismatic.proj...@gmail.com wrote:

 Hiya,

 I think some of the recent code wrt osgPresentation is causing the Android
 build to fail. Here's my cmake config call:

 cmake \
 -DOSG_BUILD_PLATFORM_ANDROID=ON \
 -DANDROID_NDK=/home/preet/Dev/env/sys/android-ndk-r8e \
 -DCMAKE_INSTALL_PREFIX=/home/preet/Dev/env/android/osg-git-debug \
 -DOSG_GL1_AVAILABLE=OFF \
 -DOSG_GL2_AVAILABLE=OFF \
 -DOSG_GL3_AVAILABLE=OFF \
 -DOSG_GLES1_AVAILABLE=OFF \
 -DOSG_GLES2_AVAILABLE=ON \
 -DOSG_GL_LIBRARY_STATIC=OFF \
 -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
 -DOSG_GL_MATRICES_AVAILABLE=OFF \
 -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
 -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
 -DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
 -DANDROID_ABI=armeabi-v7a \
 -DANDROID_PLATFORM=8 \
 -DANDROID_STL=gnustl_shared \
 -DANDROID_DEBUG=ON \
 ../osg-src

 Here's the resulting error:
 make[3]: *** No rule to make target
 `/home/preet/Downloads/build/osg/src/osgPresentation/Model.cpp', needed by
 `obj/local/armeabi-v7a/objs-debug/osgPresentation/Model.o'.  Stop.

 Also... I get a bunch of warnings during compile (unrelated to the
 presentation error -- this is with older commits as well). The following
 line is output 100's of times.

 Android NDK: WARNING: Invalid LOCAL_CPP_EXTENSION values: cpp

 This doesn't seem normal... Should I be concerned about it?


 Preet

 ___
 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] Short-circuiting 3rd party lib detection

2013-09-05 Thread James Turner

On 5 Sep 2013, at 17:43, Robert Osfield robert.osfi...@gmail.com wrote:

 If the default Cmake find scripts don't find the lib you are looking from 
 using ccmake . to bring up the console based UI for setting various build 
 variables such as paths to the 3rd Party libs.
 

This is an automated build scenario, so that's not possible unfortunately.  I'm 
investigating if Eric Wing's tweaks to FindFreeType work as described 
(CMAKE_PATH_PREFIX is searched first)

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


Re: [osg-users] Short-circuiting 3rd party lib detection

2013-09-05 Thread Robert Osfield
Hi James,


On 5 September 2013 17:38, James Turner zakal...@mac.com wrote:

 This is an automated build scenario, so that's not possible unfortunately.
  I'm investigating if Eric Wing's tweaks to FindFreeType work as described
 (CMAKE_PATH_PREFIX is searched first)


You can set various variables for finding dependencies via env vars, these
gives hints to the CMake find scripts or provide the settings directly.
Alternatively you can pass these in as command line parameters with
-DVAR=VALUE  when invoking CMake.

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


Re: [osg-users] Android build fails with osg from git

2013-09-05 Thread Preet
Hmm. Even with the osgPresentation issue fixed, I'm unable to build the
libs

I get hundreds of errors like:

/home/preet/Dev/env/sys/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:
./obj/local/armeabi-v7a/objs-debug/osgDB/SharedStateManager.o: in function
construction vtable for
osg::NodeVisitor-in-osgDB::SharedStateManager:SharedStateManager.cpp(.
data.rel.ro+0x158): error: undefined reference to 'virtual thunk to
osg::NodeVisitor::~NodeVisitor()'
/home/preet/Dev/env/sys/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:
./obj/local/armeabi-v7a/objs-debug/osgDB/SharedStateManager.o: in function
construction vtable for
osg::NodeVisitor-in-osgDB::SharedStateManager:SharedStateManager.cpp(.
data.rel.ro+0x15c): error: undefined reference to 'virtual thunk to
osg::NodeVisitor::~NodeVisitor()'
/home/preet/Dev/env/sys/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:
./obj/local/armeabi-v7a/objs-debug/osgDB/Version.o: in function
osgDBGetVersion:/home/preet/Downloads/build/osg-3.2.0/src/osgDB/Version.cpp:20:
error: undefined reference to 'osgGetVersion'
collect2: ld returned 1 exit status
make[3]: *** [obj/local/armeabi-v7a/libosgDB.so] Error 1
make[2]: *** [Android-OpenSceneGraph] Error 2
make[1]: *** [CMakeFiles/ndk.dir/all] Error 2


I thought this might be related to:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2013-July/063911.html

But I'm having issues building the libs -- haven't gotten to the part where
I try out an example yet... in any case, I tried adding a

LOCAL_LDFLAGS :=
/home/preet/Dev/env/sys/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a
(or shared ... I tried to build both but they both fail at the same point)

to the top level Android.mk file in the cmake build dir but that doesn't
help.

Any advice would be appreciated.


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


Re: [osg-users] osg::ref_ptr: Why isn't it deleting my camera?

2013-09-05 Thread Roland Hill

  
  
Chris,
  
  Yes. To use osg::ref_ptr the object has to be derived from
  osg::Object. That's where the reference count code is.
  
  Roland
  
  


-- 
  ROLAND HILL
  Director
  Four Winds
  Technology Pty Ltd
  Ph/Fax :
  +61
  (0)2 6366 9425
  Mobile:
  +61 (0)41 880 7472
  roland.h...@fourwindstechnology.com.au
  
  

Privacy
  and
  Confidentiality Notice
The information
contained
herein and any attachments are intended solely for the named
recipients. It may contain privileged confidential
information. If you
are not an intended recipient, please delete the message and
any
attachments then notify the sender of miss-delivery. Any use
or
disclosure of the contents of either is unauthorised and may
be
unlawful. All liability for viruses are excluded to the
fullest extent
permitted by law.

  
  On 05/09/13 23:41, Chris Stankevitz wrote:


  On Thu, Sep 5, 2013 at 6:26 AM, Chris Stankevitz
chrisstankev...@gmail.com wrote:

  
Thank you.  I did not expect that behavior, although I knew I was
wrong about something.  There must be some interesting plumbing that
allows

  
  
I see now.  osg::ref_ptr is more like an intrusive_ptr than a
shared_ptr.  The reference counts are stored within the object, not
within the smart pointer.

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