Page 1 of 1

Meshes

Posted: Fri Oct 29, 2010 12:47 am
by Mark_IV
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.

Re: Meshes

Posted: Fri Oct 29, 2010 12:53 am
by joevano

Re: Meshes

Posted: Fri Oct 29, 2010 1:12 am
by Mark_IV
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.

Re: Meshes

Posted: Fri Oct 29, 2010 3:52 am
by macsforme
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

Re: Meshes

Posted: Fri Oct 29, 2010 6:50 am
by optic delusion
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.

Re: Meshes

Posted: Fri Oct 29, 2010 10:40 am
by Mark_IV
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?

Re: Meshes

Posted: Fri Oct 29, 2010 3:58 pm
by Cobra_Fast
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)

Re: Meshes

Posted: Fri Oct 29, 2010 8:35 pm
by Mark_IV
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.

Re: Meshes

Posted: Fri Oct 29, 2010 10:58 pm
by optic delusion
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

Re: Meshes

Posted: Sat Oct 30, 2010 12:34 am
by Mark_IV
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*'

Re: Meshes

Posted: Sat Oct 30, 2010 12:36 am
by Cobra_Fast
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.

Re: Meshes

Posted: Sat Oct 30, 2010 1:14 am
by Mark_IV
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.

Re: Meshes

Posted: Sat Oct 30, 2010 1:46 am
by optic delusion
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.

Re: Meshes

Posted: Sat Oct 30, 2010 1:52 am
by Mark_IV
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