Ground XYZ and scale issues

Questions and answers about the how and why of making maps.
Post Reply
User avatar
yarro
Private First Class
Private First Class
Posts: 84
Joined: Sat Oct 23, 2004 3:51 pm
Location: NH, USA

Ground XYZ and scale issues

Post 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
anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Re: Ground XYZ and scale issues

Post 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.
User avatar
yarro
Private First Class
Private First Class
Posts: 84
Joined: Sat Oct 23, 2004 3:51 pm
Location: NH, USA

Re: Ground XYZ and scale issues

Post 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.
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Re: Ground XYZ and scale issues

Post 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
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
yarro
Private First Class
Private First Class
Posts: 84
Joined: Sat Oct 23, 2004 3:51 pm
Location: NH, USA

Re: Ground XYZ and scale issues

Post by yarro »

Thanks for the clarifications, at least I have a better idea now.
:D
User avatar
ahs3
Private First Class
Private First Class
Posts: 327
Joined: Sun Mar 04, 2007 8:33 pm
Location: Press '/' to search
Contact:

Re: Ground XYZ and scale issues

Post 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
User avatar
yarro
Private First Class
Private First Class
Posts: 84
Joined: Sat Oct 23, 2004 3:51 pm
Location: NH, USA

Re: Ground XYZ and scale issues

Post 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
Attachments
rubricks_roundabout_0.JPG
(58.96 KiB) Downloaded 8 times
anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Re: Ground XYZ and scale issues

Post 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.
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1054
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Ground XYZ and scale issues

Post 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.
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
yarro
Private First Class
Private First Class
Posts: 84
Joined: Sat Oct 23, 2004 3:51 pm
Location: NH, USA

Re: Ground XYZ and scale issues

Post 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)
Post Reply