Re: [osg-users] screen capture with multiple cameras

2007-11-23 Thread Berg, Michael
sherman wilcox wrote:
> Ok. Thanks for the reply. Followup question: Is there an automagic way
> to determine what this last camera is or do I need to keep track of
> that myself?
> 
> Is it reasonable to attach a camera to the scenegraph set as the
> "last" camera just for capture purposes? I wouldn't think there would
> be much overhead incurred, but never hurts to ask.

Sherman,

I'm still learning how to fully use OSG myself, but here's the skeleton
code I wrote (based on the "osghud" and other examples).
[If anyone more experienced has any corrections/improvements to this
code, we'd all appreciate it].

This code "works for me" in my application, and will hopefully be easier
for you to get going with than the 3-styles-in-one osghud example (it
took me a few hours of testing settings and reading docs to figure out
exactly what was needed for each of the 3 display styles used in that
example).

The setRenderOrder(osg::Camera::POST_RENDER) on the HUD scene basically
makes it the "last" camera since all other scenes will be rendered
before this one.

I personally wouldn't bother with a screenshot-only camera as it will be
extra overhead and the HUD camera is basically IS that camera with some
display widgets in it.

[PS: and while the code below is from working code on my system, I did
strip out some app-specific parts for this email.  If it doesn't compile
as a result, my apologies, and I can help if the fix isn't obvious].

- Michael


// ==

osgViewer::CompositeViewer viewer;

// Main view
{
  osg::ref_ptr view = new osgViewer::View();
  view->setUpViewAcrossAllScreens();;
  view->setSceneData(root.get());  // root node of main scene here

  // black background for the main scene
  view->getCamera()->setClearColor(osg::Vec4(0.00, 0.00, 0.00, 1.00));

  view->addEventHandler(new osgViewer::WindowSizeHandler());
  view->addEventHandler(new osgViewer::StatsHandler());
  view->addEventHandler(new osgViewer::HelpHandler());

  viewer.addView(view.get());
}

// get window info from main view
osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
if (windows.empty()) {
  return 1;
}

// HUD view (overlaid on main view)
{
  osg::ref_ptr view = new osgViewer::View();
  view->setSceneData(hud.get());  // root node of hud scene here

  view->getCamera()->setGraphicsContext(windows[0]);
  view->getCamera()->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
  view->getCamera()->setProjectionMatrix
(osg::Matrix::ortho2D(0,1600,0,1200));
  view->getCamera()->setViewport(0, 0,
 windows[0]->getTraits()->width,
 windows[0]->getTraits()->height);
  view->getCamera()->setViewMatrix(osg::Matrix::identity());

  // draw this scene after the main scene (it's the "last" camera)
  view->getCamera()->setRenderOrder(osg::Camera::POST_RENDER);

  // no background (clear) so the main scene shows through
  view->getCamera()->setClearMask(GL_DEPTH_BUFFER_BIT);

  // Don't let the HUD camera grab event focus from the
  // main view's camera.
  view->getCamera()->setAllowEventFocus(false);

  // Attach your screen capture draw callback here
  drawcallback_screenshot = new DrawCallback_Screenshot("screenshot");
  view->getCamera()->setPostDrawCallback
(drawcallback_screenshot.get());

  viewer.addView(view.get());
}

return (viewer.run());

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


Re: [osg-users] Proposal to change the way the Colladapluginhandlesthe DAE object

2007-11-23 Thread Gordon Tomlinson
Doh Scene units was what I thought I was typing, just bad typing and
spelling ;) thanks for the tip on get units out, 
 
But I would argue that loader should have the option to scale the file to
the scene units if the format being loaded supports a unit size, its very
rare that you would have a scene in say meters and want a model created in
say milimeters to come in the size of a small country ;), 
 
Its sort of the same thing that we do in our with our imagery and elevation
software, you have a projection then we mosaic or re-project every thing
passed to the required projection no matter what the source projection is of
each component..
 
 
BTW I not i'm not suggesting you to do this, just that for me and my 20k+
users this would be a good thing some time down the road, 
 
 
  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Roger James
Sent: Friday, November 23, 2007 12:33 PM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Proposal to change the way the
Colladapluginhandlesthe DAE object



Gordon

 

I don't quite know what you mean by screen units, I suspect it is something
like "the same units as the rest of the scene graph". I think this function
is best done outside the plugin. In the current SVN you can do this using
the DAE object and document name returned by the plugin.

 

You need to get hold of the correct domCOLLADA object and then call getAsset
on it to get hold of the domAsset object and then call getUnit in that to
get the information you need.

 

If you do put any scaling transforms above the model then remember to
rescale the normals back to unity as well!

 

stateset->setMode(GL_NORMALIZE, StateAttribute::ON);

 

 

Roger

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gordon
Tomlinson
Sent: 23 November 2007 15:24
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Proposal to change the way the Collada
pluginhandlesthe DAE object

 

Need to add scaling the loaded model to correct screen units ;)  ( worth a
try ;) )

 

 

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


Re: [osg-users] Proposal to change the way the Collada pluginhandlesthe DAE object

2007-11-23 Thread Roger James
Gordon

 

I don't quite know what you mean by screen units, I suspect it is something
like "the same units as the rest of the scene graph". I think this function
is best done outside the plugin. In the current SVN you can do this using
the DAE object and document name returned by the plugin.

 

You need to get hold of the correct domCOLLADA object and then call getAsset
on it to get hold of the domAsset object and then call getUnit in that to
get the information you need.

 

If you do put any scaling transforms above the model then remember to
rescale the normals back to unity as well!

 

stateset->setMode(GL_NORMALIZE, StateAttribute::ON);

 

 

Roger

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gordon
Tomlinson
Sent: 23 November 2007 15:24
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] Proposal to change the way the Collada
pluginhandlesthe DAE object

 

Need to add scaling the loaded model to correct screen units ;)  ( worth a
try ;) )

 

 

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


Re: [osg-users] small VirtualPlanetBuilder bug

2007-11-23 Thread Robert Osfield
Hi Christoph,

This issue sounds odd, it shouldn't make any difference which order
the command line options are given in save for the set up coordinate
system info inheriting from left to right, but this isn't the case
here.  I'll do so testing at my end.

Robert.

On Nov 23, 2007 2:19 PM, Christoph Ehrler <[EMAIL PROTECTED]> wrote:
> Hi @ all VTP users and developers,
>
> Apparently it's not arbitrary how to arrange the data input for
> VirtualPlanetBuilder.
>
> The first commandline input produces a weired result with texture and
> heightfield matching but meshing of the heightfield corrupted. Every
> tile of the heightfield has only one central point to which all
> triangles converge.
> The second commandline produces perfect results though -d and -t
> statements are yust exchanged !?!
>
>
> osgdem -t  -d  -l 99 -o 
>
>
> osgdem -d  -t  -l 99 -o 
>
>
> Just to inform you because we spent hours believing it was the
> compression or the bit depth of the GeoTIFF !!
>
> Cheers
> Christoph
> ___
> 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] Creating shapes using Geometry

2007-11-23 Thread Jean-Sébastien Guay
Hello Renan,

>  Sorry that I sounded a bit desperate for quick answers, but I really
> appreciate the hint you've given me. I didn't think about using vectors,
> having the excuse that I haven't attended any Computer Graphics course. This
> project I'm participating in is from my Research Internship, and the
> software is only a small tool ina bigger picture.

No problem. I sometimes assume if someone is using OSG then they must  
have some bases, which is not the case. Sorry about that.

Have you made any progress? That offer for example code is still open  
if you're on a deadline, but as I said, trying to do it will probably  
be beneficial too.

Good luck,

J-S
-- 
__
Jean-Sebastien Guay [EMAIL PROTECTED]
 http://whitestar02.webhop.org/


This message was sent using IMP, the Internet Messaging Program.


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


Re: [osg-users] small VirtualPlanetBuilder bug

2007-11-23 Thread Jason Beverage
Hi Christoph,

Are your elevation and imagery in the same coordinate system?  It's
been awhile since I've looked at VPB, but if I recall correctly, the
last input file on the command line is used to determine the
coordinate system of the output database.  So, if someGeoTiff_Height
is in a geodetic projection and someGeoTiff_Texture is in a UTM
projection, the first command will produce a database in geodetic and
the second command line will produce a database in UTM.

VPB should scale height values appropriately (at least it was at one
point) if you are producing a geodetic database, but this is one
explanation as to why your output would be different depending on the
order of your command line arguments.

Good luck!

Jason

On 11/23/07, Christoph Ehrler <[EMAIL PROTECTED]> wrote:
> Hi @ all VTP users and developers,
>
> Apparently it's not arbitrary how to arrange the data input for
> VirtualPlanetBuilder.
>
> The first commandline input produces a weired result with texture and
> heightfield matching but meshing of the heightfield corrupted. Every
> tile of the heightfield has only one central point to which all
> triangles converge.
> The second commandline produces perfect results though -d and -t
> statements are yust exchanged !?!
>
>
> osgdem -t  -d  -l 99 -o 
>
>
> osgdem -d  -t  -l 99 -o 
>
>
> Just to inform you because we spent hours believing it was the
> compression or the bit depth of the GeoTIFF !!
>
> Cheers
> Christoph
> ___
> 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] screen capture with multiple cameras

2007-11-23 Thread sherman wilcox
Ok. Thanks for the reply. Followup question: Is there an automagic way
to determine what this last camera is or do I need to keep track of
that myself?

Is it reasonable to attach a camera to the scenegraph set as the
"last" camera just for capture purposes? I wouldn't think there would
be much overhead incurred, but never hurts to ask.

On Nov 23, 2007 12:46 AM, Berg, Michael <[EMAIL PROTECTED]> wrote:
>
> sherman wilcox wrote:
> > I want to capture my OSG screen and dump it to a jpeg or png file. My
> > understanding is to attach a callback to the main osgViewer camera and
> > perform a osg::Image::readPixels(...) from within the callback. That
> > works in the simple case. But, if I have a basic HUD that is itself a
> > camera alongside other nodes in the scenegraph, then I never see the
> > HUD in my osg::Image::readPixels call. That would make sense since my
> > callback is operating on the main camera and not my child node
> > camerabut leaves the question of how do I perform a "complete"
> > screen capture on a graph with multiple cameras?
> >
> > Is there an example I missed?
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> Sherman,
>
> I recently ran into the same problem on this list.
> Robert Osfield responded with some comments on how it might one-day be
> done more cleanly, but that "Until these methods are added, you'll need
> to make do with a post draw callback on the last camera to be drawn."
>
> If your HUD is the last camera drawn, set the post draw callback on your
> HUD camera, and it will be a complete screen capture.
>
> - Michael
>
> ___
> 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] Proposal to change the way the Collada plugin handlesthe DAE object

2007-11-23 Thread Gordon Tomlinson
Need to add scaling the loaded model to correct screen units ;)  ( worth a
try ;) )
 
Your proposals look ok to me..
 
