Graphics

 View Only
  • 1.  Is it possible to set the dimensions of a texture without scaling the object?

    Posted 02-17-2017 16:17
    I have made a transition with two hockey helmets with their logos UV wrapped on either side. Depending on the dimension of the logos, they get stretched. I've got the math to required to resize the logos appropriately by getting their dimensinos and comparing it the dimensions of the UV mapped material, but I don't know if it's possible to adjust the dimensions of the XPression material.

    EDIT: I think I figured it out. I need to adjust the shader.

    EDIT2: Got that working, but the texture tiles. Is it possible to clip a texture?

    EDIT3: Figure that out too...... good to go.


  • 2.  RE: Is it possible to set the dimensions of a texture without scaling the object?

    Posted 02-23-2017 14:23
    Can you share your solution? I am running into the same problem.
    #XPression


  • 3.  RE: Is it possible to set the dimensions of a texture without scaling the object?

    Posted 03-17-2017 16:08
    Sorry for the late response.

    dim P1Pic as xpBaseObject
    dim P1PicMat as xpMaterial
    dim shader as xpBaseShader

    P1Pic.GetMaterial(4, P1PicMat)
    P1PicMat.GetShader(0, shader)
    shader.TextureScaleX=100
    shader.TextureScaleY=100
    P1Pic.SetMaterial(4, P1PicMat)
    #XPression