Hi Olivier,
On Thu, 2005-04-14 at 18:45 +0200, [EMAIL PROTECTED] wrote:
> hello!
>
> I m new with openSG.so i apply a 640*480 texture on a 64*40 plane....so i must
> respecify the texture coordinates(the 640*480 image will be "transformated"
> by openSG in a 1024*512 image...I think).
By default yes, but it will be scaled to that size, your texture
coordinates should still be 0..1.
> But the result is an image wich is
> symetric by a diagonal of my plane...The image is red with a yellow line on
> the
> top,so in the result,the line is on the diagonal.
>
> Can someone tell me what i made wrong?
...
> GeoTexCoords2fPtr texcoords = GeoTexCoords2f::create();
> beginEditCP(texcoords);
> texcoords->addValue(Vec2f(0,0));
> texcoords->addValue(Vec2f(640.0/1024.0,480.0/512.0));
> texcoords->addValue(Vec2f(0,480.0/512.0));
>
> texcoords->addValue(Vec2f(640.0/1024.0,0));
The texture coordinates have to correspond to the geometrical
coordinates, i.e. the first texture coordinate will be used for point 0,
the second for point 1 etc. Let's assume your points go lower left,
lower right, upper right, upper left to form a quad. But your texture
coordinate are lower left, upper right, upper left, lower right, which
makes a bowtie out of your regular image. So you have to reorder your
texture coordinates, probably something like this:
texcoords->addValue(Vec2f(0,0));
texcoords->addValue(Vec2f(1,0));
texcoords->addValue(Vec2f(1,1));
texcoords->addValue(Vec2f(0,1));
For testing I'd recommend using an actual image as the texture, that
gives you more hints about goes wrong.
Hope it helps
Dirk
--
-- Dirk Reiners OpenSG Forum [EMAIL PROTECTED]
-- The OpenSG Open Source Scenegraph: http://www.opensg.org
-- Join the list at http://lists.sf.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users