The simple fix I submitted last week allowed the use of URI to be passed
through and used ( this was being rejected as the findfile func), it did not
attempt to convert the path to an URI just made sure it got to the dae
 
 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Roger James
Sent: Friday, November 23, 2007 10:16 AM
To: 'OpenSceneGraph Users'
Subject: [osg-users] Proposal to change the way the Collada plugin
handlesthe DAE object



When the Collada plugin was first written it used to create and delete a
local DAE object for each read or write operation.

 

At SVN changeset 5572 Per Fahlberg changed the behaviour so that a single
DAE object was created at first use and held onto until the plugin was
unloaded. This change was to fix crashes in the Collada library when it was
used more than once. I believe that these crashes have now been resolved in
the latest release of the collada DOM library, so this change could be
removed.

 

At SVN changeset 7504 Mattias Linde made a further change to allow a pointer
to a DAE object to be passed into and out of the plugin. If pointer was
passed in it would be used instead of any internally allocated object, and
in all circumstances a pointer to the DAE object actually used would passed
back out on completion.

 

I have recently been investigated some issues regarding the use of collada
when two or more DAE objects are in existence at the same time. This has
uncovered a problem with the collada library which is unlikely to be
resolved in the short term. 

 

https://sourceforge.net/forum/forum.php?thread_id=1871237

&forum_id=531264

 

Because of this I think it is better that the collada plugin does not hold
onto any dae objects. I suggest that the behaviour is changed as follows: -

 

On entry if a DAE object is supplied then use it otherwise allocate a new
one. On exit do not pass back any pointers to the DAE object and if an
internally allocated object has been used then delete it. Has anyone got any
comments on this, especially Per, Mattias and Robert?

 

I also propose to change the way the filename field is handled on input and
output. This will always be treated as if it was a filename path in the
current platform format, so the behaviour will be the same as other plugins.
Before it is passed to the collada library it will be resolved to an
absolute pathname in the current platform format using OSG's search
algorithms as required (input only I think) and then converted to a file URI
in a format accepted by the collada library. Once again has anyone got any
comments on this.

 

I madness takes me completely I will also put in some fixes for transparent
texture handling and Google compatibility on output that I have been working
on.

 

Roger

 

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


[osg-users] Proposal to change the way the Collada plugin handles the DAE object

2007-11-23 Thread Roger James
When the Collada plugin was first written it used to create and delete a
local DAE object for each read or write operation.

 

At SVN changeset 5572 Per Fahlberg changed the behaviour so that a single
DAE object was created at first use and held onto until the plugin was
unloaded. This change was to fix crashes in the Collada library when it was
used more than once. I believe that these crashes have now been resolved in
the latest release of the collada DOM library, so this change could be
removed.

 

At SVN changeset 7504 Mattias Linde made a further change to allow a pointer
to a DAE object to be passed into and out of the plugin. If pointer was
passed in it would be used instead of any internally allocated object, and
in all circumstances a pointer to the DAE object actually used would passed
back out on completion.

 

I have recently been investigated some issues regarding the use of collada
when two or more DAE objects are in existence at the same time. This has
uncovered a problem with the collada library which is unlikely to be
resolved in the short term. 

 

https://sourceforge.net/forum/forum.php?thread_id=1871237

&forum_id=531264

 

Because of this I think it is better that the collada plugin does not hold
onto any dae objects. I suggest that the behaviour is changed as follows: -

 

On entry if a DAE object is supplied then use it otherwise allocate a new
one. On exit do not pass back any pointers to the DAE object and if an
internally allocated object has been used then delete it. Has anyone got any
comments on this, especially Per, Mattias and Robert?

 

I also propose to change the way the filename field is handled on input and
output. This will always be treated as if it was a filename path in the
current platform format, so the behaviour will be the same as other plugins.
Before it is passed to the collada library it will be resolved to an
absolute pathname in the current platform format using OSG's search
algorithms as required (input only I think) and then converted to a file URI
in a format accepted by the collada library. Once again has anyone got any
comments on this.

 

I madness takes me completely I will also put in some fixes for transparent
texture handling and Google compatibility on output that I have been working
on.

 

Roger

 

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


Re: [osg-users] Creating shapes using Geometry

2007-11-23 Thread Renan Mendes
Jean-Sébastien,

 Sorry that I sounded a bit desperate for quick answers, but I really
appreciate the hint you've given me. I didn't think about using vectors,
having the excuse that I haven't attended any Computer Graphics course. This
project I'm participating in is from my Research Internship, and the
software is only a small tool ina bigger picture.


 Once again, thank you for your patience.


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


Re: [osg-users] utf-8?

2007-11-23 Thread Jean-Sébastien Guay

>> 2. Could it be that you have several copies around and your program is
>> loading the one which hasn't got those characters?
>
> I have only one Arial file.

Are you sure your program is not picking up the arial.ttf that's in  
OpenSceneGraph-Data/fonts? If you have OSG_FILE_PATH set, then it  
could be loading up that one, and it's only 42.5k so I'd guess it  
doesn't contain the characters you want.

Setting OSG_NOTIFY_LEVEL=DEBUG will tell you which arial.ttf it is loading.

J-S
-- 
__
Jean-Sebastien Guay [EMAIL PROTECTED]
 http://whitestar02.webhop.org/


This message was sent using IMP, the Internet Messaging Program.


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


[osg-users] Error handling in PNGs

2007-11-23 Thread Thibault Genessay
Hi all

