Page 1 of 1

Ground XYZ and scale issues

Posted: Mon Nov 02, 2009 2:52 am
by yarro
How can you determine scale and if the map is in positive space and centered in a 2.0 compliant map editor before exporting as a bzworld? For instance what axis is up in Wings or Blender and how do you flip or rotate to set on ground? How do scale to a 800 unit board in a simple fashion? Just some issues I'm running into. Thanks.
-Y

Re: Ground XYZ and scale issues

Posted: Mon Nov 02, 2009 7:54 pm
by anomaly
In blender or wings3d just create the model you want. The coords will be fine. The units for scaling are similar. One unit in blender is one unit in BZFlag. If you want a box 100x100x100 then scale it to 100x100x100 in wings3d or blender. The object should be centered and sitting on the ground plane in wings3d or blender. That way the models will be easily placed in the BZFlag world file.

You haven't said how you plan to export your model. I export as .obj and use modeltool to convert. There are toolkits to create bz worlds in blender and wings3d as well.

You can always create a simple 3D model and experiment with it in a bzw file too.

Re: Ground XYZ and scale issues

Posted: Mon Nov 02, 2009 8:16 pm
by yarro
The problem is that I'm creating the models in other software and importing to Blender or Wings and the model seems to go through rotations during export and winds up unusable due to axis issues.

Re: Ground XYZ and scale issues

Posted: Mon Nov 02, 2009 10:06 pm
by Spazzy McGee
For the record: Wings3D and blender both use the Y axis as the vertical up axis, whereas BZFlag uses Z. This is solved by simply switching the coordinates for the Y and Z axes when exporting.

When you export from Wings or Blender, there are options to automatically 'Flip Y and Z axes'

Bear in mind that when an object is scaled in BZFlag (using the scale parameter in a group), it scaled from it's relative origin (coordinates 0 0 0), and not from the geometrical centre of the object. This means that everything is scaled away from the origin (distances from the origin are scaled too).

If you've still got orientation and scale issues, you can bung everything in a group definition and use the scale and spin parameters.

http://my.bzflag.org/w/Define
http://my.bzflag.org/w/Group

Re: Ground XYZ and scale issues

Posted: Tue Nov 03, 2009 2:56 pm
by yarro
Thanks for the clarifications, at least I have a better idea now.
:D

Re: Ground XYZ and scale issues

Posted: Tue Nov 03, 2009 11:40 pm
by ahs3
Also another helpful tool to to specify a size of an object.

1. Click on the small box to the right of the object name.
Image

2. Enter the size, as Spazzy said remember Z and Y are reversed in wings3d.
Image

3. A simple cube 100x100x15
Image


--ahs3

Re: Ground XYZ and scale issues

Posted: Thu Nov 05, 2009 9:10 pm
by yarro
The problem is that I have an entire world scaled wrong and oriented wrong which is more complex than a cube. I need to be able to select entire mesh object and then have a simple command setting the axis for the group, an option I have a hard time finding or using successfully in blender or wings.
Basicaly, I have to scale a group to 800 X 800 units and then set the UP direction so it stops coming out on its side or under ground or the size of a small pea in the bzworld.

OK - problem solved

I have a legal demo version of 3DS max and here are the steps that worked for me. I didn't need to use blender or wings for this I imported into Max -- under import default pop-up allow flip zy axis -- select all -- edit -- scale -- type 800 under X co-ord -- hit lock and applies to all axis -- un-group any objects -- export .Obj file -- under export options pop-up un-select default flip yz poser style option -- I also used the blender option -- drop out put saved Obj file on model tool and viola' a working bz world, of course you could use something else besides 800 scale.
This was for scaling an entire world that had lost it's scale due to whatever reason - the original scale was 800 based on the old BZEdit.
Here is a screen-shot of the resultant world in BZF

Re: Ground XYZ and scale issues

Posted: Sun Nov 08, 2009 4:12 pm
by anomaly
Spazzy McGee wrote:For the record: Wings3D and blender both use the Y axis as the vertical up axis, whereas BZFlag uses Z.

Actually blender uses the Z axis as the vertical up axis.

Also you can apply tranforms to imported models and correct for any rotations that occur as part of the import process. When I export my models to .obj format I do not use the Rotate X90 option. That will effectively exchange the Y and Z axes.

Re: Ground XYZ and scale issues

Posted: Tue Nov 10, 2009 1:19 am
by optic delusion
They forgot that you asked about scale. A trick I often use in Wings3d is ....
I set the import (obj) scale to .025 and the export (bzw) scale to 40. This takes a default-sized BZWorld (800x800) and fits it perfectly on wings' ground plane. If my worldsize (1000x1000) I'll use an import of .020 and export of 50.

Re: Ground XYZ and scale issues

Posted: Tue Nov 10, 2009 2:43 am
by yarro
Thanks you all for the the helpful input, Ill give it a whirl next time I build a map. Currently I trying to import teleporters or add them in blender but I get some script error, then there is textures and preventing spawning on the ground plane but I'll throw up a new question for that perhaps?
8)