I want ALL the faces of my mesh to be drawn

Questions and answers about the how and why of making maps.
Post Reply
jpenguin
Private First Class
Private First Class
Posts: 128
Joined: Wed Jun 11, 2008 11:56 pm

I want ALL the faces of my mesh to be drawn

Post by jpenguin » Wed Oct 08, 2008 9:47 pm

So, I'm making a platform you can jump on from underneath; it works, but the bottom of it is not draw 8untill you jump on-top of it

Code: Select all

define os
   mesh
   vertex -1 -1 0
   vertex 1 -1 0
   vertex 1 1 0
   vertex -1 1 0
   vertex -1 -1 1
   vertex 1 -1 1
   vertex 1 1 1
   vertex -1 1 1
   face #south
       vertices 0 1 5 4
   endface
   face #east
       vertices 1 2 6 5
   endface
   face #north
       vertices 2 3 7 6
   endface
   face #west
       vertices 3 0 4 7 
   endface
   face #bottom
       vertices 0 1 2 3
       passable
   endface
   face #top
       vertices 4 5 6 7
   endface
   noclusters
end #mesh
enddef
and I'm placing i9t with

Code: Select all

group os
   scale 1 1 1
   shift 250 0 10
   matref s-red
end
Attachments
Picture 8.jpg
Picture 8.jpg (12.54 KiB) Viewed 905 times

User avatar
Spectre
Private First Class
Private First Class
Posts: 174
Joined: Sat May 24, 2008 2:33 pm

Post by Spectre » Wed Oct 08, 2008 10:38 pm

I think this might be your problem.
BZFlag mesh faces are one-sided, meaning a face is see-through, drive-through, and shoot-through from one side, but not from the other. The face is drawn on top of a counter-clockwise set of vertices, meaning that this:

Code: Select all

mesh
   vertex 10 10 10
   vertex -10 10 10
   vertex -10 -10 10
   vertex 10 -10 10

   face
   vertices 0 1 2 3
   endface
end
will be jump-through from the bottom.
So will this:

Code: Select all

mesh
   vertex 10 10 10
   vertex -10 10 10
   vertex -10 -10 10
   vertex 10 -10 10

   face #top
   vertices 0 1 2 3
   endface

   face #bottom
   vertices 3 2 1 0
   passable
   endface
end
This works because the bottom face will be oriented toward you, but drivethrough. Because faces are one-sided, you will then go up through the non-existent side of the top face.

Hope you understood a word of that, and if you did, that it helps.
Keeping Latin alive in 2766 AUC.

User avatar
TD-Linux
Sergeant
Sergeant
Posts: 724
Joined: Wed Apr 27, 2005 8:26 pm
Location: Mountain View, CA

Post by TD-Linux » Sun Oct 19, 2008 6:59 pm

Bucko got this absolutely right - face winding is the key here. Most games' 3D faces are only one sided, as this allows major performance enhancements.

The direction of a face is determined by the order of its vertices. Your face should specify its vertices so that when you look at the front of the face, they are numbered in a counterclockwise order. Where you start doesn't matter, it's what order you go in. Speaking of, don't try to go in crazy hourglass shapes :)

The drivethrough option on your bottom face will let your tank go through the bottom of your mesh, while the top mesh will 'catch' your tank when it begins to fall because of its one-sidedness.

I guess I pretty much repeated what Bucky said, but sometimes two different explanations can help :)

Post Reply