I had a problem reading erroneous PNG files. When libpng encounters an
unrecoverable error, it forces the program to terminate. This is quite
ugly and the user has 2 choices to prevent it:
- we can use a sort of exception handler using setjmp() / longjmp().
This hack was probably invented to mimc C++ exceptions, which C does
not have
- we can install a custom error handler that must not return to libpng
once it has been called - our only choice is then to throw a regular
C++ exception here (or terminate but this brings us back to the
starting point)

As of today's SVN head, the OSG does not use any of the methods, hence
my crashes while reading a badly formed PNG. I have successfully
implemented the error handling routines in the PNG plugin but ... I am
not so sure this can be safely integrated in the OSG. Can a few of you
guys try it out and let me know how it behaves ? There are some things
which I am quite not sure of, such as the presence of memory leaks on
errors, or the possibility that this fix completely breaks existing
applications.

Attached are a few files to play with:
- the modified ReaderWriterPNG.cpp
- a minimal C++ program that exhibits the crash when using the
unmodified PNG reader
- the erroneous PNG file from which everything started

Regards

Thibault
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

#include 

using namespace osg;

extern "C"
{
#include 
#include 
}


/* Transparency parameters */
#define PNG_ALPHA -2 /* Use alpha channel in PNG file, if there is 
one */
#define PNG_SOLID -1 /* No transparency 
   */
#define PNG_STENCIL0 /* Sets alpha to 0 for r=g=b=0, 1 otherwise
   */

typedef struct
{
unsigned int Width;
unsigned int Height;
unsigned int Depth;
unsigned int Alpha;
} pngInfo;

class PNGError
{
public:
PNGError(const char* message)
{
_message = "PNG lib error : ";
_message += message;
}
friend std::ostream& operator<<(std::ostream& stream, const PNGError& 
err) 
{
stream << err._message;
return stream;
}
private:
std::string _message;
};

void user_error_fn(png_structp png_ptr,
png_const_charp error_msg)
{
throw PNGError(error_msg);
}

void user_warning_fn(png_structp png_ptr,
png_const_charp warning_msg)
{
osg::notify(osg::WARN) << "PNG lib warning : " << warning_msg << 
std::endl;
}

void png_read_istream(png_structp png_ptr, png_bytep data, png_size_t length)
{
std::istream *stream = (std::istream*)png_get_io_ptr(png_ptr); //Get 
pointer to istream
stream->read((char*)data,length); //Read requested amount of data
}

void png_write_ostream(png_structp png_ptr, png_bytep data, png_size_t length)
{
std::ostream *stream = (std::ostream*)png_get_io_ptr(png_ptr); //Get 
pointer to ostream
stream->write((char*)data,length); //Write requested amount of data
}

void png_flush_ostream(png_structp png_ptr)
{
std::ostream *stream = (std::ostream*)png_get_io_ptr(png_ptr); //Get 
pointer to ostream
stream->flush();
}

