Author Topic: help with converting 3ds model  (Read 3244 times)

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
help with converting 3ds model
« on: February 06, 2011, 03:24:47 pm »
Hi all,

I'm just getting into java and want to do something with this engine. I'm a bit stuck with the model conversion. I'm using Eclipse and got the latest sdk. When I run this, eclipse throws a fit and gives me no real error message. First time using Eclipse as well so I think it's all configured correctly.
All I want is convert some models. :(

Also, is there any documentation on the .ser files? I was thinking of converting my max exporter to export .ser files directly.

Thanks for any help.


This is my code

Code: [Select]
package com.threed.jpct.example;

import java.io.FileOutputStream;
import com.threed.jpct.DeSerializer;
import com.threed.jpct.Loader;
import com.threed.jpct.Object3D;

public class model_converter {


    public static void main(String[] args) throws FileNotFoundException {
        Object3D modelfile = null;

        DeSerializer de;
        modelfile = Loader.load3DS("C:/sphere.3ds",1)[0];
        modelfile.build();
        de = new DeSerializer();
        de.serialize(modelfile, new FileOutputStream("C:/sphere.ser"), true);
    }

}

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: help with converting 3ds model
« Reply #1 on: February 06, 2011, 05:02:31 pm »
...and you want to convert them to .ser-format because of...why? If you are not planning to use jPCT-AE, this step usually isn't needed and you can go with the normal 3ds-file instead. The .ser-format isn't documented and exists in various versions. It's my internal format...there's no point in exposing its specs.

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: help with converting 3ds model
« Reply #2 on: February 06, 2011, 05:08:31 pm »
Yes I am working with jPCT-AE and making some nice progress. I'm just a little stuck with the model conversion process.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: help with converting 3ds model
« Reply #3 on: February 06, 2011, 09:45:03 pm »
Ok...so...what is the exact problem again? What is a "fit"?

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: help with converting 3ds model
« Reply #4 on: February 06, 2011, 10:58:25 pm »
When I run the code I get no info or anything just this:
Could the path of the 3ds file cause a problem?



#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3375), pid=3336, tid=6040
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_23-b05
# Java VM: Java HotSpot(TM) Client VM (19.0-b09 mixed mode windows-x86 )
# An error report file with more information is saved as:
# C:\Documents and Settings\rich\workspace\3d_engine_pc\hs_err_pid3336.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
---------------  T H R E A D  ---------------

Current thread (0x003a7000):  JavaThread "Unknown thread" [_thread_in_vm, id=6040, stack(0x008c0000,0x00910000)]

Stack: [0x008c0000,0x00910000],  sp=0x0090f8a4,  free space=318k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x200a27]
V  [jvm.dll+0xa536b]
V  [jvm.dll+0x761e8]
V  [jvm.dll+0x779ef]
V  [jvm.dll+0x1cfdc5]
V  [jvm.dll+0x1d069d]
V  [jvm.dll+0x1d0a65]
V  [jvm.dll+0x1d0aab]
V  [jvm.dll+0x1d0bd2]
V  [jvm.dll+0x1d0c4a]
V  [jvm.dll+0x1d0d2d]
V  [jvm.dll+0x1d0fd2]
V  [jvm.dll+0x1f0783]
V  [jvm.dll+0x1f0b5c]
V  [jvm.dll+0xdbd3c]
V  [jvm.dll+0x1e9c28]
V  [jvm.dll+0x106190]
C  [javaw.exe+0x1657]
C  [javaw.exe+0x1e2c]
C  [javaw.exe+0x8614]
C  [kernel32.dll+0xb729]


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )

Other Threads:

=>0x003a7000 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=6040, stack(0x008c0000,0x00910000)]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: None

Dynamic libraries:
0x00400000 - 0x00424000    C:\Program Files\Java\jdk1.6.0_23\bin\javaw.exe
0x7c900000 - 0x7c9b2000    C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f6000    C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000    C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f03000    C:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000    C:\WINDOWS\system32\Secur32.dll
0x7e410000 - 0x7e4a1000    C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f59000    C:\WINDOWS\system32\GDI32.dll
0x76390000 - 0x763ad000    C:\WINDOWS\system32\IMM32.DLL
0x7c340000 - 0x7c396000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\msvcr71.dll
0x6d8a0000 - 0x6db4c000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\client\jvm.dll
0x76b40000 - 0x76b6d000    C:\WINDOWS\system32\WINMM.dll
0x6d850000 - 0x6d85c000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\verify.dll
0x6d3d0000 - 0x6d3ef000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\java.dll
0x6d330000 - 0x6d338000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000    C:\WINDOWS\system32\PSAPI.DLL
0x6d420000 - 0x6d449000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\jdwp.dll
0x6d740000 - 0x6d746000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\npt.dll
0x6d890000 - 0x6d89f000    C:\Program Files\Java\jdk1.6.0_23\jre\bin\zip.dll
« Last Edit: February 06, 2011, 10:59:58 pm by dutch_delight »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: help with converting 3ds model
« Reply #5 on: February 06, 2011, 11:04:29 pm »
Wtf? Seems that you have created a killer class. Do other classes run fine?

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: help with converting 3ds model
« Reply #6 on: February 07, 2011, 11:01:43 am »
I think they do. When I run my AE version everything is just fine. I have been struggling/messing around for a while so maybe i'll try reinstalling the sdk?

Can you see anything wrong with my example code? Would you expect the file to just be converted?

Thanks for your help.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: help with converting 3ds model
« Reply #7 on: February 07, 2011, 11:27:21 am »
Your code looks fine at first glance. And even if it's not, it shouldn't crash the VM...

Offline Kaiidyn

  • long
  • ***
  • Posts: 103
    • View Profile
Re: help with converting 3ds model
« Reply #8 on: February 07, 2011, 12:10:09 pm »
try reinstalling / upgrading java.
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: help with converting 3ds model
« Reply #9 on: February 07, 2011, 09:00:29 pm »
I've reinstalled the SDK and created a new project and the model went through first time. Sweet!

Thanks for the help.

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: help with converting 3ds model
« Reply #10 on: February 08, 2011, 10:00:41 pm »
So I've got my model and now I want to load it. but no matter where I put my file, it's just wont load.
Keeps telling me that the file cant be found. Am I missing something here?
Code: [Select]
InputStream mesh_object;
mesh_object = new FileInputStream("c:/sphere.ser");
Object3D obj = Loader.loadSerializedObject(mesh_object);
obj.build();
world.addObject(obj);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: help with converting 3ds model
« Reply #11 on: February 08, 2011, 10:11:12 pm »
No, it looks fine. Who is complaining here? The FileInputStream or the Loader?

Offline dutch_delight

  • int
  • **
  • Posts: 58
    • View Profile
Re: help with converting 3ds model
« Reply #12 on: February 09, 2011, 10:04:12 pm »
It's the filestream i think.
I've had to wrap it in a try/catch and that gives this:

java.io.FileNotFoundException:/c:/sphere.ser(no such file or directory)

(I am testing on an android virtual device though.)

Offline Kaiidyn

  • long
  • ***
  • Posts: 103
    • View Profile
Re: help with converting 3ds model
« Reply #13 on: February 09, 2011, 10:25:41 pm »
android does not work with c:/ or anything...
you need to use the sdk resources.
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch