Thu, Jan 9, 4:16 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 09 3:46 am)



Subject: Project #1: ASC to OBJ converter


Markus-3D ( ) posted Fri, 23 May 2014 at 3:53 AM · edited Thu, 09 January 2025 at 4:10 PM

file_504503.jpg

Attachment is a view of created geometry containing 9 million vertices.

Now, when I have somewhat build up the new system I have moved more interest to creativity. I want to create with the new resources I now have.

I became interested to create ASC to OBJ converter, because I had great difficulties to find software, which could do that for me. The ASC file I tried to convert contains only the height coordinates and with a bit editing I have been able to create the 3D-model to import and use. Now I got a thought, that why I should not try to create a conversion tool straight from *.ASC to *.OBJ, which would be ready with v, vn, vt, #, g, mtllib etc. rows.

Then there would be different settings for geometry sizing, placing and finally straight adding to the prop library with default values and sensitivity of values. Also I found that the Poser Pro 2014 had difficulties with the geometry, so I plan also geometry slicing options. Plans and so on, but usually all my code gets done only to the level, which is just enough, that the code is helping with a bit of editing. I now have a partial solution for every part, but the code needs improvements and loads of test runs.


ironsoul ( ) posted Fri, 23 May 2014 at 6:03 AM

Interesting project, any plans to include support for displacement maps so the vertex count can be reduced.



Markus-3D ( ) posted Fri, 23 May 2014 at 7:23 AM

Thank you for the interest and idea. For displacement support I would need to research some image file format that conversion to displacement would be possible. That would be a very challenge, which could well be the next level for conversion. I definitely am interested to try that.

I think that I might hit the goal on texture coordinates with splitted geometry, at least the resulting obj files looked very promising. I try first to get some base code done and then add selectable options. Now I have to test, how the (splitted) geometry texturing have been succesful.


prixat ( ) posted Fri, 23 May 2014 at 9:59 AM

What is the ASC format and where is it from?

regards
prixat


Markus-3D ( ) posted Fri, 23 May 2014 at 10:40 AM

Description here (I seeked the English version link):
http://www.maanmittauslaitos.fi/en/digituotteet/elevation-model-2-m

The height numeric accuracy in the file (*.ASC) is 0.001 metres, only one millimeter, but the link promises accuracy 0.3 metres.


heddheld ( ) posted Fri, 23 May 2014 at 3:46 PM

how does "your" asc compare/convert to dems ?

http://en.wikipedia.org/wiki/Digital_elevation_model

asking partly because I have never heard of ASC before but have lots of DEMs that I have used in Terragen

be nice if you could expand your idea enough to cover other types of height data ?

is any other types of height data available for other countries ???

have fun and luck with your project !!! look forward to seeing more


prixat ( ) posted Fri, 23 May 2014 at 5:26 PM

I downloaded a couple, ASC is just ascii text.

A grid of 3000 by 3000 numbers separated by spaces.

regards
prixat


Markus-3D ( ) posted Fri, 23 May 2014 at 7:51 PM · edited Fri, 23 May 2014 at 7:53 PM

file_504515.jpg

In attached image the small square seems to be in correct place in divided geometries. Top left and bottom right slices are not loaded.

@heddheld:

The ASC file I used starts:

ncols          3000
nrows          3000
xllcorner      584000.000
yllcorner      7182000.000
cellsize       2
NODATA_value   -999.999

Then there are value list after that. Also I myself had not previously heard of ASC, before I became interested into ground measured geometry. As prixat did, you can download those files by yourself from selected areas. Read the link I provided, from there you can go forward to downloads.

The aerial link for the geometry I used:

http://kansalaisen.karttapaikka.fi/asetukset/asetukset.html?e=589677&n=7187744&scale=40000&tool=siirra&styles=normal&lang=en&mode=orto&showSRS=EPSG%3A3067&width=800&height=800&feature=utmlehti&tool=siirra&lang=en&mode=orto&map.x=131&map.y=674

R5144 is that geometry and R5144E4 top right corner locates my home.

 