class ReaderWriterPNG : public osgDB::ReaderWriter
{
public:
virtual const char* className() const { return "PNG Image 
Reader/Writer"; }
virtual bool acceptsExtension(const std::string& extension) const { 
return osgDB::equalCaseInsensitive(extension,"png"); }

WriteResult::WriteStatus writePngStream(std::ostream& fout, const 
osg::Image& img, int compression_level) const
{
png_structp png = NULL;
png_infop   info = NULL;
int color;
png_bytep *rows = NULL;

//Create write structure
png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, 
NULL);
if(!png) return WriteResult::ERROR_IN_WRITING_FILE;

//Create infr structure
info = png_create_info_struct(png);
if(!info) return WriteResult::ERROR_IN_WRITING_FILE;

//Set custom write function so it will write to ostream
png_set_write_fn(png,&fout,png_write_ostream,png_flush_ostream);

//Set compression level
png_set_compression_level(png, compression_level);

switch(img.getPixelFormat()) {
case(GL_LUMINANCE): color = PNG_COLOR_TYPE_GRAY; break;
case(GL_ALPHA): color = PNG_COLOR_TYPE_GRAY; break; //Couldn't 
find a color type for pure alpha, using gray instead
case(GL_LUMINANCE_ALPHA): color = PNG_COLOR_TYPE_GRAY_ALPHA ; 
break;
case(GL_RGB): color = PNG_COLOR_TYPE_RGB; break;
case(GL_RGBA): color = PNG_COLOR_TYPE_RGB_ALPHA; break;
default: return WriteResult::ERROR_IN_WRITING_FILE; break;  
  
}

//Create row data
rows = new png_bytep[img.t()];
for(int 

[osg-users] small VirtualPlanetBuilder bug

2007-11-23 Thread Christoph Ehrler
Hi @ all VTP users and developers,

Apparently it's not arbitrary how to arrange the data input for
VirtualPlanetBuilder.

The first commandline input produces a weired result with texture and
heightfield matching but meshing of the heightfield corrupted. Every
tile of the heightfield has only one central point to which all
triangles converge.
The second commandline produces perfect results though -d and -t
statements are yust exchanged !?!


osgdem -t  -d  -l 99 -o 


osgdem -d  -t  -l 99 -o 


Just to inform you because we spent hours believing it was the
compression or the bit depth of the GeoTIFF !!

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


Re: [osg-users] CMake Search Paths ?

2007-11-23 Thread E. Wing
>> Is there a simpler way to give cmake user defined search paths?

> So, telling people about the shiny world of 'ccmake' and begging for
> procedures that are _highly_impractical_ on many people's setup is one
> thing,

This strikes me as a newbie-like question, not an automation
(advanced) question so ccmake is a perfectly reasonable answer. That's
the reason for the tool's existence.


> If you disallow these people to modify the required flags on the 'cmake'
> command line,

Nobody disallowed anything. I also gave 3 other perfectly good answers
that are geared towards automation and command lines.

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


Re: [osg-users] utf-8?

2007-11-23 Thread Johan Johnsson
Tnxc alot the problem was solved using second parameters in:
text1->setText(test, osgText::String::ENCODING_UTF8);

with -> osgText::String::ENCODING_UTF8 = worked
without = not worked.

On Fri, 23 Nov 2007 13:35:20 +0100, Thibault Genessay <[EMAIL PROTECTED]>  
wrote:

> You might try to have a look at the Character Set setting of your
> project (under Configuration Properties / General). If your previous
> project file was using the Unicode character set, while your new one
> the multi-byte character set, you might have a difference. I've never
> had a rea in-depth understanding of this setting, but I kinda suppose
> it must be set to unicode for unicode-aware apps.
>
> You should also try the different combinations of the second parameter
> to osgText::Text::setText() and the actual encoding of the file on the
> disk. In my case, I've let this parameter to its default value and
> also saved the file using the default encoding (unicode codepage 1200
> which I suspect is UCS-2 with a microsoft-specific codepage).
>
> If you did not read it yet, I really recommend the page
> http://www.joelonsoftware.com/articles/Unicode.html. I have read it
> about 10 times and now I'm beginning to understand how this unicode
> thing works :) It might help you pinpoint the exact source of your
> problem.
>
> Good luck
>
> Thibault
>
> On Nov 23, 2007 1:18 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>> I think the problem is in visual studio to be honest, i know i can save
>> the cpp as encoded types maybe i save it to wrong unicode type?
>>
>>
>> On Fri, 23 Nov 2007 12:54:41 +0100, Alberto Luaces <[EMAIL PROTECTED]>  
>> wrote:
>>
>> > El Friday 23 November 2007 12:29:06 Johan Johnsson escribió:
>> >> > 1. What is the size in bytes of the arial.ttf file you are
>> >> > using?
>> >>
>> >> 359 kb
>> >
>> > Then I think you are using the correct one, that is included with the
>> > Windows
>> > installation. Would it help to set the OSGNOTIFYLEVEL environment
>> > variable to
>> > DEBUG and inspect the output of the program?
>> > ___
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >  
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>>
>> --
>> Mr. Johan Johnsson
>> AutoSim AS, Strandveien 106, 9006 Tromsø
>> Visit us at http://www.autosim.no
>> ___
>> 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



-- 
Mr. Johan Johnsson
AutoSim AS, Strandveien 106, 9006 Tromsø
Visit us at http://www.autosim.no
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Thibault Genessay
You might try to have a look at the Character Set setting of your
project (under Configuration Properties / General). If your previous
project file was using the Unicode character set, while your new one
the multi-byte character set, you might have a difference. I've never
had a rea in-depth understanding of this setting, but I kinda suppose
it must be set to unicode for unicode-aware apps.

You should also try the different combinations of the second parameter
to osgText::Text::setText() and the actual encoding of the file on the
disk. In my case, I've let this parameter to its default value and
also saved the file using the default encoding (unicode codepage 1200
which I suspect is UCS-2 with a microsoft-specific codepage).

If you did not read it yet, I really recommend the page
http://www.joelonsoftware.com/articles/Unicode.html. I have read it
about 10 times and now I'm beginning to understand how this unicode
thing works :) It might help you pinpoint the exact source of your
problem.

Good luck

Thibault

On Nov 23, 2007 1:18 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
> I think the problem is in visual studio to be honest, i know i can save
> the cpp as encoded types maybe i save it to wrong unicode type?
>
>
> On Fri, 23 Nov 2007 12:54:41 +0100, Alberto Luaces <[EMAIL PROTECTED]> wrote:
>
> > El Friday 23 November 2007 12:29:06 Johan Johnsson escribió:
> >> > 1. What is the size in bytes of the arial.ttf file you are
> >> > using?
> >>
> >> 359 kb
> >
> > Then I think you are using the correct one, that is included with the
> > Windows
> > installation. Would it help to set the OSGNOTIFYLEVEL environment
> > variable to
> > DEBUG and inspect the output of the program?
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> --
> Mr. Johan Johnsson
> AutoSim AS, Strandveien 106, 9006 Tromsø
> Visit us at http://www.autosim.no
> ___
> 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] utf-8?

2007-11-23 Thread Johan Johnsson
I think the problem is in visual studio to be honest, i know i can save  
the cpp as encoded types maybe i save it to wrong unicode type?


On Fri, 23 Nov 2007 12:54:41 +0100, Alberto Luaces <[EMAIL PROTECTED]> wrote:

> El Friday 23 November 2007 12:29:06 Johan Johnsson escribió:
>> > 1. What is the size in bytes of the arial.ttf file you are
>> > using?
>>
>> 359 kb
>
> Then I think you are using the correct one, that is included with the  
> Windows
> installation. Would it help to set the OSGNOTIFYLEVEL environment  
> variable to
> DEBUG and inspect the output of the program?
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



-- 
Mr. Johan Johnsson
AutoSim AS, Strandveien 106, 9006 Tromsø
Visit us at http://www.autosim.no
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Alberto Luaces
El Friday 23 November 2007 12:29:06 Johan Johnsson escribió:
> > 1. What is the size in bytes of the arial.ttf file you are
> > using?
>
> 359 kb

