Google sketchup support

Started by abhi13feb, March 28, 2008, 12:02:24 PM

Previous topic - Next topic

abhi13feb

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

EgonOlsen

There's no loader for this format in jPCT at the moment. Isn't it possible to export to 3ds or obj from sketchup?

fireside

#2
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.
click here->Fireside 7 Games<-

abhi13feb

Hey from where to download BLENDER?is it as efficient as 3ds max.

Jonas

Simple things should be simple, complex things should be possible - Alan Kay

abhi13feb

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?

paulscode

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).

EgonOlsen

#7
Quote from: abhi13feb 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?
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.

paulscode

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!

fireside

#9
Quotehey.. 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.
click here->Fireside 7 Games<-

paulscode

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

abhi13feb

Hey..Paulscode...thanks a lot bro....simply genious..thnx...:)

abhi13feb

Quote from: EgonOlsen on March 28, 2008, 11:52:21 PM
Quote from: abhi13feb 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?
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

abhi13feb

I mean how to control scaling and tranformations and orientations in JPCTDemo example

Hrolf