Author Topic: Making a 'corrected texture' for a triangle.  (Read 497 times)

20EnderDude20

  • Full Member
  • ***
  • Posts: 115
  • Karma: +6/-0
  • I'm also known as "The Blender Fiddler" on Youtube
    • View Profile
    • Youtube Channel
Re: Making a 'corrected texture' for a triangle.
« Reply #15 on: August 12, 2018, 11:19:25 pm »
     Here is another way to make a corrected texture.
You would make a replica of the triangle to a bitmap, and place the area of the triangle within the area of the texture you want on the triangle. You can also scale or rotate the triangle to any size as seen here:
.
     The third step is to mask the image. There are many ways to do this. One way is using flash by making the triangle the mask, and the image the masked layer. Another way is to go into GIMP and set the triangle as the mask layer: .
     The fourth step is to export the image as a png.
     The fifth step is to scale the masked image so that it fits in the canvas' dimensions:
     The sixth step is to scale the rows of pixels up on one axis so that they will fit onto the canvas:
... and the result will be a corrected texture! Now, there has got to be a faster way to do this. I don't want to waste my entire day scaling a 32x32 texture line by line. So, is there a way to make this a script?

« Last Edit: August 12, 2018, 11:24:54 pm by 20EnderDude20 »

Jorhlok

  • Newbie
  • *
  • Posts: 13
  • Karma: +3/-0
    • View Profile
Re: Making a 'corrected texture' for a triangle.
« Reply #16 on: August 12, 2018, 11:36:44 pm »
I was thinking of making a python script to do it and I may make it soon. However I think one or two of the edges of the triangle needs to span an entire edge of the sprite because that's how it'll be distorted when drawn as a quad.

Well, the python script I was imagining would stretch either columns or rows of pixels but maybe a full uv preprocessor could be made instead. I might make the simple version first and think on the latter later.

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk