Absolute coordinate for entities
-
I am exporting model to KMZ. I am reading Collada file model to get some entities for particular component to be presented as placemarks in Google Earth. My problem that coordinates that I am getting on the node are not relative to the model origin but to somewhere else. Can anybody help me to find a way to calculate coordinates relative to model origin (which is placed as GIS coordinate)? What is the algorithm?
-
Hi Rafib,
where do you get the collada files you say you "read"? You may know that the kmz file format is actually a zip file which if you rename to zip, you will eventually find the collada file describing the model.
-
Yes, this is correct - I am extracting the model.dae from KMZ file and parse the model.dae for nodes that are instances of specific components and taking their coordinates - creating placemarks which are relative to the model GIS coordinate (taking into account the transformation from GIS to Cartesian, offset and translating back). However, what I figured out - the coordinate of the node is not relative to origin of the model but to some other point in the model - so my question - how can I calculate/get the absolute coordinate (relative to origin of the model).
-
Hm. My answer was more theoretical since I don't usually deal with things like this but now I made a simple test. I built a cube with edges of 1000 cms each. Opened the dae file and found exactly these co-ordinates there.
There is one interesting thing however; although I made sure my SU model was NOT georeferenced, it did put the model into the "default" place in Boulder, CO but of course this is not in the dae file but in the kml file one folder up.
So where do you find these differences in the co-ordinates?
-
Thank you for the reply. Although the simple test does not recreate the situation. In simple situation it works (that's why I used this method to extract points of interest positions from a model). In any case, I gave up on this approach not just due to technical aspects, but as conceptually not appropriated in my case.
Advertisement