Author Topic: Google sketchup support  (Read 12448 times)

Offline abhi13feb

  • byte
  • *
  • Posts: 37
    • View Profile
Google sketchup support
« on: March 28, 2008, 12:02:24 pm »
I want to use 3d model generated with tool google sktchup which is .kmz format and want to use taht
Is with JPCT.Is it possible?If not is there any that java supports sketchup model for walkthrough

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11746
    • View Profile
    • http://www.jpct.net
Re: Google sketchup support
« Reply #1 on: March 28, 2008, 12:14:48 pm »
There's no loader for this format in jPCT at the moment. Isn't it possible to export to 3ds or obj from sketchup?

Offline fireside

  • double
  • *****
  • Posts: 605
    • View Profile
Re: Google sketchup support
« Reply #2 on: March 28, 2008, 01:53:14 pm »
You have to use Sketchup pro to export 3ds models.  It's a little pricey in my book, but if you're used to it as a modeler it might be the way to go.  They have these cheap OEM places that you can get it for 25 dollars.  I'm not sure how legit they are but they don't get closed down.

http://www.zoomerart.net/index.php?target=desc&progid=11355

Otherwise Blender works really well and it's free, but it means learning another modeler.
« Last Edit: March 28, 2008, 02:09:04 pm by fireside »
click here->Fireside 7 Games<-

Offline abhi13feb

  • byte
  • *
  • Posts: 37
    • View Profile
Re: Google sketchup support
« Reply #3 on: March 28, 2008, 03:01:44 pm »
Hey from where to download BLENDER?is it as efficient as 3ds max.

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Google sketchup support
« Reply #4 on: March 28, 2008, 04:11:28 pm »
blender.org -> google is your friend ;D
Simple things should be simple, complex things should be possible - Alan Kay

Offline abhi13feb

  • byte
  • *
  • Posts: 37
    • View Profile
Re: Google sketchup support
« Reply #5 on: March 28, 2008, 04:18:31 pm »
hey.. :) so just tell me plz...same jpct code that makes 3d walkthrough possible using .3ds files...will work with blender without changing even a single line of code?

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: Google sketchup support
« Reply #6 on: March 28, 2008, 11:03:17 pm »
Another free 3D modeler is gmax.  You can get your gmax models to 3ds format (although it is kind of a round-about way.  See my post at the end of "3ds max tips" thread for more about that: http://www.jpct.net/forum2/index.php/topic,617.0.html).

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11746
    • View Profile
    • http://www.jpct.net
Re: Google sketchup support
« Reply #7 on: March 28, 2008, 11:52:21 pm »
hey.. :) so just tell me plz...same jpct code that makes 3d walkthrough possible using .3ds files...will work with blender without changing even a single line of code?
The example assumes a specific size and orientation of the loaded mesh. Another model does not (and most likely will not) necessarily fulfill those assumptions, so you may have to adjust scaling and starting transformation. But apart from that, loading any 3ds model should work.
« Last Edit: March 28, 2008, 11:59:40 pm by EgonOlsen »

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: Google sketchup support
« Reply #8 on: March 29, 2008, 12:49:48 am »
Hey, I did some googling and I think I pieced together a way to convert your .kmz files to .3ds.  I haven't tested this, since I don't use Sketchup, but it might just work:

The first important piece of information I found, is that KMZ file format is actually just a ZIP file.  If you change the name of your file from filename.kmz to filename.zip and look inside, you will find a model file in the Collada "Digital Asset Exchange" format.  It has the extension ".dae".

Once you have your .dae file, you will, of course need a converter to change it to a .3ds file.  I found a converter that will do this for you.  It is called the FBX converter tool, on the autodesk website.

You can download the windows version of the FBX converter from:
http://images.autodesk.com/adsk/files/fbx200611_2_converter_win.exe
The program will install to the following location (unless you specify otherwise):
Program Files\Autodesk\FBX\FBXConverter\2006.11.2\FbxConverterUI.exe

I also saw a mac and and a linux version of the converter (I forgot to grab the links while I was there - you'll have to search the autodesk site if you aren't running windows).


Now the FBX converter will convert your .dae file into a .fbx file.  From there, the FBX converter will let you convert the .fbx file into a .3ds file.

This converter also supports a few other formats, so it could be pretty handy to have around.

I haven't tested this idea at all - just pieced together different things I found on google, so let me know if it works!

Offline fireside

  • double
  • *****
  • Posts: 605
    • View Profile
Re: Google sketchup support
« Reply #9 on: March 29, 2008, 02:13:40 am »
Quote
hey.. Smiley so just tell me plz...same jpct code that makes 3d walkthrough possible using .3ds files...will work with blender without changing even a single line of code?

You could almost do it by importing the castle from the fps demo into Blender.  Then position your model exactly the way the castle is positioned.  Then rename your model the same as the castle and save it in the same place.  The elevator would be in the wrong place, of course.  You would also have to put your textures in the same place that the castle textures are saved.  The main thing would be to have your starting room in the same place that the game starts in the castle.  You have to do a search for the elevator code and comment it out, though.
« Last Edit: March 29, 2008, 02:21:30 am by fireside »
click here->Fireside 7 Games<-

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: Google sketchup support
« Reply #10 on: March 29, 2008, 05:13:22 am »
I installed Sketchup and tested the conversion method I described above.  It is slightly more complicated than described above, but that is essentially the way to convert your Sketchup models into 3Ds.  Here is what I did:

1) Download or create a .skp model in Sketchup
2) In Sketchup, export your model to "Google Earth 4 (*.kmz)
    (note: be sure to choose version 4, because the other one is different)
3) Change the extention of the kmz file to .zip
4) Pull out the .dae file
5) In FBX Converter, convert the .dae file to .fbx
6) In FBX Converter, convert the .fbx file to .3ds

The only other issue I had (probably specific to the model I was using), is a couple of the materials were not compatible with jPCT (transparency issue).  I used LithUnwrap (http://www.sharecg.com/v/5169/software-and-tools/LithUnwrap---Free-UV-Mapper-for-Windows) to edit the materials in the .3ds model I was using.  Lithunwrap works great for this, but it does have a maximum number or polys it will load, so there are probably better programs out there for editing materials.  You probably won't have to worry about that though, if you don't use transparency in your models.  I made an applet that loads the converted model:
http://www.paulscode.com/source/LegoCar/
(Use the mouse to rotate the object)

You can get the source code at:
http://www.paulscode.com/source/LegoCar/LegoCar.java
http://www.paulscode.com/source/LegoCar/LegoCar.3ds
(In this demo applet, the 3ds file needs to be compiled into the jar)

And to show that I actually converted that model, here is the original Sketchup file:
http://www.paulscode.com/source/LegoCar/LegoCar.skp

Offline abhi13feb

  • byte
  • *
  • Posts: 37
    • View Profile
Re: Google sketchup support
« Reply #11 on: March 29, 2008, 07:20:58 am »
Hey..Paulscode...thanks a lot bro....simply genious..thnx...:)

Offline abhi13feb

  • byte
  • *
  • Posts: 37
    • View Profile
Re: Google sketchup support
« Reply #12 on: March 29, 2008, 07:23:10 am »
hey.. :) so just tell me plz...same jpct code that makes 3d walkthrough possible using .3ds files...will work with blender without changing even a single line of code?
The example assumes a specific size and orientation of the loaded mesh. Another model does not (and most likely will not) necessarily fulfill those assumptions, so you may have to adjust scaling and starting transformation. But apart from that, loading any 3ds model should work.

Hey,,,juss tell me..how shall I control scaling and transformations and orientations in JPCT demp example

Offline abhi13feb

  • byte
  • *
  • Posts: 37
    • View Profile
Re: Google sketchup support
« Reply #13 on: March 29, 2008, 07:25:09 am »
I mean how to control scaling and tranformations and orientations in JPCTDemo example

Offline Hrolf

  • int
  • **
  • Posts: 84
    • View Profile
Re: Google sketchup support
« Reply #14 on: April 04, 2008, 03:46:29 am »
Top stuff Paulscode!