Forums WoW Modding Support Archives WoWModding Support Archives [DiscordArchive] One is the average and one is the center I am guessing?

[DiscordArchive] One is the average and one is the center I am guessing?

[DiscordArchive] One is the average and one is the center I am guessing?

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
08-20-2021, 12:10 PM
#1
Archived author: michael • Posted: 2021-08-20T12:10:48.602000+00:00
Original source

One is the average and one is the center I am guessing?
rektbyfaith
08-20-2021, 12:10 PM #1

Archived author: michael • Posted: 2021-08-20T12:10:48.602000+00:00
Original source

One is the average and one is the center I am guessing?

rektbyfaith
Administrator
0
08-20-2021, 12:11 PM
#2
Archived author: schlumpf • Posted: 2021-08-20T12:11:34.614000+00:00
Original source

the average *is* the center, depending on definition
rektbyfaith
08-20-2021, 12:11 PM #2

Archived author: schlumpf • Posted: 2021-08-20T12:11:34.614000+00:00
Original source

the average *is* the center, depending on definition

rektbyfaith
Administrator
0
08-20-2021, 12:12 PM
#3
Archived author: schlumpf • Posted: 2021-08-20T12:12:23.056000+00:00
Original source

for the first, just average all points.
for the second, determine the AABB enclosing the mesh (see how it is done for the entire model in the M2 header vertex box) and average those points, i.e. get the center of the AABB
rektbyfaith
08-20-2021, 12:12 PM #3

Archived author: schlumpf • Posted: 2021-08-20T12:12:23.056000+00:00
Original source

for the first, just average all points.
for the second, determine the AABB enclosing the mesh (see how it is done for the entire model in the M2 header vertex box) and average those points, i.e. get the center of the AABB

rektbyfaith
Administrator
0
08-20-2021, 12:16 PM
#4
Archived author: michael • Posted: 2021-08-20T12:16:34.683000+00:00
Original source

But the center of a box around the points wouldnt that just be the max point in each axis subtracted from the min?
rektbyfaith
08-20-2021, 12:16 PM #4

Archived author: michael • Posted: 2021-08-20T12:16:34.683000+00:00
Original source

But the center of a box around the points wouldnt that just be the max point in each axis subtracted from the min?

rektbyfaith
Administrator
0
08-20-2021, 12:17 PM
#5
Archived author: michael • Posted: 2021-08-20T12:17:13.643000+00:00
Original source

Wait no that's the length of the model
rektbyfaith
08-20-2021, 12:17 PM #5

Archived author: michael • Posted: 2021-08-20T12:17:13.643000+00:00
Original source

Wait no that's the length of the model

rektbyfaith
Administrator
0
08-20-2021, 12:18 PM
#6
Archived author: michael • Posted: 2021-08-20T12:18:46.121000+00:00
Original source

minX+((maxX-minX)/2)
rektbyfaith
08-20-2021, 12:18 PM #6

Archived author: michael • Posted: 2021-08-20T12:18:46.121000+00:00
Original source

minX+((maxX-minX)/2)

rektbyfaith
Administrator
0
08-20-2021, 12:22 PM
#7
Archived author: schlumpf • Posted: 2021-08-20T12:22:28.665000+00:00
Original source

which is the same as (min + max) / 2, i.e. the average
rektbyfaith
08-20-2021, 12:22 PM #7

Archived author: schlumpf • Posted: 2021-08-20T12:22:28.665000+00:00
Original source

which is the same as (min + max) / 2, i.e. the average

rektbyfaith
Administrator
0
08-20-2021, 12:24 PM
#8
Archived author: schlumpf • Posted: 2021-08-20T12:24:30.810000+00:00
Original source

just that for the box you can ignore 6 of the 8 points if you choose two opposing ones. I probably wouldn't optimize those 0.2ms of wasted computation for the benefit of writing
```
mesh.centerPosition = average (all_vertices);
mesh.sortCenterPosition = average (aabb (all_vertices));
```
rektbyfaith
08-20-2021, 12:24 PM #8

Archived author: schlumpf • Posted: 2021-08-20T12:24:30.810000+00:00
Original source

just that for the box you can ignore 6 of the 8 points if you choose two opposing ones. I probably wouldn't optimize those 0.2ms of wasted computation for the benefit of writing
```
mesh.centerPosition = average (all_vertices);
mesh.sortCenterPosition = average (aabb (all_vertices));
```

rektbyfaith
Administrator
0
08-20-2021, 12:27 PM
#9
Archived author: michael • Posted: 2021-08-20T12:27:55.433000+00:00
Original source

I'll have to research what an axis aligned bounding box is cause maybe I don't get it
rektbyfaith
08-20-2021, 12:27 PM #9

Archived author: michael • Posted: 2021-08-20T12:27:55.433000+00:00
Original source

I'll have to research what an axis aligned bounding box is cause maybe I don't get it

rektbyfaith
Administrator
0
08-20-2021, 12:28 PM
#10
Archived author: michael • Posted: 2021-08-20T12:28:39.547000+00:00
Original source

Or are you saying the min max / 2 is the sortCenterPosition?
rektbyfaith
08-20-2021, 12:28 PM #10

Archived author: michael • Posted: 2021-08-20T12:28:39.547000+00:00
Original source

Or are you saying the min max / 2 is the sortCenterPosition?

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)