image-placement>texcoords ( image-placement atlas-image -- image texcoords )


Vocabulary
images.atlas

Inputs
image-placementan object
atlas-imagean object


Outputs
imagean object
texcoordsan object


Definition


:: image-placement>texcoords
( image-placement atlas-image -- image texcoords )
atlas-image dim>> first2 :> ( aw ah ) image-placement
image>> :> image image-placement loc>> first2 :> ( x y )
image dim>> first2 :> ( w h ) x aw /f :> left-u y ah /f
:> top-v x w + aw /f :> right-u y h + ah /f
:> bottom-v image dup upside-down?>>
[ left-u top-v right-u bottom-v ]
[ left-u bottom-v right-u top-v ] if 4array ; inline