Then I think you are using the correct one, that is included with the Windows 
installation. Would it help to set the OSGNOTIFYLEVEL environment variable to 
DEBUG and inspect the output of the program?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Johan Johnsson
On Fri, 23 Nov 2007 11:59:44 +0100, Alberto Luaces <[EMAIL PROTECTED]> wrote:

> El Friday 23 November 2007 11:20:31 Johan Johnsson escribió:
>> yes i have copied them from the characther map in arial
>
> Out of curiosity:
>
> 1. What is the size in bytes of the arial.ttf file you are
> using?

359 kb

> 2. Could it be that you have several copies around and your program is
> loading the one which hasn't got those characters?

I have only one Arial file.
___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



-- 
Mr. Johan Johnsson
AutoSim AS, Strandveien 106, 9006 Tromsø
Visit us at http://www.autosim.no
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Alberto Luaces
El Friday 23 November 2007 11:20:31 Johan Johnsson escribió:
> yes i have copied them from the characther map in arial

Out of curiosity:

1. What is the size in bytes of the arial.ttf file you are 
using?
2. Could it be that you have several copies around and your program is 
loading the one which hasn't got those characters?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Johan Johnsson
Yes they do and it is the same characters i represented on the display  
before i deleted the project.

On Fri, 23 Nov 2007 11:09:52 +0100, Robert Osfield  
<[EMAIL PROTECTED]> wrote:

