Google Earth: I want to fill a polygon with an image, not a color -
my question simple: possible fill polygon in google earth image file (bmp, jpeg, gif,...), instead of color?
thank you!
i had same issue , found model solution suggested pablo reyes best. problem ground overlays expect image plate carrée projection. if image orthographic projection, trying compensate using <gx:latlonquad>
distorts image because applies non-affine transformation. plus altitude coordinate of <gx:latlonquad>
ignored anyway, image curves globe maintaining constant altitude.
the kml sample provided pablo reyes good. without need sketchup, model.dae file flat plane looks like:
<?xml version="1.0" encoding="utf-8" standalone="no" ?> <collada xmlns="http://www.collada.org/2005/11/colladaschema" version="1.4.1"> <asset> <unit meter="1" name="meter" /> <up_axis>z_up</up_axis> </asset> <library_visual_scenes> <visual_scene id="id1"> <node> <instance_geometry url="#id2"> <bind_material> <technique_common> <instance_material symbol="material2" target="#id3"> <bind_vertex_input semantic="uvset0" input_semantic="texcoord" input_set="0" /> </instance_material> </technique_common> </bind_material> </instance_geometry> </node> </visual_scene> </library_visual_scenes> <library_geometries> <geometry id="id2"> <mesh> <source id="id8"> <float_array id="id12" count="24">500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0 500.0 -500.0 0 500.0 -500.0 0 500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0</float_array> <technique_common> <accessor count="8" source="#id12" stride="3"> <param name="x" type="float" /> <param name="y" type="float" /> <param name="z" type="float" /> </accessor> </technique_common> </source> <source id="id9"> <float_array id="id13" count="24">0 0 -1 0 0 -1 0 0 -1 0 0 -1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1</float_array> <technique_common> <accessor count="8" source="#id13" stride="3"> <param name="x" type="float" /> <param name="y" type="float" /> <param name="z" type="float" /> </accessor> </technique_common> </source> <source id="id11"> <float_array id="id14" count="8">1 1 0 0 0 1 1 0</float_array> <technique_common> <accessor count="4" source="#id14" stride="2"> <param name="s" type="float" /> <param name="t" type="float" /> </accessor> </technique_common> </source> <vertices id="id10"> <input semantic="position" source="#id8" /> <input semantic="normal" source="#id9" /> </vertices> <triangles count="4" material="material2"> <input offset="0" semantic="vertex" source="#id10" /> <input offset="1" semantic="texcoord" source="#id11" /> <p>0 0 1 1 2 2 1 1 0 0 3 3 4 3 5 0 6 1 7 2 6 1 5 0</p> </triangles> </mesh> </geometry> </library_geometries> <library_materials> <material id="id3" name="materialname"> <instance_effect url="#id4" /> </material> </library_materials> <library_effects> <effect id="id4"> <profile_common> <newparam sid="id6"> <surface type="2d"> <init_from>id5</init_from> </surface> </newparam> <newparam sid="id7"> <sampler2d> <source>id6</source> </sampler2d> </newparam> <technique sid="common"> <lambert> <diffuse> <texture texture="id7" texcoord="uvset0" /> </diffuse> <transparent opaque="rgb_zero"> <color>0.3 0.3 0.3 1</color> </transparent> <transparency> <float>1</float> </transparency> </lambert> </technique> </profile_common> </effect> </library_effects> <library_images> <image id="id5"> <init_from>images/2dimage.png</init_from> </image> </library_images> <scene> <instance_visual_scene url="#id1" /> </scene>
where plane 1000 meters square model coordinate system origin in center. defined by:
<float_array id="id12" count="24">500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0 500.0 -500.0 0 500.0 -500.0 0 500.0 500.0 0 -500.0 -500.0 0 -500.0 500.0 0</float_array>
the image applied plane edge-to-edge. if image not square, dimensions of plane must modified accordingly. plane can re-sized , rotated in ge using <scale>
, <orientation>
kml settings. , opacity of image set by:
<color>0.3 0.3 0.3 1</color>
this allows me use same model file multiple images have different sizes, locations, , orientations (as long have same shape: square in case). , renders orthographic projections tangent globe in center.
Comments
Post a Comment