Determining SetSize?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Determining SetSize?

Post by MPowell1944 »

When you see a model's setsize, what do those numbers mean?

For example, I want to make a clipbrush that is the same size as a destroyed opeltruck, because I don't wanna use the solid command on the truck itself as that makes the bounding box solid.

(0.0 0.0 0.0) (-65 -40 0) (65 40 120)

That is the setsize given for the opeltruck. What do those numbers mean, and how would I create a clipbrush to be exactly the same size as the truck. I created a clipbrush with those setsize numbers, but it didnt encompass the whole area of the truck.

Any help appreciated!
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Setsize should be followed by two position vectors.

e.g.

setsize (x1 y1 z1) (x2 y2 z2)

For solid objects, the following conditions must hold:
x1 < x2
y1 < y2
z1 < z2

The size of the object along any of the three axes is given by (example for x-axis):
L = abs(x1) + abs(x2)

In a more tangible form see it as a box drawn from (x1 y1 z1) to (x2 y2 z2), a bit like a rectangle drawing tool for paint programs (i.e. two points specify a square).
Image
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Good information, but what I am exactly looking for is, what measurements do each number represent? IE height width thickness. That type of stuff.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

None of the above, each number represents the length of the object along one of the three axes.

It depends on the orientation of the object whether this lenght corresponds to width or length. Height obviously always is z2 - z1.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

technical

Post by tltrude »

I think you are getting to technical jv-map.

Ok, think of a point in space that is the exact center of the truck (the trucks origin point).

(0.0 0.0 0.0) (-65 -40 0) (65 40 120)

The first set of numbers is how much to offset the origin point from the center of the model--in this case 0.

The next two sets of numbers define where to draw the bounding box. Think of them as (xyz) coordinates using the truck's origin as 0.

So, let's take the first number from each. Move forward 65 units and place a dot. Then move backwards 65 units and place another dot. Now draw a line between those two dots. The line will be 130 units long from the front of the truck to the back.

Now let's widen that line with the second set of numbers. Move left 40 units and right 40 units. So, now we have a rectangle that is 130 units long and 80 units wide.

But, the rectangle is kind of flat, so we need to give it some height with the third set of numbers. Move down 0 and move up 120 units and our bounding box is now 80 units wide, 130 units long, and 120 units high.

Looks to me like the origin of the truck model is in the center, but on the ground. Anyway, the xyz corrodinates are not map coordinates, they are truck coordinates--from the truck's origin point.

hope that helps!
Tom Trude,

Image
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

That helped alot. I got the brush the exact size I need. Thanks.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

jv_map wrote:L = abs(x1) + abs(x2)
Should be
L = x2 - x1 :oops:
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Oh one more note, setsize should be followed by only two sets of three numbers.

The initial (0.0 0.0 0.0) is only used in /*QUAKED statements and specifies the color of the entity in Radiant, in this case black. (1.0 1.0 1.0) would be white.
Image
Post Reply