Textured poly?

This topic contains 7 replies, has 3 voices, and was last updated by  Jesse 2 years, 2 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6876

    Jesse
    Participant

    Is there a way to texture a 4 point poly with an image in mojo without having to resort to using direct GL graphics?

    #6921

    Diffrenzy
    Keymaster

    Yes, take a look at  at Canvas.DrawPrimitives()

    http://monkey2.monkey-x.com/mx2-docs/mojo-mojo-graphics-canvas-drawprimitives/

    #6923

    Jesse
    Participant

    Guess I didn’t look thoroughly enough. Thanks.
    I still have to figure out how to use it.

    #7006

    Mark Sibly
    Keymaster

    Little demo of drawing a full-view ‘diamond’.

    The command’s a little intense because it’s supposed to handle many combinations of textured/untextured/colored/uncolored/indexed/nonindexed primitives. Uses float ptrs instead of float arrays for max flexibility too, ie: you can draw from DataBuffers etc.

    #7020

    Jesse
    Participant

    Thanks Mark. That helped a little. I am trying to plaster an image into a four sided poly or a quad.

    #7021

    Jesse
    Participant

    as a test I am trying to plaster an image of a rectangle with an x on it but can quite figure it out.

    This is what I got:

    [/crayon]
    #7024

    Mark Sibly
    Keymaster

    You need to add texture coordinates if there’s an ‘image’ param (should probably catch this…)

    Texture coordinates represent coordinates within the image, where 0,0=top left, 1,0=top right, 1,1=bottom right, 0,1=bottom left, and fractional values are coordinates somewhere in between, eg: .5,.5= center.

    #7035

    Jesse
    Participant

    Thanks, That works perfect.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.