Comments (11)
Even i am also trying for that but for some reason its not working for me,
Original comment by [email protected]
on 23 Sep 2011 at 4:58
from min3d.
hey i have figured out how to load images from sdCard
buts its not in an efficient way i will share the code soon
Original comment by [email protected]
on 30 Sep 2011 at 2:18
from min3d.
you would have to modify the parser class, in order to add constructors
accepting assetsManager instead of res.
I tried it, adding a class AssetsParser that extends ObjParser. I would have to
add contructors in other two parser as well.
Anyway, I'm not sure this is the correct way to do it but, another source
folder is needed if you have to load models dinamically or files > 1M
Original comment by shineangelic
on 8 Oct 2011 at 10:59
from min3d.
Hey I am able to load obj model with textures from sdcard
I am attaching my modified source in this comment
I have just created and using one static variable called "sdcard" in Parser
classes to switch between loading from asserts and sdcard.
and this is how you have to load the 3d model from sdcard
@Override
public void initScene() {
scene.lights().add(new Light());
Parser.sdcard = true;
IParser parser;
if(!Parser.sdcard)
{
parser = Parser.createParser(Parser.Type.OBJ,
getResources(), "com.android.objLoader:raw/model_obj", true);
}
else
{
parser = Parser.createParser(Parser.Type.OBJ, "/sdcard/model.obj", true);
}
parser.parse();
objModel = parser.getParsedObject();
//objModel.scale().x = objModel.scale().y = objModel.scale().z = .7f;
scene.addChild(objModel);
Parser.sdcard = false;
}
Original comment by [email protected]
on 21 Oct 2011 at 10:07
Attachments:
from min3d.
hi varun
using your code i modified our code but still i am getting problem ..see my code
public void initScene() {
scene.backgroundColor().setAll(0x00000000);
Light light = new Light();
scene.lights().add(light);
Parser.sdcard = true;
IParser parser;
if(!Parser.sdcard)
{
parser = Parser.createParser(Parser.Type.MD2,
getResources(), "com.adstuck.iar:raw/dolphin", true);
System.out.println("hi this is resource image....................>");
}
else
{
parser = Parser.createParser(Parser.Type.MD2, "/sdcard//external_sd/raw/dolphin", true);
System.out.println("hi this is SD card image....................>");
}
parser.parse();
obj = parser.getParsedAnimationObject();
obj.scale().x = obj.scale().y = obj.scale().z = .005f;
obj.rotation().z = -90;
obj.rotation().x = -90;
obj.setFps(70);
obj.position().y = -1.1f;
obj.position().z = -3;
obj.play();
Original comment by [email protected]
on 28 Apr 2012 at 11:13
from min3d.
Hi Ashutosh Kumar,
I have modified the source only for the OBJ model Parser only.
if you want to load MD2 type model you need to modify in the MD2Parser.java
class
InputStream fileIn = resources.openRawResource(resources.getIdentifier(
resourceID, null, null));
replace this line in parse() method of MD2Parser class
with this.(for reference you can look at the parse() method in OBJParser class)
if(!Parser.sdcard)
{
fileIn = resources.openRawResource(resources.getIdentifier(
resourceID, null, null));
}
else
{
try {
fileIn = new FileInputStream(new File(path));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Original comment by [email protected]
on 29 Apr 2012 at 5:03
from min3d.
Hi Varun,
your code is working fine for loading .obj file from sd card.One thing i need to know is that how can we change the texture at run time like change the colour of object etc.
I am new to 3d animation in android.
Any help regarding this will be appreciated.
thanx
Arun Goyal
[email protected]
Original comment by [email protected]
on 11 Dec 2012 at 7:00
from min3d.
Hi Varun,
your code is working fine for loading .obj file from sd card. I need import
.3ds file from sdcard can you help me? i try change class: Max3DSParser.java
but it's not working.
Original comment by [email protected]
on 19 Mar 2013 at 12:19
from min3d.
Hi, please can you help me? i want import .3ds from sd card, it should change
Max3DSParser.java to be worked. thanks for any helps :)
Original comment by [email protected]
on 22 Mar 2013 at 6:12
from min3d.
Hello your code working for me thanks, one question, how can I put lights in
the object in runtime using a menu or whatever you want, the point is that I
want to know how to put lights for iluminated the object thank you for advice,
and sorry for my bad english
Original comment by [email protected]
on 1 May 2013 at 6:06
from min3d.
Thanks a lot only remember add the Write and Read SD Permission i spend time
searching why throws an error.
Original comment by [email protected]
on 14 Jun 2015 at 2:07
from min3d.
Related Issues (20)
- Transparent Textures
- Play Audio
- updatescence() is too fast compared to my phone's hardware capability
- load only 3ds file
- Error on load obj file HOT 1
- MD2 anim loop interpolation error
- Cannot Add 3d model to Android Camera View
- rotate the camera in own axis
- Multiple 3D Views in One 2D Android GUI ?
- Patch for /trunk/sampleProjects/min3dSampleProject1/src/min3d/sampleProject1/ExampleKeyframeAnimation.java
- how to Set BOTH, android:onClick AND OnTouchListener on object
- Min3D Maximum mapping
- Move project to Github
- big 3d file(3ds)
- Nexus 7 3ds imported files shows full black HOT 2
- install fail for min3dSampleProject1_020.apk
- Rectangle are not fully transparent HOT 2
- Use onTouchEvent HOT 3
- Lights in min3D
- 1 million of vertex in min3D
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from min3d.