Mesh Help Pls

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Easy Target
Private First Class
Private First Class
Posts: 191
Joined: Sat Sep 29, 2007 7:58 pm
Location: In a cardboard box, how I own a computer, I don't know.
Contact:

Mesh Help Pls

Post by Easy Target » Sat Jan 26, 2008 2:22 am

Hi, I've tried creating a mesh for my new map, and i think i've done everything right, but when i try to test my map, the mesh wont appear. Can someone tell me what i've done wrong with the mesh, and then post how the mesh SHOULD look... thanks

Code: Select all

mesh
	vertex 18 -51 0
	vertex 18 -47 0
	vertex 18 -47 26.5
	vertex 18 -51 26.5
	vertex -18 -47 0
	vertex -18 -47 26.5
	vertex -18 -51 0
	vertex -18 -51 26.5
	face
	vertices 4 5 6 7
	drivethrough
	shootthrough
	matref wall
	endface
	face
	vertices 0 1 2 3
	matref wall
	endface
	face
	vertices 0 1 4 6
	drivethrough
	matref wall
	endface
	face
	vertices 2 3 5 7
	matref wall
	endface	
end
Humor helps us to think out of the box. The average child laughs about 400 times per day, the average adult laughs only 15 times per day. What happened to the other 385 laughs?

User avatar
Joe-Schmoe
Private First Class
Private First Class
Posts: 192
Joined: Mon Jul 24, 2006 1:10 am
Location: This field unintentionally left blank.

Post by Joe-Schmoe » Sat Jan 26, 2008 3:27 am

Lets look at just one face for now:

Code: Select all

   vertex -18 -47 0
   vertex -18 -47 26.5
   vertex -18 -51 0
   vertex -18 -51 26.5
   face
   vertices 4 5 6 7
   drivethrough
   shootthrough
   matref wall
   endface
You have to imagine the square in your mind...you start at one corner, and move along each edge.

The way you have it, the face starts at vertex #4, -18 -47 0.

Next, it moves to vertex #5, which is directly above vertex #4.

The problem arises with the next vertex. It is diagonally across from #5. This means the program will try to connect #5 and #6. This would be fine if you wanted a triangle, but when you are making a square, the points have to be in order.

So: if you switch vertices #6 and #7, it should work.

Code: Select all

   vertex -18 -47 0
   vertex -18 -47 26.5
   vertex -18 -51 26.5
   vertex -18 -51 0
   face
   vertices 4 5 6 7
   drivethrough
   shootthrough
   matref wall
   endface
Join MI6!

User avatar
Easy Target
Private First Class
Private First Class
Posts: 191
Joined: Sat Sep 29, 2007 7:58 pm
Location: In a cardboard box, how I own a computer, I don't know.
Contact:

Post by Easy Target » Sat Jan 26, 2008 4:38 am

when i tested it, the mesh still wouldnt appear where i wanted it... i dont know what to do :(
Humor helps us to think out of the box. The average child laughs about 400 times per day, the average adult laughs only 15 times per day. What happened to the other 385 laughs?

User avatar
Triumph of the Soul
Corporal
Corporal
Posts: 294
Joined: Thu Jul 06, 2006 4:32 pm
Location: Minnesota

Post by Triumph of the Soul » Sat Jan 26, 2008 5:03 am

If the mesh is working, but the position is wrong, just use the shift function to change it. I tested it with the changes Schmoe made and it still didn't work (well, one side worked), so the other 5 sides still have their vertices out of order. I would suggest drawing your points out on paper before hand to see if it helps you gain a better understanding of 3D geometry. I'm almost sure it would help you get your vertices in order. Once you become proficient with this (or once you start using a 3D modeler) you won't need paper (I still use paper by the way, because these modelers confuse the shenanigans out of me).
Image
Creator @: Duck or Die, Duck or Die CTF, Fuel Stack, Guernica, Normal, Frayed

User avatar
Easy Target
Private First Class
Private First Class
Posts: 191
Joined: Sat Sep 29, 2007 7:58 pm
Location: In a cardboard box, how I own a computer, I don't know.
Contact:

Post by Easy Target » Sat Jan 26, 2008 5:19 am

ok, i'll try that, I'll start over with my thing, and i'll draw it on paper first, before i input into my comp, thanks! 8)
Humor helps us to think out of the box. The average child laughs about 400 times per day, the average adult laughs only 15 times per day. What happened to the other 385 laughs?

User avatar
Easy Target
Private First Class
Private First Class
Posts: 191
Joined: Sat Sep 29, 2007 7:58 pm
Location: In a cardboard box, how I own a computer, I don't know.
Contact:

Post by Easy Target » Sat Jan 26, 2008 6:40 am

ok, i've figured out what i did wrong, i didnt have any groups, and i had the stuff in the wrong quadrants. one minor problem though. When i tested the map, my texture came out sideways, any idea how to make it so that my texture matches the rest of the walls?

Code: Select all

define wall

material
name wall
	texture boxwall
	diffuse 0.68 0.68 0.68 0.68
end

mesh
	vertex -18 51 1
	vertex -18 47 1
	vertex 18 51 1
	vertex 18 47 1
	vertex -18 51 0
	vertex -18 47 0
	vertex 18 51 0
	vertex 18 47 0
	face
	vertices 1 5 7 3 
	shootthrough
	drivethrough
	matref wall
	endface
end

enddef

group wall
	position 0 -94 0
	size 1 1 26
end
Humor helps us to think out of the box. The average child laughs about 400 times per day, the average adult laughs only 15 times per day. What happened to the other 385 laughs?

User avatar
Joe-Schmoe
Private First Class
Private First Class
Posts: 192
Joined: Mon Jul 24, 2006 1:10 am
Location: This field unintentionally left blank.

Post by Joe-Schmoe » Sat Jan 26, 2008 4:27 pm

There is a great thread about how to do that here:

http://my.bzflag.org/bb/viewtopic.php?t ... =texcoords
Join MI6!

User avatar
Tedius
Sergeant First Class
Sergeant First Class
Posts: 142
Joined: Tue Sep 19, 2006 6:10 pm
Contact:

Post by Tedius » Sat Jan 26, 2008 7:51 pm

I think you can avoid having to use texcoords if you name the "bottom" vertices of your face first. That is, start in the lower left-hand corner when you create your face.

Code: Select all

material 
name wall 
   texture boxwall 
   diffuse 0.68 0.68 0.68 0.68 
end 

define wall 
mesh 
   vertex -18 51 1     #0 labeling your vertices is fun and easy
   vertex -18 47 1     #1
   vertex 18 51 1      #2
   vertex 18 47 1      #3
   vertex -18 51 0     #4
   vertex -18 47 0     #5
   vertex 18 51 0      #6
   vertex 18 47 0      #7

   face 
     vertices 5 7 3 1 
     shootthrough 
     drivethrough 
     matref wall 
   endface 
end 

enddef 

group wall 
   position 0 -94 0 
   size 1 1 26 
end 

It has been a while since I have done this, so correct me if I'm wrong.
this signature intentionally left blank

User avatar
Easy Target
Private First Class
Private First Class
Posts: 191
Joined: Sat Sep 29, 2007 7:58 pm
Location: In a cardboard box, how I own a computer, I don't know.
Contact:

Post by Easy Target » Sun Jan 27, 2008 4:01 am

THANK YOU!
thank you guys so much. I finally figured out how to do it.
Humor helps us to think out of the box. The average child laughs about 400 times per day, the average adult laughs only 15 times per day. What happened to the other 385 laughs?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests