www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 Need help shifting the position of a zone « View previous topic :: View next topic » 
Author Message
Jaggedge
PostPosted: Thu May 28, 2009 5:01 am    Post subject: Need help shifting the position of a zone Reply with quote



Joined: 08 Jul 2008
Posts: 56

Hi, I need some help shifting the position of a zone. I've been working on it for some time, the terrain is sculpted and terrain layers painted in, 6 of them.

Now, I'm required to shift the position of the terrain and I need to do it with precision. I understand that there isn't any function in Grome to do this easily. As far as I know, I need to export the data and bring it back into a newly created zone which is in the right position? Please correct me if I'm wrong.

My questions are:
1. How do I find out the exact coordinates of an existing zone? I wish to shift the zone by exact coordinates ( 10240 units for example ) so it'll help if I knew the existing position.

2. How should I export the terrain information? My best guess so far is Heightmap-RAW, Color and Mask layers-PNG... But all I got was 2 textures for the texture layers, I would've thought it'd be one mask for one terrain layer?

Any help would be greatly appreciated. Thanks!
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Thu May 28, 2009 6:47 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

Ah, ignore the 2nd question, just figured it out. I had a Export As Multiple Image Channels option checked. Unchecked it and I got my individual texture layer masks.

A different question though, why is that I need to scale the heightmap, when I import it, by 0.05 in order to get it looking right? 0.05 gets it close to the original but not exactly...
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Thu May 28, 2009 7:04 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

I created a zone with its center at -10240,-10240,-98304.. then I selected the zone and imported a RAW heightmap into it, with an altitude scale of 0.0471923582 ( this is the closest I can get to the original height ). Everything works out pretty alright, except the zone seemed to have snapped up back to 0 on the Y-axis! Why does it do this?
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu May 28, 2009 7:26 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1328

Hi,

First you need to export the heightmap. Best solution is 16bit RAW (you are probably already using this) from General Large Data Exporter or from Text Exporter. Text Exporter can save individual RAW files for each zone while the General Large Data Exporter usually save one for the entire scene. So use the text exporter if you have more than one zone in the scene (or you can use the second one and insert the correct sampling step (equal with the tile size) and "export only selected" option).

At import (with RAW importer) make sure you indicate the exact altitude range of the zone (you can find this with the Scene Statistics plugin from the Utils menu in Grome before exporting). Create 1 single zone. About position, yes this is a tricky one. For now you cannot find this from the UI (you can detect if from SDK with a plugin though). I will add this information in the scene statistics plugin and upload it here shortly.

For textures, yes you need to individually export them. For each layer you will export its mask (if it has one) and the tiling texture. Then after you import the heightmap (as described above) you need to manually assign back the layers and choose the exported images. The layers themselves are still in the scene but you need to select the new zone and assign them back.

When assigning the layers back make sure:
- you select the same shading
- you select the same mask size (you can have different images tough and the grome will rescale at reassignment).
- you select the same tiling

You can have all these exported in a human readable format (that is text) with Simple Text Exporter.

Now, before importing the new zone, I recommend to not delete the old one. This will help you reassign the layers and avoid manually resetting the tiling, texture to be used etc. If you have the old zone in the scene you will notice that the layers still expose the assignment in the Global layers tab. You can then select the newly imported zone and choose "Fill Selection" for each layer (in the global tab by pressing the > button). In this way the same tiled texture and texture mapping is used without having to manually reset them.

So, to summarize:
- import the new zone heightmap from the RAW
- select it (have only this zone selected)
- goto Global layers view and press the > button
- select Fill Selection.
- then goto Selection layers view and expand each layer and click on the mask thumbnail and select the exported masks
- deselect new zone and select the old one and delete it

Now all that you need is the information about the position of the zone. I will have an updated version of the statistics plugin shortly.

In the future we will probably add a zone move tool to avoid all these.

Regards,
Adrian L.
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu May 28, 2009 7:27 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1328

About the post from above, you should select the altitude range from the exporter rather than the scaling. To find the range you can call the Scene Statistics plugin from the utils menu. It shows you the current scene range and if you have only your zone in the scene (or you can temporarily delete all others and then undo) this will be its range.
Back to top
View user's profile Send private message
ALicu
PostPosted: Thu May 28, 2009 9:35 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1328

And here is the updated statistics plugin:
www.quadsoftware.com/storage/UtilStats.plug

Just copy this over the old one in the Plugins folder where you have Grome installed.

Then from Utils -> Scene Statistics you will see the zones positions and centers for all and "only selected" zones.

Regards,
Adrian L.
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Fri May 29, 2009 5:00 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

Thank you the replies, ALicu, I'll try it out! Very Happy
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Mon Jun 08, 2009 8:59 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

Hi ALicu,

I tried out your methods and so far so good! I'm able to get an accurate height export and imported.

The plugin that you supplied however, doesn't seem to work on my Grome. I'm currently using 1.20.26, we haven't updated our version of Grome yet. Could this be why?

I overwrote the old UtilStats.plug with the one you sent, but I don't see the information that you described.
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Jun 08, 2009 9:06 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1328

Hello,

I've tested the plugin with the latest Grome version (1.20.30) and it worked. Can you try to install this latest version? Just login into your client account, download the latest setup and install it over the old one.

Regards,
Adrian
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Mon Jun 08, 2009 9:13 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

Hi ALicu,

thanks for the prompt reply and for the testing the plugin. I'm happy to say you're right, the plugin works perfectly. I realised I had this problem before where we tried to update our plugins but it always seemed to use an older version somewhere.

To fix this, we used AgentRansack to sniff out all copies of the plugin and delete them. Then we copied the fresh new plugin in, and it works now.

Thanks for the plugin, ALicu!
Back to top
View user's profile Send private message
Jaggedge
PostPosted: Mon Jun 08, 2009 10:26 am    Post subject: Reply with quote



Joined: 08 Jul 2008
Posts: 56

Hi ALicu,

not sure if this is right, could you have a look?

Terrain horizontal range (XZ):
-98304.000, -102400.000 -> 98304.000, 81920.000
(Selected: -16384.000, -16384.000 -> 16384.000, 16384.000)
Terrain center (XYZ):
98304.000, 13093.164, 92160.000
(Selected: 16384.000, 1544.437, 16384.000)


if my XZ stretches from -16384 to 16384, shouldn't my centre be in 0?
Back to top
View user's profile Send private message
ALicu
PostPosted: Tue Jun 09, 2009 11:09 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1328

Yes, it seems that your selected zone(s) are centered in 0,0 on XZ (horizontal plane). The terrain center was incorrectly computed. Sorry about that, just download the plugin again:

www.quadsoftware.com/storage/UtilStats.plug

Now it should work fine.

Regards,
Adrian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group