kannan622 / min3d

Automatically exported from code.google.com/p/min3d
0 stars 0 forks source link

Object3d.clone() does not work #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. change the line
http://code.google.com/p/min3d/source/browse/trunk/sampleProjects/min3dSamplePro
ject1/src/min3d/sampleProject1/ExampleLoadObjFile.java?r=107#27 from
objModel = parser.getParsedObject();
to
objModel = parser.getParsedObject().clone();
2. run the demo
3. the camaro does not show

What is the expected output? What do you see instead?
http://www.rozengain.com/blog/2010/05/26/cloning-animated-3d-objects-min3d-frame
work-for-android/ suggests this should work. In this example code the clone has 
a different signature than mine, so maybe the source here is outdated??

What version of the product are you using? On what operating system?
https://bitbucket.org/giszmo/min3d/changeset/686baf2e2fc8 which should be 
http://code.google.com/p/min3d/source/detail?r=107

I'm running this on my Nexus 1. The code of clone() looks incomplete to me. I'm 
working on it myself. Thanx for any comments or patching this.

Original issue reported on code.google.com by LWanders...@gmail.com on 24 Dec 2010 at 1:08

GoogleCodeExporter commented 9 years ago
Check issue 7 (marked as fixed but isn't). Object3DContainer doesn't clone the 
children, so the Object3D itself doesn't get copied.

Original comment by spiran...@gmail.com on 20 Jan 2011 at 4:02

GoogleCodeExporter commented 9 years ago
I confirm that it doesn't work, despite being marked as fixed.

Original comment by gambit...@gmail.com on 7 Feb 2011 at 11:58

GoogleCodeExporter commented 9 years ago
To fix it,add these for loops in both Clone methods(Object3d and 
Object3dContainers classes)

---------------------------------------------------------
Object3d Clone() method:
for(int i=0;i < this._children.size();i++)
            clone._children.add(this._children.get(i));
---------------------------------------------------------
Object3dContainer Clone() method:
for(int i = 0; i< this.numChildren();i++)
            clone.addChild(this.getChildAt(i));
---------------------------------------------------------

This will fix the problem.

Original comment by gambit...@gmail.com on 14 Feb 2011 at 2:27

GoogleCodeExporter commented 9 years ago
Should be fixed now. Thanks all.

Original comment by l...@felar.ca on 20 Feb 2011 at 8:05

GoogleCodeExporter commented 9 years ago
Hmm ... I considered Min3D to be dead after weeks of no reaction and now I'm 
using AndEngine but I will keep watching any progress and get back to this nice 
project in case I actually need 3D.

Original comment by LWanders...@gmail.com on 20 Mar 2011 at 6:02