> Does the font handle the characters you are interested in?
>
> On Nov 23, 2007 10:00 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>>
>> damnit it worked , but then i incidentaly removed the project, now i  
>> cant
>> get it to work:
>>
>> osgText::Text* text1 = new osgText::Text;
>>  osgText::String* string = new osgText::String("لْعَرَبيّة",
>> osgText::String::ENCODING_UTF8);
>>  std::string test = string->createUTF8EncodedString();
>>
>>  text1->setFont("fonts/arial.ttf");
>>  text1->setCharacterSize(characterSize);
>>  text1->setPosition(pos);
>>  text1->setAxisAlignment(osgText::Text::XY_PLANE);
>>  text1->setText(test);
>>  geode->addDrawable(text1);
>>
>>
>> just wierd letters, (i use visual studio 2003 if that is to any help, i
>> know i can save the code files in different encoding methods, atm i save
>> them as Unicode(big-endian).
>>
>>
>> On Wed, 21 Nov 2007 13:28:58 +0100, Johan Johnsson <[EMAIL PROTECTED]>
>>
>> wrote:
>>
>> > tnx very much -the problem was the font.
>> >
>> > On Wed, 21 Nov 2007 13:24:47 +0100, Thibault Genessay
>> > <[EMAIL PROTECTED]>
>> > wrote:
>> >
>> >> Hi Johan,
>> >>
>> >> Did you check that the font file itself does include the glyphs that
>> >> you try to display ?
>> >> Also, try to pass your input data as a wide character string, i.e.
>> >> L"لْعَرَبيّة"
>> >>
>> >> I have a similar problem in the past and solved it using wchar_t
>> >> strings in my source files, and using a different font that actually
>> >> had the glyphs.
>> >>
>> >> Hope this helps
>> >>
>> >> Thibault
>> >>
>> >>
>> >> On Nov 21, 2007 1:15 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>> >>> I may be doing this wrong, because its just showing some wierd  
>> letters:
>> >>>
>> >>>  osgText::Text* text1 = new osgText::Text;
>> >>>  osgText::String* string = new osgText::String("لْعَرَبيّة",
>> >>> osgText::String::ENCODING_UTF8);
>> >>>  std::string test = string->createUTF8EncodedString();
>> >>>
>> >>>
>> >>>
>> >>> On Wed, 21 Nov 2007 10:50:39 +0100, Robert Osfield
>> >>> <[EMAIL PROTECTED]> wrote:
>> >>>
>> >>> > On Nov 21, 2007 9:04 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>> >>> >> Can the scenegraph represent utf-8 on the screen?
>> >>> >
>> >>> > You mean does osgText support UTF-8 encoding of strings?  The  
>> answer
>> >>> > is yes, have a look at osgText::String for details.
>> >>> >
>> >>> > Robert.
>> >>> > ___
>> >>> > osg-users mailing list
>> >>> > osg-users@lists.openscenegraph.org
>> >>> >
>> >>>  
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> Mr. Johan Johnsson
>> >>> AutoSim AS, Strandveien 106, 9006 Tromsø
>> >>> Visit us at http://www.autosim.no
>> >>> ___
>> >>> 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
>> >
>> >
>> >
>>
>>
>>
>> --
>> Mr. Johan Johnsson
>> AutoSim AS, Strandveien 106, 9006 Tromsø
>> Visit us at http://www.autosim.no
>> ___
>> 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



-- 
Mr. Johan Johnsson
AutoSim AS, Strandveien 106, 9006 Tromsø
Visit us at http://www.autosim.no
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Johan Johnsson
yes i have copied them from the characther map in arial


On Fri, 23 Nov 2007 11:10:28 +0100, Mario Valle <[EMAIL PROTECTED]> wrote:

> Does Arial.ttf have those arabic characters?
> Try change font file.
> Ciao!
>   mario
>
>
> Johan Johnsson wrote:
>> damnit it worked , but then i incidentaly removed the project, now i  
>> cant
>> get it to work:
>>
>> osgText::Text* text1 = new osgText::Text;
>>  osgText::String* string = new osgText::String("لْعَرَبيّة",
>> osgText::String::ENCODING_UTF8);
>>  std::string test = string->createUTF8EncodedString();
>>
>>  text1->setFont("fonts/arial.ttf");
>>  text1->setCharacterSize(characterSize);
>>  text1->setPosition(pos);
>>  text1->setAxisAlignment(osgText::Text::XY_PLANE);
>>  text1->setText(test);
>>  geode->addDrawable(text1);
>>
>>
>> just wierd letters, (i use visual studio 2003 if that is to any help, i
>> know i can save the code files in different encoding methods, atm i save
>> them as Unicode(big-endian).
>>
>>
>> On Wed, 21 Nov 2007 13:28:58 +0100, Johan Johnsson <[EMAIL PROTECTED]>
>> wrote:
>>
>>> tnx very much -the problem was the font.
>>>
>>> On Wed, 21 Nov 2007 13:24:47 +0100, Thibault Genessay
>>> <[EMAIL PROTECTED]>
>>> wrote:
>>>
 Hi Johan,

 Did you check that the font file itself does include the glyphs that
 you try to display ?
 Also, try to pass your input data as a wide character string, i.e.
 L"لْعَرَبيّة"

 I have a similar problem in the past and solved it using wchar_t
 strings in my source files, and using a different font that actually
 had the glyphs.

 Hope this helps

 Thibault


 On Nov 21, 2007 1:15 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
> I may be doing this wrong, because its just showing some wierd  
> letters:
>
>  osgText::Text* text1 = new osgText::Text;
>  osgText::String* string = new osgText::String("لْعَرَبيّة",
> osgText::String::ENCODING_UTF8);
>  std::string test = string->createUTF8EncodedString();
>
>
>
> On Wed, 21 Nov 2007 10:50:39 +0100, Robert Osfield
> <[EMAIL PROTECTED]> wrote:
>
>> On Nov 21, 2007 9:04 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>>> Can the scenegraph represent utf-8 on the screen?
>> You mean does osgText support UTF-8 encoding of strings?  The answer
>> is yes, have a look at osgText::String for details.
>>
>> Robert.
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> --
> Mr. Johan Johnsson
> AutoSim AS, Strandveien 106, 9006 Tromsø
> Visit us at http://www.autosim.no
> ___
> 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
>>>
>>>
>>
>>
>>
>



-- 
Mr. Johan Johnsson
AutoSim AS, Strandveien 106, 9006 Tromsø
Visit us at http://www.autosim.no
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Mario Valle
Does Arial.ttf have those arabic characters?
Try change font file.
Ciao!
mario


Johan Johnsson wrote:
> damnit it worked , but then i incidentaly removed the project, now i cant  
> get it to work:
> 
> osgText::Text* text1 = new osgText::Text;
>  osgText::String* string = new osgText::String("لْعَرَبيّة",  
> osgText::String::ENCODING_UTF8);
>  std::string test = string->createUTF8EncodedString();
> 
>  text1->setFont("fonts/arial.ttf");
>  text1->setCharacterSize(characterSize);
>  text1->setPosition(pos);
>  text1->setAxisAlignment(osgText::Text::XY_PLANE);
>  text1->setText(test);
>  geode->addDrawable(text1);
> 
> 
> just wierd letters, (i use visual studio 2003 if that is to any help, i  
> know i can save the code files in different encoding methods, atm i save  
> them as Unicode(big-endian).
> 
> 
> On Wed, 21 Nov 2007 13:28:58 +0100, Johan Johnsson <[EMAIL PROTECTED]>  
> wrote:
> 
>> tnx very much -the problem was the font.
>>
>> On Wed, 21 Nov 2007 13:24:47 +0100, Thibault Genessay  
>> <[EMAIL PROTECTED]>
>> wrote:
>>
>>> Hi Johan,
>>>
>>> Did you check that the font file itself does include the glyphs that
>>> you try to display ?
>>> Also, try to pass your input data as a wide character string, i.e.
>>> L"لْعَرَبيّة"
>>>
>>> I have a similar problem in the past and solved it using wchar_t
>>> strings in my source files, and using a different font that actually
>>> had the glyphs.
>>>
>>> Hope this helps
>>>
>>> Thibault
>>>
>>>
>>> On Nov 21, 2007 1:15 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
 I may be doing this wrong, because its just showing some wierd letters:

  osgText::Text* text1 = new osgText::Text;
  osgText::String* string = new osgText::String("لْعَرَبيّة",
 osgText::String::ENCODING_UTF8);
  std::string test = string->createUTF8EncodedString();



 On Wed, 21 Nov 2007 10:50:39 +0100, Robert Osfield
 <[EMAIL PROTECTED]> wrote:

> On Nov 21, 2007 9:04 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>> Can the scenegraph represent utf-8 on the screen?
> You mean does osgText support UTF-8 encoding of strings?  The answer
> is yes, have a look at osgText::String for details.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
>
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



 --
 Mr. Johan Johnsson
 AutoSim AS, Strandveien 106, 9006 Tromsø
 Visit us at http://www.autosim.no
 ___
 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
>>
>>
> 
> 
> 

-- 
Ing. Mario Valle
Visualization Group  | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] utf-8?

2007-11-23 Thread Robert Osfield
Does the font handle the characters you are interested in?

On Nov 23, 2007 10:00 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>
> damnit it worked , but then i incidentaly removed the project, now i cant
> get it to work:
>
> osgText::Text* text1 = new osgText::Text;
>  osgText::String* string = new osgText::String("لْعَرَبيّة",
> osgText::String::ENCODING_UTF8);
>  std::string test = string->createUTF8EncodedString();
>
>  text1->setFont("fonts/arial.ttf");
>  text1->setCharacterSize(characterSize);
>  text1->setPosition(pos);
>  text1->setAxisAlignment(osgText::Text::XY_PLANE);
>  text1->setText(test);
>  geode->addDrawable(text1);
>
>
> just wierd letters, (i use visual studio 2003 if that is to any help, i
> know i can save the code files in different encoding methods, atm i save
> them as Unicode(big-endian).
>
>
> On Wed, 21 Nov 2007 13:28:58 +0100, Johan Johnsson <[EMAIL PROTECTED]>
>
> wrote:
>
> > tnx very much -the problem was the font.
> >
> > On Wed, 21 Nov 2007 13:24:47 +0100, Thibault Genessay
> > <[EMAIL PROTECTED]>
> > wrote:
> >
> >> Hi Johan,
> >>
> >> Did you check that the font file itself does include the glyphs that
> >> you try to display ?
> >> Also, try to pass your input data as a wide character string, i.e.
> >> L"لْعَرَبيّة"
> >>
> >> I have a similar problem in the past and solved it using wchar_t
> >> strings in my source files, and using a different font that actually
> >> had the glyphs.
> >>
> >> Hope this helps
> >>
> >> Thibault
> >>
> >>
> >> On Nov 21, 2007 1:15 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
> >>> I may be doing this wrong, because its just showing some wierd letters:
> >>>
> >>>  osgText::Text* text1 = new osgText::Text;
> >>>  osgText::String* string = new osgText::String("لْعَرَبيّة",
> >>> osgText::String::ENCODING_UTF8);
> >>>  std::string test = string->createUTF8EncodedString();
> >>>
> >>>
> >>>
> >>> On Wed, 21 Nov 2007 10:50:39 +0100, Robert Osfield
> >>> <[EMAIL PROTECTED]> wrote:
> >>>
> >>> > On Nov 21, 2007 9:04 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
> >>> >> Can the scenegraph represent utf-8 on the screen?
> >>> >
> >>> > You mean does osgText support UTF-8 encoding of strings?  The answer
> >>> > is yes, have a look at osgText::String for details.
> >>> >
> >>> > Robert.
> >>> > ___
> >>> > osg-users mailing list
> >>> > osg-users@lists.openscenegraph.org
> >>> >
> >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >>>
> >>>
> >>>
> >>> --
> >>> Mr. Johan Johnsson
> >>> AutoSim AS, Strandveien 106, 9006 Tromsø
> >>> Visit us at http://www.autosim.no
> >>> ___
> >>> 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
> >
> >
> >
>
>
>
> --
> Mr. Johan Johnsson
> AutoSim AS, Strandveien 106, 9006 Tromsø
> Visit us at http://www.autosim.no
> ___
> 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] utf-8?

2007-11-23 Thread Johan Johnsson

damnit it worked , but then i incidentaly removed the project, now i cant  
get it to work:

osgText::Text* text1 = new osgText::Text;
 osgText::String* string = new osgText::String("لْعَرَبيّة",  
osgText::String::ENCODING_UTF8);
 std::string test = string->createUTF8EncodedString();

 text1->setFont("fonts/arial.ttf");
 text1->setCharacterSize(characterSize);
 text1->setPosition(pos);
 text1->setAxisAlignment(osgText::Text::XY_PLANE);
 text1->setText(test);
 geode->addDrawable(text1);


just wierd letters, (i use visual studio 2003 if that is to any help, i  
know i can save the code files in different encoding methods, atm i save  
them as Unicode(big-endian).


On Wed, 21 Nov 2007 13:28:58 +0100, Johan Johnsson <[EMAIL PROTECTED]>  
wrote:

> tnx very much -the problem was the font.
>
> On Wed, 21 Nov 2007 13:24:47 +0100, Thibault Genessay  
> <[EMAIL PROTECTED]>
> wrote:
>
>> Hi Johan,
>>
>> Did you check that the font file itself does include the glyphs that
>> you try to display ?
>> Also, try to pass your input data as a wide character string, i.e.
>> L"لْعَرَبيّة"
>>
>> I have a similar problem in the past and solved it using wchar_t
>> strings in my source files, and using a different font that actually
>> had the glyphs.
>>
>> Hope this helps
>>
>> Thibault
>>
>>
>> On Nov 21, 2007 1:15 PM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>>> I may be doing this wrong, because its just showing some wierd letters:
>>>
>>>  osgText::Text* text1 = new osgText::Text;
>>>  osgText::String* string = new osgText::String("لْعَرَبيّة",
>>> osgText::String::ENCODING_UTF8);
>>>  std::string test = string->createUTF8EncodedString();
>>>
>>>
>>>
>>> On Wed, 21 Nov 2007 10:50:39 +0100, Robert Osfield
>>> <[EMAIL PROTECTED]> wrote:
>>>
>>> > On Nov 21, 2007 9:04 AM, Johan Johnsson <[EMAIL PROTECTED]> wrote:
>>> >> Can the scenegraph represent utf-8 on the screen?
>>> >
>>> > You mean does osgText support UTF-8 encoding of strings?  The answer
>>> > is yes, have a look at osgText::String for details.
>>> >
>>> > Robert.
>>> > ___
>>> > osg-users mailing list
>>> > osg-users@lists.openscenegraph.org
>>> >
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>>
>>> --
>>> Mr. Johan Johnsson
>>> AutoSim AS, Strandveien 106, 9006 Tromsø
>>> Visit us at http://www.autosim.no
>>> ___
>>> 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
>
>
>



-- 
Mr. Johan Johnsson
AutoSim AS, Strandveien 106, 9006 Tromsø
Visit us at http://www.autosim.no
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org