Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] any idea how I can calculate SetTexCoord properly?

[DiscordArchive] any idea how I can calculate SetTexCoord properly?

[DiscordArchive] any idea how I can calculate SetTexCoord properly?

rektbyfaith
Administrator
0
04-25-2022, 03:34 PM
#1
Archived author: Matth • Posted: 2022-04-25T15:34:29.311000+00:00
Original source

any idea how I can calculate SetTexCoord properly?
rektbyfaith
04-25-2022, 03:34 PM #1

Archived author: Matth • Posted: 2022-04-25T15:34:29.311000+00:00
Original source

any idea how I can calculate SetTexCoord properly?

rektbyfaith
Administrator
0
04-25-2022, 04:39 PM
#2
Archived author: Foe • Posted: 2022-04-25T16:39:56.963000+00:00
Original source

I have a script for it
rektbyfaith
04-25-2022, 04:39 PM #2

Archived author: Foe • Posted: 2022-04-25T16:39:56.963000+00:00
Original source

I have a script for it

rektbyfaith
Administrator
0
04-25-2022, 04:40 PM
#3
Archived author: Foe • Posted: 2022-04-25T16:40:47.865000+00:00
Original source

I just don't remember who I sent it to
rektbyfaith
04-25-2022, 04:40 PM #3

Archived author: Foe • Posted: 2022-04-25T16:40:47.865000+00:00
Original source

I just don't remember who I sent it to

rektbyfaith
Administrator
0
04-25-2022, 04:43 PM
#4
Archived author: Foe • Posted: 2022-04-25T16:43:55.898000+00:00
Original source

```function CoordsToTexCoords(size, xTop, yTop, xBottom, yBottom)
local magic = (1/size)/2
local Top = (yTop/size) + magic
local Left = (xTop/size) + magic
local Bottom = (yBottom/size) - magic
local Right = (xBottom/size) - magic

return Top, Left, Bottom, Right
end

local Top, Left, Bottom, Right = CoordsToTexCoords(128, 80, 35, 113, 68)
print(Top, Left, Bottom, Right) ```
rektbyfaith
04-25-2022, 04:43 PM #4

Archived author: Foe • Posted: 2022-04-25T16:43:55.898000+00:00
Original source

```function CoordsToTexCoords(size, xTop, yTop, xBottom, yBottom)
local magic = (1/size)/2
local Top = (yTop/size) + magic
local Left = (xTop/size) + magic
local Bottom = (yBottom/size) - magic
local Right = (xBottom/size) - magic

return Top, Left, Bottom, Right
end

local Top, Left, Bottom, Right = CoordsToTexCoords(128, 80, 35, 113, 68)
print(Top, Left, Bottom, Right) ```

rektbyfaith
Administrator
0
04-25-2022, 05:50 PM
#5
Archived author: Honey • Posted: 2022-04-25T17:50:24.782000+00:00
Original source

Now i wonder where we get that `size` value from
rektbyfaith
04-25-2022, 05:50 PM #5

Archived author: Honey • Posted: 2022-04-25T17:50:24.782000+00:00
Original source

Now i wonder where we get that `size` value from

rektbyfaith
Administrator
0
04-25-2022, 05:53 PM
#6
Archived author: Foe • Posted: 2022-04-25T17:53:27.347000+00:00
Original source

Size of the texture part
rektbyfaith
04-25-2022, 05:53 PM #6

Archived author: Foe • Posted: 2022-04-25T17:53:27.347000+00:00
Original source

Size of the texture part

rektbyfaith
Administrator
0
04-25-2022, 05:53 PM
#7
Archived author: Foe • Posted: 2022-04-25T17:53:42.109000+00:00
Original source

128x128 section as an example
rektbyfaith
04-25-2022, 05:53 PM #7

Archived author: Foe • Posted: 2022-04-25T17:53:42.109000+00:00
Original source

128x128 section as an example

rektbyfaith
Administrator
0
04-25-2022, 05:53 PM
#8
Archived author: Foe • Posted: 2022-04-25T17:53:46.641000+00:00
Original source

Size would then be 128
rektbyfaith
04-25-2022, 05:53 PM #8

Archived author: Foe • Posted: 2022-04-25T17:53:46.641000+00:00
Original source

Size would then be 128

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)