Hi Rick,

You modification assumes that the wrap is REPEAT, whereas it could be
CLAMP or MIRROR_REPEAT, your change also won't handle a tex coord than
is less than -1 or > 1.

Given the various alternative interpretations that are all valid I
don't think it'd be appropriate to merge your submission as is.

As for a better solution, we could possible add a wrap option for each
of the axis, and then clamp the tex coords appropriately.  It might be
best to do this in a separate getColor() method as this extra code
will be slow.

Perhaps the best thing would be just to document that tex coordinates
must be adjust externally to be within the 0 to 1.0 range and let
application programmers clamp the coords appropriately for their
application.

Robert.

On Wed, Feb 2, 2011 at 10:35 AM, Rick Appleton
<[email protected]> wrote:
> Hi,
>
> We've noticed an issue with the Image::getColor(const Vec3& texcoord) 
> function in that it doesn't support negative texture coordinates (on 
> repeating textures). The attached Image.cpp has fixed that.
>
> Thank you!
>
> Cheers,
> Rick
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=36259#36259
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/image_208.cpp
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to