Author Topic: .chan import error  (Read 3862 times)

Offline cyphyr

  • Member
  • *
  • Posts: 4035
    • richardfraser
.chan import error
« on: December 02, 2008, 04:31:05 PM »
I have created some .chan camera animation files.
See sample below.
When I load these in to the camera via the Import Chan File button they load fine except that z (bold) axis is negative.
As you can see the numbers here are not negative but if you copy out the text below (remove the formatting (bold) and save as a text file with a .chan extension you'll see what I mean.
If I import with the z up box ticked the negative value disappears but its in the wrong place, well it would be right if z was up....

Quote
0   8961.416016   858.853638   602.062012   -4.7   -55.3   0   60
1   8951.613281   858.032471   608.516846   -4.69959   -55.3659   -0.045489   60
2   8941.80957        857.210754   614.974121   -4.69836   -55.4316   -0.0909327   60
3   8932.005859   856.388367   621.433838   -4.69632   -55.497   -0.136332   60
4   8922.203125   855.565369   627.895935   -4.69348   -55.5623   -0.181688   60
5   8912.399414   854.741821   634.360291   -4.68985   -55.6273   -0.227003   60
6   8902.59668          853.917664   640.826965   -4.68544   -55.6921   -0.272275   60
7   8892.792969   853.092957   647.295776   -4.68027   -55.7567   -0.317508   60
8   8882.990234   852.267761   653.766785   -4.67433   -55.8211   -0.362702   60
9   8873.186523   851.441956   660.239868   -4.66764   -55.8854   -0.407857   60
10   8863.382813   850.615723   666.714966   -4.6602   -55.9494   -0.452976   60

Should not be too hard to fix I'd have thought :)
Richard
ps: Import will tell you that it dose not have enough columns, its wrong lol :)
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Re: .chan import error
« Reply #1 on: December 02, 2008, 07:51:56 PM »
Just checking my TGS conversion database... and yes, that is correct for TGS files converted to chan. 

Quote
Case ( Prefs_Import_Data_Type = "TGS";
   If ( Prefs_TER_centred;
      -1*(TGS_Output_CamposY - (Prefs_TER_dimensions * Prefs_Scale_CamPos / 2) + Prefs_IncrementCamZ)
      ; -1 * TGS_Output_CamposY) + Prefs_IncrementCamZ;

While the format defines the type of values in different columns, it doesn't define how individual applications use them so it will depend on which application the data comes from as to what conversions are necessary.  That's why I use a database to handle the conversions (apart from making it easier to add additional tweaks without regenerating the data)
« Last Edit: December 02, 2008, 07:57:48 PM by bigben »

Offline cyphyr

  • Member
  • *
  • Posts: 4035
    • richardfraser
Re: .chan import error
« Reply #2 on: December 02, 2008, 08:40:13 PM »
Hi Ben
yes I'm using Access to make the conversion and as I'm not too conversant in Access coding I'm muddling my way through "manually". I don't think that's the problem though, surely once numbers are in a chan doc terragen shouldn't go changing them. I know it will truncate the decimal point (I'm working to 3dp now) but Terragen should not invert a numbers value.
The chan file above when imported to terragen all the bold values go negative.
Hmmm getting there but there's a lot to figure out :)
richard
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Re: .chan import error
« Reply #3 on: December 03, 2008, 02:48:09 AM »
Posibly just as easy to do in Excel.  Paste converted TGS values into one sheet and calculate chan values in another... but then I really dislike Access  ;)    Filemaker is much nicer.


Offline cyphyr

  • Member
  • *
  • Posts: 4035
    • richardfraser
Re: .chan import error
« Reply #4 on: December 03, 2008, 03:12:49 AM »
I got a working solution now using the lightwave TGSExport plugin, rendering now. The script is designed for TG 0.9x so there is a little inconsistency but as long as I stay close to the origin (0,0,0) it seems to work.
I had to get some help, a little script from a friendly chap over at the Excel help forum, StephenR. I run this on the imported TGS script, swaped some of the columns about and changed some of the column values positive to negative (multiplied the entire column by -1), add in the FoV column and coppied out all the cells into a text doc and saved as a .chan file. Job done, well I'll find out in the morning lol.
Terragens fast enough now to make this actually worth doing, I err hope :)
Richard
ps Filemaker  looks interesting I'll have to give it a go sometime
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)
i7 980 @3.75Ghz, 16Gb (TG4 benchmark 18:40)

Offline Matt

  • Planetside Staff
  • *
  • Posts: 3552
  • I'm the crazy one
Re: .chan import error
« Reply #5 on: December 06, 2008, 09:25:55 PM »
The .chan format is not native to Terragen, and it uses a different coordinate system. The values you see in TG2 after importing are not the same as the values in the file, because Terragen has to convert to its own coordinate system.

In more detail:
http://forums.planetside.co.uk/index.php?topic=1409.msg13994#msg13994
http://forums.planetside.co.uk/index.php?topic=1409.msg14025#msg14025

Matt
Just because milk is white doesn't mean that clouds are made of milk.

 

anything