View Full Version : XYZ data into AC3D
Mossie
3rd August 2006, 03:36 AM
I've extracted some xyz data for terrain modelling and would like to be able to import the raw xyz data into AC3D.
I've looked at some file formats, thinking I might be able to use one, but much harder then I though.
Is it possible to import acsii x,y,z file into AC3D ?
Andy
3rd August 2006, 07:58 AM
Just make it into an AC3D (.ac) file e.g.:
AC3Db
OBJECT poly
numvert 7
-0.83 -0.235 -0.04
-0.63 0.185 -0.04
-0.55 0.235 -0.25
-0.33 0.235 0.29
0.09 0.235 -0.29
0.33 -0.195 -0.04
0.83 0.005 -0.04
kids 0
There's also the .pf importer - Field plugin. See Help->About-plugins for more info.
Once you get the point data into AC3D, do a Vertex->create-2d-mesh to put surfaces on the vertices.
Mossie
3rd August 2006, 09:16 AM
Great, got the points in, but unable to create surfaces as suggested.
I get message "Unable to perform this function becuase one or mare points are in the same position or plane" I tried surfaces using all three options, but the same message.
Then tried just selecting 4 vertices, same message.
There are 40804 vertices, spaced at 50 meter intervals, representing 10 km square.
Maybe too much data ? Or as it is a terrain model, a number of points are at sea level and thus 0 altitude.
Andy
3rd August 2006, 10:55 AM
Optimize the vertices to make sure there are no duplicates.
You may need to scale the whole lot so it's larger, if the floating point numbers are very small.
If you still can't get it working, send me the file and I'll have a go.
Andy
Mossie
3rd August 2006, 11:51 AM
Tried those and no difference. Something is not right, even trying a small area causes the message. Doing the whole just stalls.
File is bigger then allowed by attachement. Send via e-mail.
Andy
3rd August 2006, 12:55 PM
Got the file. Due to the precision used in Create Mesh function, the best thing for this model is to size the whole model to 1x1x1 (SizeTo) and then do the Vertex->Create-2D-Mesh->Front. (you can try this in sections, otherwise, looking at 40,000 vertices will take a long time to complete)
Mossie
3rd August 2006, 01:46 PM
OK, thanks for having a look. The file is just too big, even doing small sections doesn't work, but when I do a new model, make a mesh remove surface move vertises and then make a new surface, it does. Something wrong with the file format I think.
Andy
3rd August 2006, 02:22 PM
I did it with the file you sent (see pic above).
I simply clicked on SizeTo (1x1x1) first.
The projection you select is important. In this case, I used Vertex->Create-2d-mesh->front.
Look the field plugin:
The first two numbers in the file are the x, y size of the grid.
this is followed by (x*y) heights in row order.
If you can get your data like this (all you really need ar the point heights and the size of the grid), You'll get a better mesh.
Mossie
3rd August 2006, 02:40 PM
What field plugin are you refering to ?
Don't understand.
Andy
4th August 2006, 02:53 AM
In AC3D, select menu Help->About-Plugins and select the Field Import Plugin from the list - this will tell you more.
Mossie
4th August 2006, 05:01 AM
Ok, found that pf file format, I assume is:
grid x grid y
pos x pos y height z
pos x pos y height z
Or should it be
grid x grid y
height z
height z
If the first then I've a new error
"myalloc 8 failed
unable to alloc 8 bytes"
I think this is a file error, thoughts please.
Andy
4th August 2006, 05:27 AM
It should be:
grid_x grid_y
height_z
height_z...
e.g. I made this up:
3 3
1
2
2
3
1
2
3
4
2
This is a 3x3 grid of points.
Mossie
4th August 2006, 06:18 AM
Thanks, got that to work, now have a 10 x 10 km model textured with google earth.
Heavy on the PC, but working. Will have to work with smaller sections, otherwise PC will stall.
Thanks Andy.
Andy
4th August 2006, 08:13 AM
Sounds great - can you post a piccy?
Did you extract the data from Google Earth?
Andy
Mossie
4th August 2006, 09:01 AM
Post a pic later, need a better viewpoint. The data was extraced from GIS source, we use for the game engine terrain, but texture from google earth.
Next is to build the town on it and then discard the terrain before putting in game.
A lot of work, but this is an experiment to see how usefull this approach could be in building a real town in detail.
I was also looking at grebble to see if this could help with random town building, and early results are not as good as I'd like.
Stiglr
22nd August 2006, 09:18 PM
Mossie, what cool weirdness are you up to with that terrain chunk...?
Do tell.
;)
Mossie
23rd August 2006, 03:10 PM
The plan is to be able to build towns and villages with the correct locations and heights for all buildings. Also for bridges and such. Doing this outside the terrain, and testing in game is too long winded. Once the models are built and placed the terrain is discarded.
vBulletin® v3.8.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.