Unable to load .dae file to my project!!

1,076 views
Skip to first unread message
Message has been deleted

bipul21

unread,
Oct 10, 2010, 2:34:44 PM10/10/10
to KML Developer Support - Google Earth Plug-in
ge = object;
var placemark = ge.createPlacemark('');
placemark.setName('model');
var model = ge.createModel('');
ge.getFeatures().appendChild(placemark);
var loc = ge.createLocation('');
model.setLocation(loc);
var link = ge.createLink('');

// A textured model created in Sketchup and exported as Collada.
link.setHref('http://earth-api-samples.googlecode.com/svn/trunk/
examples/' +
'static/splotchy_box.dae');
model.setLink(link);

var la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
loc.setLatitude(la.getLatitude());
loc.setLongitude(la.getLongitude());

placemark.setGeometry(model);

la.setRange(300);
la.setTilt(45);
ge.getView().setAbstractView(la);

bipul21

unread,
Oct 10, 2010, 2:46:48 PM10/10/10
to KML Developer Support - Google Earth Plug-in
Hello.
I've created a simple sketchup model with some images on a location
imported from google earth and exported it as .dae (Collada)
i have used the following code in my project but i cannot see
anything..

ge = instance;
var placemark = ge.createPlacemark('');
placemark.setName('model');
var model = ge.createModel('');
ge.getFeatures().appendChild(placemark);
//var loc = ge.createLocation('');
//model.setLocation(loc);
var link = ge.createLink('');

// A textured model created in Sketchup and exported as Collada.
link.setHref('http://www.domainname.com/block.dae');
model.setLink(link);

//var la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
//loc.setLatitude(la.getLatitude());
//loc.setLongitude(la.getLongitude());

placemark.setGeometry(model);

//la.setRange(300);
//la.setTilt(45);
//ge.getView().setAbstractView(la);


Is there any error in here?
Do i have to give exact coordinates where the model is to be placed?


Please help me

GTrek

unread,
Oct 10, 2010, 7:13:05 PM10/10/10
to KML Developer Support - Google Earth Plug-in
Hi bipul21

I'm being totally idle here. I think this will help
http://earth-api-samples.googlecode.com/svn/trunk/examples/model.html

I do it a slightly different way, I embed my models in a KMZ file
which cotains the link, location, scale etc. I load the KMZ and the
api does all the work for me. If you would like code fragments let me
have an email address and I'll send some.

If you go here you can see the sort of effect that's possible
http://www.youtube.com/watch?v=h-PoX4Nx-so

Regards

John
www.gtrek.co.uk

Melissa Beebe

unread,
Oct 13, 2010, 8:09:59 AM10/13/10
to google-earth-...@googlegroups.com
A couple ideas...
1) try replacing placemark.setGeometry(model); with modelPlacemark.setGeometry(model);

and 2) Have you tried increasing the scale?  Sometimes I've had to scale things up if I've done them in Sketch Up.

Try this after modelPlacemark.setGeometry(model); - the number in the parentheses may need to be changed depending on the size of your model.
          myModel.getScale().setX(50);
          myModel.getScale().setY(50);
          myModel.getScale().setZ(50);

bipul21

unread,
Oct 27, 2010, 7:05:49 AM10/27/10
to KML Developer Support - Google Earth Plug-in
hey John,
Thanks for your time.
but if you can help me with the code fragments i would be highly
grateful
Thanks
bipul

bipul...@gmail.com

GTrek

unread,
Oct 27, 2010, 6:49:11 PM10/27/10
to KML Developer Support - Google Earth Plug-in
Hi bipul21

Go to my website and send me your emails address through the Contact
Us page and i'll send you some pointers. I would prefer not to give
email address through this media.

Regards

John
www.gtrek.co.uk


On Oct 27, 12:05 pm, bipul21 wrote:
> hey John,
> Thanks for your time.
> but if you can help me with the code fragments i would be highly
> grateful
> Thanks
> bipul
>
> [email address]

bipul21

unread,
Nov 4, 2010, 5:37:36 AM11/4/10
to KML Developer Support - Google Earth Plug-in
I was going through embedding my files in kmz format.
but writing individual code for each objects is too hectic!


any easy way....

marquies

unread,
Nov 4, 2010, 4:44:49 PM11/4/10
to KML Developer Support - Google Earth Plug-in
Hi.

If you create the models in Sketchup, why don't you place them via
Google Earth (or Maps now?) and direct save them as KMZ? Or do you
multiply objects and place them? Guess there is now other way then
save them with Google Earth or by hand

- Patrick
Reply all
Reply to author
Forward
0 new messages