If I had Terragen or Terragen's file format DEM, it might be covered also. Currently I am stuck with BMP's bitmap file header structure and byte's #3 dwords logic. I have not yet examined that much, but the target is to create a displacement map from geometry. The *.obj creation with texturing and fixed slicing worked well, as in that image with test texture there is square in point, where the source file is created to 9 geometries (3 in a row) and the same texture is spread to all 9 geometries.

 

As far as I have found, other types of height data is not available. That's why I was forced to solve, how I could import the data into 3D program like Poser to view and explore.

 

@prixat: You made very good explaining in few words. I myself have limited skills in English, so I have to use more words to picture what I want to say. Maybe I learn(ed) the new word to me, that grid...

OT: I have a painful left arm muscle and can't sleep, concentrate or do a things very efficiently. I think I damaged it about 3 weeks ago with heavy loads, when making firewoods... It feels like it was on fire...

 

EDIT: was a circle written instead of square, which is on the image with black color.

 


shvrdavid ( ) posted Sun, 25 May 2014 at 9:36 AM

Have you tried any of the video game converters such as XNALara Posing Studio?

That can read mesh.ascii files (and many others) and save them out as obj files.



Some things are easy to explain, other things are not........ <- Store ->   <-Freebies->


Markus-3D ( ) posted Sun, 25 May 2014 at 5:54 PM · edited Sun, 25 May 2014 at 5:56 PM

file_504554.jpg

IMAGE: First test with the result of geometry to displacement map converter, still WIP..

@shvrdavid: No I haven't. I have not played much with pc in recent 5+? years.

But I have now been able to create code that converted the geometry to displacement bitmap, yay! :D It has some development yet needed, like it is mirrored, but you may see that the displacement is for the same geometry than seen above.

 

EDIT: It is also on background picture....


heddheld ( ) posted Mon, 26 May 2014 at 1:55 AM

dems arn't tied to Terragen in any way (just was my fav proggy at that time lol )

there a goverment(uni)  thing using satellite data  and is availible in quite a few resolutions and they cover huge chunks of our planet!! (maybe not all ) think it could be a major "selling point" if people could model there own backyard or there fav camping spot

link is to Yale uni so is minimum on ads ;-) and has lots of info on the types of maps etc

http://www.yale.edu/ceo/Documentation/dem.html

have fun (when it isnt fun GET paid for it lol )


Markus-3D ( ) posted Mon, 26 May 2014 at 5:22 AM

I checked the link and now I figured the DEM. Very interesting link! LOL, I had been so hurry and excited in developing, that I didn't remember to checkthe link you posted earlier, or maybe my eyes are coming blind. I'm sorry about that. But that one you just posted will be in closer examination in very near future. First I have to try to develop the code more flexible and automatical. Yet it works only with fixed values.

Maybe I shoul split project process to 2 different ones. Reading coordinate data is this one as originally and converting to displacement data would be another. There is still many things to develop with the main parts alone...

Cheers!


prixat ( ) posted Wed, 28 May 2014 at 4:37 AM

Hi Markus

I thought I would try to write a convertor too, just for fun.

To get the 'faces' that OBJ requires, I'm thinking of reading in 2 lines at a time. 

(The way I'm doing this doesn't seem suitable for multi-threading?)

 

Is that the way you did this?

regards
prixat


Markus-3D ( ) posted Wed, 28 May 2014 at 6:27 AM

Hello. I have considered also multithreading because of the multicore, but first I concentrate on the features, because I am too interested in the results and the conversion time is bearable (but could be improve with multithreading). See my another thread, I just posted first version of geometry to displacement results.

I have not multithreaded yet and this one displacement of terrain is made from straight coordinates, because they are on the grid.


timarender ( ) posted Wed, 28 May 2014 at 12:42 PM · edited Wed, 28 May 2014 at 12:43 PM

Some comments:

I do not think the "XNALara" app will accept this format of 'ascii mesh' files.

I suspect that using a displacement map limits (max 256) the number of different values (i.e. Levels).

Other than converting to an OBJ; one option may be to write a script for Poser Python, based on the shipped script "fractualTerrain.py".  With some additional code it could read the original datafile; and then write the required values when 'filling out the the vertex array'.


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.