Author Topic: load3DS type mismatch, String vs InputStream  (Read 1150 times)

Offline VinC

  • byte
  • *
  • Posts: 2
    • View Profile
load3DS type mismatch, String vs InputStream
« on: April 23, 2012, 01:22:41 am »
Hi!

I'm fairly new to 3D development and I'm working on an android application.

I am having issues using the load3DS method and I have been through the examples and the API and they are usually something like this:

Code: [Select]
rock = Loader.load3DS("example/rock.3ds", 15f)[0];

(This is straight out of the advanced example for loading)

However for my project I am getting:

The method load3DS(InputStream, float) in the type Loader is not applicable for the arguments (String, float)

Basically I believe it is interpreting my path as a String rather than an InputStream.

This is my code:
Code: [Select]
boatmod = Loader.load3DS("/HelloWorld-AE/res/drawable-xhdpi" , 12f)[0];
boatmod.translate(coordinates);

It may help to know that I am in a class outside of my main Activity.
 
Any help would be much appreciated!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: load3DS type mismatch, String vs InputStream
« Reply #1 on: April 23, 2012, 08:22:44 am »
That method is from desktop jPCT. The Android version uses input streams only. You have to access your files in raw via an InputStream instead. Look at Android's API documentation to see how.

Offline VinC

  • byte
  • *
  • Posts: 2
    • View Profile
Re: load3DS type mismatch, String vs InputStream
« Reply #2 on: April 24, 2012, 05:06:54 am »
Aha! I got it working thanks so much for the help!