Author Topic: .blb files  (Read 1178 times)

Im looking through blockland files like crazy so i can learn as much as i can before my torque showtool pro trial runs out. I am currently learning how to make doors, but the .blb files dont make sense to me. If i wanted to create a new size brick, how will this affect what i need to do with the top, bottom, north, south, east, west, and omni quads?

There really needs to be a tutorial on this. I have no clue either.

Tom

If you are making a square/rectangle brick, all you need is the X Y and Z size.

Code: [Select]
16 16 40
BRICK

If you are making a square/rectangle brick, all you need is the X Y and Z size.

Code: [Select]
16 16 40
BRICK
What about specials? Like doors?

Tom

What about specials? Like doors?
Doors are a DTS placed inside a plain square brick.

The coordinates would need to be larger. I'm not sure what'd happen if the size entered didn't match what the actual size is, but I'd imagine it would cause collision issues with both objects and other bricks, and defining a collision mesh wouldn't do much to help you there because it would need to be the size entered.

For your first attempt I'd recommend doing what I did and making a 4x4 vehicle brick to get a basic understanding of how it works, although I admit .blbs still seem like scary files. Practice, practice, practice.

The coordinates would need to be larger. I'm not sure what'd happen if the size entered didn't match what the actual size is, but I'd imagine it would cause collision issues with both objects and other bricks, and defining a collision mesh wouldn't do much to help you there because it would need to be the size entered.

For your first attempt I'd recommend doing what I did and making a 4x4 vehicle brick to get a basic understanding of how it works, although I admit .blbs still seem like scary files. Practice, practice, practice.
Yes im sure if i study it enough, i will understand a pattern. If only Space Guy would read this.

I thought doors used the simple BRICK type for their base bricks, not the SPECIAL type, weird.


The quad type like Top, North, and Omni only tells the engine which faces to un-render when other bricks' faces are placed adjacent to them after calculating the COVERAGE parameters. Omni quads are never un-rendered, or atleast I haven't found a case where they were un-rendered.

Anyhow as far as Quad POSITION goes, what you are doing is creating a set of square faces to build up the brick's Mesh, all this via script. It's daunting I know but that's what you have to do for these. The POSITION parameters determines where to place the 4 vertexes that will make up the face, and this is with reference to the brick's origin point (the Center of the brick's "box"). The origin point is 0 0 0, from there you move the vertexes left or right, in or out, up or down the axis, just like placing points on a 2D grid and getting the point's position in X and Y values, except the grid is layed out flat in front of you and you now have a height Z parameter axis going through the plane as well.

I have no idea in which order you should place the points though and even if it matters it matters, see edit VVV. All I know is you should never place points across from each other like this

1---3
|     |
4---2

Code: [Select]
POSITION
0 0 0
1 0 -1
1 0 0
0 0 -1

It should be something like this

1---2
|     |
4---3

Code: [Select]
POSITION
0 0 0
1 0 0
1 0 -1
0 0 -1

Now UV mapping
http://en.wikipedia.org/wiki/UV_mapping
The article looks scary, but UV mapping is not so bad. You might find the equations on there useful.

UV mapping is complicated, all I can say it's like placing the Texture (TEX) on a 2D cartesian grid and then placing each vertex from the POSITION on that grid to map the texture to the face. U represent's that vertex' X coordinate and V represents that vertex' Y coordinate. The texture also repeats infinitely on all sides, the general dimensions of the textures borders are 1 x 1. I recommend trying to keep UV mapping parameters as simple as possible and follow a pattern of POSITION vs UV MAPPING within your .blb files.

NORMAL determines in which direction each vertex is facing, it's used in Lighting effects. Not too complicated.


That's all the help I can offer.

Edit: Vertex order matters

1---2
|     |
4---3

Going Clockwise, the quad will face in your direction.

2---1
|     |
3---4

Going Anticlockwise, the quad will face the Opposite direction.

So looking at a brick from the South, you'll be seeing a vertex order like this for the South quad and North quad

Code: [Select]
   2---1
   /| N/|
  / 3-/-4
  1---2 /
  | S |/
  4---3

|/
O-

You'll see the South quad but not the North quad, the North quad is facing away from you and has no texture on it's backside. If you flip it around, you'll now see the North quad but not the South quad, see what I mean?
« Last Edit: September 13, 2009, 03:32:14 PM by Muffinmix »