Mesh Problems

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Spectre
Private First Class
Private First Class
Posts: 174
Joined: Sat May 24, 2008 2:33 pm

Mesh Problems

Post by Spectre »

I'm trying to learn meshes, and I am starting with a cube. When I used this:

Code: Select all

mesh #cube
	#start bottom ring
	vertex 100 100 20 #0
	vertex -100 100 20 #1
	vertex -100 -100 20 #2
	vertex 100 -100 20 #3
	#end bottom ring

	#start top ring
	vertex 100 100 20 #4
	vertex -100 100 20 #5
	vertex -100 -100 20 #6
	vertex 100 -100 20 #7
	#end top ring

	face #bottom face
	vertices 0 1 2 3
	phydrv bounce
	endface

	face #top face
	vertices 4 5 6 7
	endface

	face #y+ face
	vertices 0 1 4 5
	endface

	face #y- face
	vertices 2 3 6 7
	endface

	face #x+ face
	vertices 0 3 4 7
	endface

	face #x- face
	vertices 1 2 5 6
	endface
end #cube
all I saw was the bottom face. If anyone could help me, I'd appreciate it...
Keeping Latin alive in 2766 AUC.
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme »

1) Actually you saw the top face, 'cause you can only see it from the top (the bottom face you would see from the bottom)
2) The vertex order for the bottom face is reversed. Vertices should be specified counter-clockwise from the direction you want the face to appear (faces are one-sided, so if you want to see it from both sides, specify two faces, and reverse the order of vertices for the second)
3) Your "cube" is a flat plane, as all vertices have the same Z-coordinate. Try increasing the Z-coordinate value for your "top ring" of vertices.

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

OOOOOOoohhhh

Post by Spectre »

DUH, on the flat plane. How did I not see that. Even if they didn't know a whit about meshes, anyone could have seen that.
But OK, thanks.
Keeping Latin alive in 2766 AUC.
User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 809
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Post by allejo »

or if you don't want to write out the mesh vertex by vertex use a 3d editor like wings 3d or blender. i personally use wings 3d because it is easier for me.
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post by F687/s »

> or if you don't want to write out the mesh vertex by vertex use a 3d editor like
> wings 3d or blender. i personally use wings 3d because it is easier for me.


I write my meshes by hand, and there are quite a few people out there that still do (I know Tedius does). It's always a good skill to learn, for when you need to make a quick non-primitive object and don't want to resort to a full-blown 3D editor.

Also, Constitution's right. From what I guess, if you drive into the middle of the box (with observer maybe), you should be able to see walls, which represent the walls that should actually be there, just on the wrong side. (By the way, you should know that meshes are hollow, and you can only see the texture one way, and not through both sides.)

Instead of doing:

Code: Select all

vertices 0 1 2 3
Try:

Code: Select all

vertices 0 3 2 1
And repeat for the rest of the vertices. When I make meshes I test often, tweaking the order of the vertices between tests. It really helps.

(Just so you know, even the bottom face is the wrong way ;-). The reason you can see it is because the texture is facing inside. If it was facing the right way you shouldn't be able to see it.)
User avatar
macsforme
General
General
Posts: 2069
Joined: Wed Mar 01, 2006 5:43 am

Post by macsforme »

Making a simple mesh by hand is a good thing to do to learn how it works. However, once you get into even slightly complicated creations, using a modeler is literally at least ten times faster than entering coordinates by hand. Bring textures and UVmaps into the equation, and it's practically impossible to create such meshes by hand.

Learn to use a 3D modeler if you plan on doing any serious map-making.
Post Reply