Meshes

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Meshes

Post by Mark_IV » Fri Oct 29, 2010 12:47 am

Please correct me if I'm wrong, I think meshes are what I'm talking about. I made a object in Anim8tor, and exported it as .obj and converted to .bzw yada yada ya. I want to add it to a map, I know how to make groups, but when I do define group, the code for the object is thousands of lines long. In the define group could I put a different .bzw file with ONLY the object code, this way my map .bzw wont be overflowing with thousands of lines of this object.

User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Meshes

Post by joevano » Fri Oct 29, 2010 12:53 am

There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln

User avatar
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Re: Meshes

Post by Mark_IV » Fri Oct 29, 2010 1:12 am

Thanks you joey, also, I am having trouble with groups. With my test map, which is just the object, I have this

world
size 400
end
group object
shift 300 300 0
end
define object
*Miles of Code*
enddef

yet, the object wont move at all, even though I shifted it.

User avatar
macsforme
General
General
Posts: 2024
Joined: Wed Mar 01, 2006 5:43 am

Re: Meshes

Post by macsforme » Fri Oct 29, 2010 3:52 am

Off the top of my head, I think you would want to use "position" to move the group, as in this:

Code: Select all

group myGroup
	position 300 300 0
end

User avatar
optic delusion
Special Forces
Special Forces
Posts: 990
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Meshes

Post by optic delusion » Fri Oct 29, 2010 6:50 am

Mark_IV, that looks like it should work. Are you sure you have properly defined the group in the include file? Sounds like the enddef may be missing. use -dddd

I prefer to use "shift" instead of " position" in group placement, as it behaves better with rotation, and groups are very often rotated.

Another thing i'd like to mention... when you build your mesh for a group, it is preferable to leave it centered around point 0 0 0, making it easier to shift around the world.
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
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Re: Meshes

Post by Mark_IV » Fri Oct 29, 2010 10:40 am

Optic Delusion wrote:
Another thing i'd like to mention... when you build your mesh for a group, it is preferable to leave it centered around point 0 0 0, making it easier to shift around the world.
I did do that, I figured it would be easier.

Do I put -dddd in the config, what does that do?

User avatar
Cobra_Fast
Dev Monkey
Dev Monkey
Posts: 321
Joined: Sat Oct 07, 2006 11:51 am
Location: Germany
Contact:

Re: Meshes

Post by Cobra_Fast » Fri Oct 29, 2010 3:58 pm

Mark_IV wrote:Do I put -dddd in the config, what does that do?
-dddd writes tons of information to the console on what's happening on the server and what the server is doing. It's useful for tracking problems which helps on finding a solution. (see http://my.bzflag.org/w/BZFS_Command_Line_Options)

User avatar
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Re: Meshes

Post by Mark_IV » Fri Oct 29, 2010 8:35 pm

Also, how do I texture a mesh. I looked at r3lax's wooden tower, and he uses matref, but do I really have to add that too all of those lines? Is there an easier way. I can texture it in my 3d editor, but what I use it in BZ, it is untextured.

BTW I got it to move where I wanted it too.

User avatar
optic delusion
Special Forces
Special Forces
Posts: 990
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Meshes

Post by optic delusion » Fri Oct 29, 2010 10:58 pm

would have been better to apply the material in your 3d editor. I suggest you do that and re-export.
The wings3d exporter has a setting {one group per material} that produces face code looking like this... It's possible to add them via text editor, but how do you know which face is which? You don't! So the only realistic way to add materials to a mesh is to is via the 3d editor.

Code: Select all

 
matref invisible ## each face after this will use the material, until another material is specified
  face
    vertices 0 282 70 134
    normals 0 282 70 134
  endface
  face
    vertices 1 199 17 135
    normals 1 199 17 135
  endface
  matref cross #this is the new material
  face
    vertices 0 2 1
    normals 0 2 1
  endface
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
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Re: Meshes

Post by Mark_IV » Sat Oct 30, 2010 12:34 am

So when you say the matref invisible thing, I use that once and ALL the faces use that texture? For what I'm doing that's fine. And is it actually 'matref invisible' as a code, or is that an example, and I put 'matref *Material Name*'

User avatar
Cobra_Fast
Dev Monkey
Dev Monkey
Posts: 321
Joined: Sat Oct 07, 2006 11:51 am
Location: Germany
Contact:

Re: Meshes

Post by Cobra_Fast » Sat Oct 30, 2010 12:36 am

All faces below the matref line use that material. So you can assign different materials to groups of faces without attaching the matref to each single face.

User avatar
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Re: Meshes

Post by Mark_IV » Sat Oct 30, 2010 1:14 am

Cobra_Fast wrote:All faces below the matref line use that material. So you can assign different materials to groups of faces without attaching the matref to each single face.
Okay, thanks. This makes it much easier to materialize my object.

User avatar
optic delusion
Special Forces
Special Forces
Posts: 990
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Meshes

Post by optic delusion » Sat Oct 30, 2010 1:46 am

Yeah, but there's no way to know which face is supposed to have which material... You can only do this if your object has only one material.
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
Mark_IV
Private First Class
Private First Class
Posts: 157
Joined: Wed Aug 25, 2010 12:24 am
Location: Actually joined 2004 or 2005 as tyjr ;)

Re: Meshes

Post by Mark_IV » Sat Oct 30, 2010 1:52 am

Optic Delusion wrote:Yeah, but there's no way to know which face is supposed to have which material... You can only do this if your object has only one material.
Perfect, my object is only 1 material XD

Post Reply