Page 1 of 1

BZFlag MapU - Box to Mesh V0.2.0

Posted: Sat Jan 07, 2006 6:52 pm
by Tanner
Hi,

This is a simple program I made that takes the specifcations of a normal box, and converts it to a mesh allowing the user to spend much less time.

V0.2.0

Features:
  • Current Step Number
  • "Is This What You Want To Do?"
  • Generates a file called "mesh.bzw" with the mesh code.
  • Nicely labeled code telling you which is what side.
Bugs:
  • "Is This What You Want To Do?" does not recognize "Y", "N", "Yes", or "No".
Thanks
-Tanner

Posted: Sun Jan 08, 2006 2:44 am
by ^nightmare^
wow thats really awsome. Real easy to make tunnels and stuff.
Great job and keep up the good work :D

Posted: Sun Jan 08, 2006 5:34 pm
by JPT
I get the invalid mesh warning, too.
But the porgramm creates a crazy geometric object, not a simple block.
But it's a great job !
With some modification, i can make the mesh work as a platform.

Posted: Sun Jan 08, 2006 7:29 pm
by The Client
cool ill have to try it...

Posted: Sun Jan 08, 2006 7:36 pm
by The Knights Who Say Ni
nice idea but it needs developing i think
also why does it create gmon.out :?

Posted: Sun Jan 08, 2006 7:39 pm
by The Knights Who Say Ni
umm yer i just tested it and it said:

Code: Select all

invalid mesh face (0.000000): 5 6 7  face
  # plane normal = 0 0 1 -8.5
    vertices 5 6 7 # 8.5 8.5 8.5 8.5 -8.5 8.5 8.5 -8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 1 2 3  face
  # plane normal = 0 0 1 -8.5
    vertices 1 2 3 # -8.5 8.5 8.5 -8.5 -8.5 8.5 -8.5 -8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 0 1 3  face
  # plane normal = 0 0.203259 0 -9.90352e+027
    vertices 0 1 3 # -8.5 8.5 8.5 -8.5 8.5 8.5 -8.5 -8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 3 4 5  face
  # plane normal = 0 0.203259 0 -9.90352e+027
    vertices 3 4 5 # -8.5 -8.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 2 1 0  face
  # plane normal = 0 0 1 -8.5
    vertices 2 1 0 # -8.5 -8.5 8.5 -8.5 8.5 8.5 -8.5 8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 6 5 4  face
  # plane normal = 0 0 1 -8.5
    vertices 6 5 4 # 8.5 -8.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 7 6 4  face
  # plane normal = 0 0 0 0
    vertices 7 6 4 # 8.5 -8.5 8.5 8.5 -8.5 8.5 8.5 8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 4 3 2  face
  # plane normal = 0 0 0 0
    vertices 4 3 2 # 8.5 8.5 8.5 -8.5 -8.5 8.5 -8.5 -8.5 8.5
    matref 0
  endface

invalid mesh face (0.000000): 5 6 7  face
  # plane normal = 0 0 1 0
    vertices 5 6 7 # 8.5 8.5 0 8.5 -8.5 0 8.5 -8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 1 2 3  face
  # plane normal = 0 0 1 0
    vertices 1 2 3 # -8.5 8.5 0 -8.5 -8.5 0 -8.5 -8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 0 1 3  face
  # plane normal = 0 2.10195e-044 0 0
    vertices 0 1 3 # -8.5 8.5 0 -8.5 8.5 0 -8.5 -8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 3 4 5  face
  # plane normal = 0 2.10195e-044 0 0
    vertices 3 4 5 # -8.5 -8.5 0 8.5 8.5 0 8.5 8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 2 1 0  face
  # plane normal = 0 0 1 0
    vertices 2 1 0 # -8.5 -8.5 0 -8.5 8.5 0 -8.5 8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 6 5 4  face
  # plane normal = 0 0 1 0
    vertices 6 5 4 # 8.5 -8.5 0 8.5 8.5 0 8.5 8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 7 6 4  face
  # plane normal = 52.5891 0 0 0
    vertices 7 6 4 # 8.5 -8.5 0 8.5 -8.5 0 8.5 8.5 0
    matref 0
  endface

invalid mesh face (0.000000): 4 3 2  face
  # plane normal = 52.5891 0 0 0
    vertices 4 3 2 # 8.5 8.5 0 -8.5 -8.5 0 -8.5 -8.5 0
    matref 0
  endface
this is the map file:

Code: Select all

#Mesh Generated By BZFlag MapU - MeshBox to Map By TS Software

#Right
mesh
	Vertex -8.5  8.5  8.5
	Vertex -8.5  8.5  0
	Vertex -8.5  -8.5  8.5
	Vertex -8.5  -8.5  0
face
	vertices 0 1 2 3
endface
face
	vertices 3 2 1 0
endface
end

#Left
mesh
	Vertex 8.5  8.5  8.5
	Vertex 8.5  8.5  0
	Vertex 8.5  -8.5  8.5
	Vertex 8.5  -8.5  0
face
	vertices 0 1 2 3
endface
face
	vertices 3 2 1 0
endface
end

#Front
mesh
	Vertex -8.5  8.5  8.5
	Vertex -8.5  8.5  0
	Vertex 8.5  8.5  8.5
	Vertex 8.5  8.5  0
face
	vertices 0 1 2 3
endface
face
	vertices 3 2 1 0
endface
end

#Back
mesh
	Vertex -8.5  -8.5  8.5
	Vertex -8.5  -8.5  0
	Vertex 8.5  -8.5  8.5
	Vertex 8.5  -8.5  0
face
	vertices 0 1 2 3
endface
face
	vertices 3 2 1 0
endface
end

#Top
mesh
	Vertex -8.5  8.5  8.5
	Vertex -8.5  8.5  8.5
	Vertex -8.5  -8.5  8.5
	Vertex -8.5  -8.5  8.5
	Vertex 8.5  8.5  8.5
	Vertex 8.5  8.5  8.5
	Vertex 8.5  -8.5  8.5
	Vertex 8.5  -8.5  8.5
face
	vertices 0 1 2 3 4 5 6 7
endface
face
	vertices 7 6 5 4 3 2 1 0
endface
end

#Bottom
mesh
	Vertex -8.5  8.5  0
	Vertex -8.5  8.5  0
	Vertex -8.5  -8.5  0
	Vertex -8.5  -8.5  0
	Vertex 8.5  8.5  0
	Vertex 8.5  8.5  0
	Vertex 8.5  -8.5  0
	Vertex 8.5  -8.5  0
face
	vertices 0 1 2 3 4 5 6 7
endface
face
	vertices 7 6 5 4 3 2 1 0
endface
end
im not great with maps but i dont think that thats right... :lol-old:

Posted: Sun Jan 08, 2006 8:29 pm
by dango
how come it places the excact same vertex twice in a row?
Vertex -8.5 8.5 0
Vertex -8.5 8.5 0

Vertex -8.5 -8.5 0
Vertex -8.5 -8.5 0

Vertex 8.5 8.5 0
Vertex 8.5 8.5 0

Vertex 8.5 -8.5 0
Vertex 8.5 -8.5 0

Posted: Sun Jan 08, 2006 9:01 pm
by Tanner
The Knights Who Say Ni wrote:nice idea but it needs developing i think
also why does it create gmon.out :?
I beleive gmon.out is something to do with it running in the cmd.

To people with problems:

What coordinates are you using (for position and box)?

-Tanner

Posted: Sun Jan 08, 2006 10:11 pm
by The Knights Who Say Ni
postion 0,0,0
size 17,17,17

simple...

Posted: Mon Jan 09, 2006 12:33 am
by Tanner
The Knights Who Say Ni
I tried that too, and get the same results.

me1
Hmm, I'll have to check my formulas.

Hopefully, I can get this fixed.

-Tanner

Posted: Mon Jan 09, 2006 1:42 am
by Teppic
Couple of things, a cube needs 8 vertices and the one in the example above has 32, they may be the same ones defined over and over again, but it's a waste of space in the map file.
Secondly, the way in which boxes are read by the map reader then put into the actual map is a little off compared to the co-ords of vertices that are in the example:- The size in x and y is applied to the box in both positive and negative directions, where as the size in z is is only applied in the positive direction, so a box 20 x 20 x 20 would be 40 wide , 40 long and 20 high.

EDIT: also marking an inside point 1/2 z above the origin and making the structure a single mesh should stop flag and player spawning inside the box.

Posted: Wed Jan 11, 2006 10:01 pm
by Tanner
Updated Version 0.2.0

Fixed the error problem. Should work very nicely now....

-Tanner

Posted: Fri Jan 13, 2006 7:37 pm
by The Knights Who Say Ni
umm are you going to attach it?

Posted: Fri Jan 13, 2006 9:23 pm
by Tanner
The Knights Who Say Ni wrote:umm are you going to attach it?
In original post. :)

-Tanner

Posted: Mon Jan 16, 2006 8:21 am
by Mostly Harmless!
I had nothing to do, and wanted to try out an icon editor. So I decided to make an icon for this program. Bear in mind that this is my first icon and I will make any changes neseccary.

Posted: Mon Jan 16, 2006 1:35 pm
by eagle
hey, thats pretty cool mostly harmless. what did you use?




one problem with the program thing......its .exe and i have a mac :(

Posted: Mon Jan 16, 2006 5:17 pm
by im fine u?
I use Awicons Lite for icons, if anyone cares :D

Posted: Mon Jan 16, 2006 5:19 pm
by Mostly Harmless!
I downloaded a trial of icon lover.

curious

Posted: Tue Jan 17, 2006 5:53 pm
by person1
what is the point of this program?

Will it later be able to combine the outline of multiple boxes into one mesh or what?

Re: BZFlag MapU - Box to Mesh V0.2.0

Posted: Tue Jan 17, 2006 10:16 pm
by Tanner
Tanner wrote: This is a simple program I made that takes the specifcations of a normal box, and converts it to a mesh allowing the user to spend much less time.
-Tanner

Posted: Mon Jan 23, 2006 12:57 am
by BIYA
I understand that part but what do you mean by it saving time?

Posted: Mon Jan 23, 2006 1:58 am
by Mostly Harmless!
It allows the user to specify the information as if he were making a normal box, but outputs it as mesh. Not a meshbox.

mesh, meshbox, and vi

Posted: Sat May 27, 2006 3:48 am
by badgerking
Just curious but what's the difference from an opengl perspective of a mesh and meshbox? My thought was that meshbox was probably a bzfs "macro" of some kind that automated the creation of boxes via the mesh.

If you really want to quickly convert a 1.0 map of boxes, just open the file in a real text editor, like vi, and globally replace box with meshbox. No need for an external program to do it.

Or am I missing the point of this program?

Posted: Sat May 27, 2006 8:39 pm
by TD-Linux
This is a good idea. The really nice thing about it is that you can, after running your map through it, import it into Blender and your boxes are now fully editable like meshes!

ENTRIELY OFF-TOPIC: You don't need to use a shareware or adware program like awicons, the GIMP supports exporting them. Try googling it.

Re: BZFlag MapU - Box to Mesh V0.2.0

Posted: Thu Sep 08, 2022 3:46 am
by Zehra
Usually bumping an old thread is frowned upon. (In this case, an updated cross platform clone inspired by Tanner's work is provided.)
boxtomesh(py).txt
Pyhon script clone of box to mesh, rename '.txt' extension to '.py'. Provided under CC0-1.0 license (fixed minor bug)
(4.41 KiB) Downloaded 99 times
Just rename the extension to `.py` and it should work.(You'll need Python3 for this script to work.)
License for script: CC0 1.0 Universal (CC0 1.0)

-Zehra