texcords and normals please explain these

Questions and answers about the how and why of making maps.
Post Reply
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

texcords and normals please explain these

Post by big_daddy2 »

hi i just found out how to make a mesh box with vertices and vertexes with 6 faces now i want to know what texcords and normals do, please do not explain what they do in the face i know that when u put a number it is the texcord,normal,or vertex you are putting to it
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

Post by big_daddy2 »

also if one of these fills the hollow box up please tell me

this is what i got to make a box:

Code: Select all

mesh 
name mesh1 
vertex -10 25 0 #0 
vertex -10 -25 0 #1 
vertex 10 25 0 #2 
vertex 10 -25 0 #3 
vertex -10 25 30 #4 
vertex -10 -25 30 #5 
vertex 10 25 30 #6 
vertex 10 -25 30 #7 
face # bottom 
vertices 0 1 2 3 3 2 1 0 
endface 
face # top 
vertices 4 5 6 7 7 6 5 4 
endface 
face #side 1 
vertices 0 1 4 5 5 4 1 0 
endface 
face #side 2 
vertices 2 3 6 7 7 6 3 2 
endface 
face # side 3 
vertices 0 2 4 6 6 4 2 0 
endface 
face #side 4 
vertices 1 3 5 7 7 5 3 1 
endface 
end
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post by Spazzy McGee »

Please don't reply to your own posts; use the 'edit' button to edit your previous posts to contain the revised information.

texcoords map a texture onto a face of a mesh, in a custom fashion. It allows you, for example, to use only one image to texture all the sides of a cylinder with a 'barrel' texture.

normals don't worry about them.

I think what you are trying to do is to make the box solid - to do this use inside points. An inside point defines the inside of an object as far as it can "see", until it hits the back of a face - so for your cube you only need one, whereas for a more complex object, for example one with a bend in it, you would need too.

Your mesh code is weird - you only need 4 vertexes per face - you don't want to draw faces facing into the box, since nobody sees them.

I've also added your inside point.

Code: Select all

mesh

  vertex -10 -25 0
  vertex -10 -25 30
  vertex 10 -25 30
  vertex 10 -25 0
  vertex -10 25 0
  vertex -10 25 30
  vertex 10 25 30
  vertex 10 25 0

  inside 0 0 10

  face
    vertices 0 3 2 1
  endface
  face
    vertices 0 4 7 3
  endface
  face
    vertices 1 5 4 0
  endface
  face
    vertices 2 6 5 1
  endface
  face
    vertices 3 7 6 2
  endface
  face
    vertices 5 6 7 4
  endface

end
P.S, i recommend not diving straight in at the deep end.
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

Post by big_daddy2 »

now could any of us explain normals? what do they do, why r they there,what it the purpose?
User avatar
blast
General
General
Posts: 4933
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

These "normals" are not specific to BZFlag. Go run a search on Google for that information.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly »

why are normals not specific to BZFlag? Yes I know BZFlag will calculate normals.

big_daddy2,
normals describe the direction the face 'faces'. its a vector pointing in a direction. used in lighting, etc. You can look up openGL and normals on the web.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

Normals are not specific to bzflag, as they are a concept in 3d graphics and math, not JUST bzflag ( hence the use of the word "specific" ). Since BZ uses 3d graphical and mathematical concepts such as faces and vertices, then it also uses normals.

It is always best to define your normals, unless you want your object to look like crap when lit.
ImageJeffM
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

If you want to start using this type of mapping, your going to have a very hard time doing it in text. I highly suggest that you get Wings3d, and it's bzw exporter. That will make it easy, and it's free.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post by Spazzy McGee »

JeffM wrote:It is always best to define your normals, unless you want your object to look like crap when lit.
You say that; the Wings exporter always mucks them all up, and lighting looks appalling - I always end up just deleting all normals. It's an impossible job re-defining them all.

I have little experience of BZWtools for blender, I expect it exports them properly.
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

Post by big_daddy2 »

when i use texcoords 0 1 2 3 ( 0 0,1 0,1 1,0 1 texcoords) it makes the image side ways what should i do to make it up and down instead?
Post Reply