Re: [osg-users] A Wrong Billboard Tree!!

From: Marco Jez <marco.jez_at_poste.it>
Date: Wed Jan 12 2005 - 03:31:50 PST

Hi Spyros,

your problem seems to be related to UV mapping rather than image size. Keep in mind that texturing works in normalized coordinates, so the actual image size only affects visual quality and the amount of resources needed to manage it. That is, if your original image is 100x50 you can resize it to 128x64 without noticeing a change in the texture's aspect ratio, as long as the UV mapping remains constant. If this is the problem, I suggest you to read a tutorial on texturing, for example: http://nehe.gamedev.net/lesson.asp?index=02
>From your screenshot it seems that your polygon has wrong U coordinates (-0.5, 0.5 at left and right side respectively, while it should be 0, 1).
Your "out of memory" error probably depends on the fact you tried to call gluScaleImage before a valid GL context has been created. You need to have a valid context active when calling that function (that is, you should call it after the viewer has already been realized).

Cheers,
  Marco

  ----- Original Message -----
  From: Spyros Garyfallos
  To: OSG USERS
  Sent: Wednesday, January 12, 2005 11:58 AM
  Subject: [osg-users] A Wrong Billboard Tree!!

  Hi all,

  I'm trying to create some billboard trees, but the result in some of them is like
  the pic. I've tried to change the bitmap attributes in different width/height ratio
  and in some cases (ratio=1.0 or 0.8) it works fine. Obviously it has to do with
  the bitmap's dimensions The Image::scaleImage doesn't work, because
  gluScaleImage returns "out of memory". Any attempt to manually rescale the
  image, by changing the Image::_data failed.

  Any suggestions??
  Why width and height of bitmaps have to be a power of 2?
  Where can I find the proper values of width/height ratio that work??

  Thanks,
  Spyros.

------------------------------------------------------------------------------

  _______________________________________________
  osg-users mailing list
  osg-users@openscenegraph.net
  http://openscenegraph.net/mailman/listinfo/osg-users
  http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
Received on Wed Jan 12 03:31:43 2005

This archive was generated by hypermail 2.1.8 : Wed Jan 12 2005 - 03:31:44 PST