3 Replies Latest reply on Dec 17, 2007 12:07 PM by _lw

    Reuse texture in proportion

    Wriker
      Hello,

      Can someone give me a clue on how to approach this, I've been trying and trying but I just can't seem to work it out.

      I have a texture bitmap of a woodgrain surface, which I want to use on different planes with different sizes, while keeping the same proportions (i.e. the woodgrain detail has to look the same size on each plane). The whole model is created dynamically using Lingo, so no importing from third party 3D software.

      In some cases the texture is smaller than the plane so it should be tiled, in other cases the texture is (much) larger than the plane so only part of it should be seen on the plane. I am now leaning towards imaging Lingo but surely there must be an easier way?!

      Help is really really really appreciated!
        • 1. Re: Reuse texture in proportion
          _lw Level 1
          You should take a look at 'texturetransformlist' and change the 'scale'.

          This could be done like this (behavior used with empty 3D member):

          • 2. Re: Reuse texture in proportion
            Wriker Level 1
            Is there no simple way to just say "don't scale" the texture? So it tiles if the texture is smaller than the face and crops if it is larger?
            • 3. Re: Reuse texture in proportion
              _lw Level 1
              >Is there no simple way to just say "don't scale" the texture? So it tiles if the texture is
              >smaller than the face and crops if it is larger?

              No, you have to write a script to do this. But this is not that complicated, you only need to calculate the texture-scale in conjunction to the models scale. Even if you do not use the 'scale' to change the size of the model, you can calculate the texture-scale depending on a given scaling factor.

              You can see how it works in the "on enterframe" part: