*attention people who can make a mesh (hard way)*
- big_daddy2
- Private First Class
- Posts: 131
- Joined: Sat May 06, 2006 1:06 am
- Location: the middle of nowhere, USA
*attention people who can make a mesh (hard way)*
i was wondering if an experianced person could help me make a mesh box using vertexs normals and texcords with faces the numbers are:
position:- size:
0- 1
-301- 48
0- 25
i will also need a second, it the same but instead of a -301 make a positive
if you could do this i would be very thank-full, i suck at making these and some of u can whip one out in a few minutes
position:- size:
0- 1
-301- 48
0- 25
i will also need a second, it the same but instead of a -301 make a positive
if you could do this i would be very thank-full, i suck at making these and some of u can whip one out in a few minutes
- big_daddy2
- Private First Class
- Posts: 131
- Joined: Sat May 06, 2006 1:06 am
- Location: the middle of nowhere, USA
- big_daddy2
- Private First Class
- Posts: 131
- Joined: Sat May 06, 2006 1:06 am
- Location: the middle of nowhere, USA
-
- Private First Class
- Posts: 220
- Joined: Tue Jul 26, 2005 10:32 pm
- Location: Gainesville Florida
Try this...
you can scale this to suit your needs.
'<mat_name>' is a placeholder for your material name
hope this helps
you can scale this to suit your needs.
Code: Select all
define cube
mesh
# vertices: 8
# normals: 6
# texcoords: 4
# faces: 6
vertex 1.000 1.000 0.000
vertex 1.000 -1.000 0.000
vertex -1.000 -1.000 0.000
vertex -1.000 1.000 0.000
vertex 1.000 1.000 2.000
vertex -1.000 1.000 2.000
vertex -1.000 -1.000 2.000
vertex 1.000 -1.000 2.000
normal 0.000 0.000 -1.000
normal 0.000 0.000 1.000
normal 1.000 -0.000 0.000
normal -0.000 -1.000 -0.000
normal -1.000 0.000 -0.000
normal 0.000 1.000 0.000
texcoord 0.000 1.000
texcoord 0.000 0.000
texcoord 1.000 0.000
texcoord 1.000 1.000
face
vertices 0 1 2 3
normals 0 0 0 0
texcoords 0 1 2 3
matref <mat_name>
endface
face
vertices 4 5 6 7
normals 1 1 1 1
texcoords 0 1 2 3
matref <mat_name>
endface
face
vertices 0 4 7 1
normals 2 2 2 2
texcoords 0 1 2 3
matref <mat_name>
endface
face
vertices 1 7 6 2
normals 3 3 3 3
texcoords 0 1 2 3
matref <mat_name>
endface
face
vertices 2 6 5 3
normals 4 4 4 4
texcoords 0 1 2 3
matref <mat_name>
endface
face
vertices 4 0 3 5
normals 5 5 5 5
texcoords 0 1 2 3
matref <mat_name>
endface
end
enddef # cube
hope this helps
Thanks anomaly, that does help,
Correct me if/where I'm wrong...
if I were to code this by hand, i wouldn't need this part so much:
It seems that blender just spits that out for it's own indulgence. Instead, I would label the vertices, and normals etc. like so:
and so on.
As far as I can guess, the normals determine which way the faces face.... erm, that is, you probably want the texture of the top face to be seen from the sky, like a roof, as opposed to being seen from the inside, like a ceiling. In our case I'm referring to the second "face" with vertices 4 5 6 7 shown here:
As it turns out, using normals and texcoords are optional, but I hope someone will explain this part of the code.
Correct me if/where I'm wrong...
if I were to code this by hand, i wouldn't need this part so much:
Code: Select all
# vertices: 8
# normals: 6
# texcoords: 4
# faces: 6
Code: Select all
vertex 1.000 1.000 0.000 #0
vertex 1.000 -1.000 0.000 #1
vertex -1.000 -1.000 0.000 #2
vertex -1.000 1.000 0.000 #3
.
.
.
normal 0.000 0.000 -1.000 #0
normal 0.000 0.000 1.000 #1
normal 1.000 -0.000 0.000 #2
.
.
As far as I can guess, the normals determine which way the faces face.... erm, that is, you probably want the texture of the top face to be seen from the sky, like a roof, as opposed to being seen from the inside, like a ceiling. In our case I'm referring to the second "face" with vertices 4 5 6 7 shown here:
Code: Select all
face
vertices 4 5 6 7
normals 1 1 1 1
texcoords 0 1 2 3
matref <mat_name>
endface
-
- Private First Class
- Posts: 220
- Joined: Tue Jul 26, 2005 10:32 pm
- Location: Gainesville Florida
No you don't need that. Anything past the '#' to the end of line is a comment. The 'define' was created by modeltool. I usually export an object from blender as a wavefront .obj and convert using modeltool.Tedius wrote:
if I were to code this by hand, i wouldn't need this part so much:Code: Select all
# vertices: 8 # normals: 6 # texcoords: 4 # faces: 6
the order or numbering is right, but again blender did not 'spit out' the text. It was modeltool. I have not been successful in having BZWTools consistantly work. Since I only want the mesh anyway I just use modeltool. In case someone is not familiar with modeltool, it is included in the BZFlag source in the 'tools' directory.Tedius wrote: It seems that blender just spits that out for it's own indulgence. Instead, I would label the vertices, and normals etc. like so:and so on.Code: Select all
vertex 1.000 1.000 0.000 #0 vertex 1.000 -1.000 0.000 #1 vertex -1.000 -1.000 0.000 #2 vertex -1.000 1.000 0.000 #3 . . . normal 0.000 0.000 -1.000 #0 normal 0.000 0.000 1.000 #1 normal 1.000 -0.000 0.000 #2 . .
The normals are calculated from the face vertices. As you can see the top face normals are pointing 'up', the 'z' coord is +1.000. I think BZFlag will calulate the normals for you if you don't provide them. And you can have OpenGL do this as well. The winding or order of the vertices determine which way the face 'faces'. OGL has a setting for this: GL_CCW or GL_CW, counter clockwise or clockwise winding order. Texcoords are only necessary when you want to apply a texure to a polygon.Tedius wrote: As far as I can guess, the normals determine which way the faces face.... erm, that is, you probably want the texture of the top face to be seen from the sky, like a roof, as opposed to being seen from the inside, like a ceiling. In our case I'm referring to the second "face" with vertices 4 5 6 7 shown here:As it turns out, using normals and texcoords are optional, but I hope someone will explain this part of the code.Code: Select all
face vertices 4 5 6 7 normals 1 1 1 1 texcoords 0 1 2 3 matref <mat_name> endface
Having said that...
We can now defer to a real programmer.
- optic delusion
- Special Forces
- Posts: 1054
- Joined: Sat Sep 25, 2004 2:29 pm
- Location: Planet MoFo
- Contact:
Tedius, you should get wings3d and the export plugin, then start making your own meshes, it's easy and free. You will like it.
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.
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.
-
- Private First Class
- Posts: 220
- Joined: Tue Jul 26, 2005 10:32 pm
- Location: Gainesville Florida
I agree with Optic. Wings3D is a very nice subdivision modeller. I have used it alot. And as Delusion pointed out there is a BZFlag exporter plugin. It doesn't handle number conversion very well. You may end up with numbers like -2.2345667e-19. Thats essentially 0.0 (zero) as far as bzfs is concerned. I have had issues with those kind of numbers in maps. And had to hand edit them to zero. However... Wings3D can export as wavefront object format. And you can use modeltool to convert. I find that modeltool does a very nice job. Wings3D can do some useful things that blender can't do, at least without plugins. Like inset polys and bevel individual points and edges, for instance.
Although blender has a steep learning curve, you CAN learn it. (If I can anyone can).
Although blender has a steep learning curve, you CAN learn it. (If I can anyone can).
I know I'm stubborn, but I like to hand code my maps. I've used blender, I've followed the tutorial, and I've even exported it to my map. Obviously if I want to make something complicated like a volcano, I would want to use a modeler. Its just moments like the one big_daddy had that make me want to figure out how to make a simple box without having to go through all the trouble of an external editor. I am hoping that once we weed out all the extra stuff that these programs dump in, it won't be all that bad to hand code something simple. We've got a good start I think, we just need someone to help us work out texcoords.
A good idea for learning how everything in a map file works. I coded my Tunnels map entirely by hand (probably overkill, hehe). That was really good for learning how to do it, but I'd probably use a real modeler in any subsequent maps I make.Tedius wrote:I know I'm stubborn, but I like to hand code my maps.
- optic delusion
- Special Forces
- Posts: 1054
- Joined: Sat Sep 25, 2004 2:29 pm
- Location: Planet MoFo
- Contact:
I used text exclusively to map for 18 months. There's nothing wrong with that. You will have ideas that a mapper using modelers would never have.
Even with lots of experience using modelers, you still need to do some things in text. The best mappers know both ways to do it.
Even with lots of experience using modelers, you still need to do some things in text. The best mappers know both ways to do it.
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.
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.