Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AugTech

Pages: 1 2 3 [4] 5
46
Support / How to remove objects during runtime
« on: January 04, 2013, 09:15:35 pm »
Hi.

I'm trying to remove objects from the world during runtime but keep getting a concurrent thread modification error.
I've searched the forum but it seems no-one else is getting this issue?!

I have extended the Object3D class to add a 'allow remove' flag. Every 30seconds within the onDrawFrame method the code below is called, which checks for the flag and calls theWorld.removeObject(o); In the second iteration of the while loop I get the exception and no items are removed from the world - This causes memory issues after some time as more and more objects are added to the world, with none of the old ones being removed.

Code: [Select]
Enumeration<Object3D> e = theWorld.getObjects();
int i = 0;
try {
while (e.hasMoreElements()) {
A_Object3D o = (A_Object3D) e.nextElement();
if (o.isRemoved()) {
theWorld.removeObject(o);
o=null;
i++;
}
}
} catch (Exception err) {
Log.w(LOG_TAG, "Failed during object removal: "+err.getMessage() );
}


I'll admit I'm not too surprised to get this error, but don't know how to safely remove objects from the world that are no longer required.
Does anyone have any suggestions - i.e. can this only be done within the renderer onPause() event??

Many thanks.

47
Support / Re: 3ds model faces/ textures not rendering
« on: October 22, 2012, 05:56:19 pm »
Thanks Egon, makes sense.
I've taken the easy option of removing transparent textures from the model.

48
Support / 3ds model faces/ textures not rendering
« on: October 19, 2012, 01:11:23 pm »
Hi.
I have started using jPCT-AE for proper 3D models now (!) but have an issue importing a 3ds model created in Sketch-Up (Please note this is not my model - Respect to PaulWall on the Warehouse for them).

A few of the textures don't appear to be rendering correctly - please see screenshots for comparison.

I have tried all several config switches and Object3D options such as disabling culling, disabling/ changing lighting and increasing the number of polygons to 2048, but nothing has enabled the texture to be displayed correctly. The vast majority of things in the model are fine, but there are a few anomalies such as the images.

Can anyone suggest what is wrong, and if there is something I should be enabling/ disabling to improve this?

Quote
Edit: This is not just related to 3ds - I've switched to using .obj as I needed to amend some of the texture names to avoid duplicates, but exactly the same things apply

This is the set-up for the renderer;
Code: [Select]
public JpctRenderer(RGBColor b) {
Config.farPlane=1500;
Config.nearPlane = 0f;
Config.oldStyle3DSLoader = true;
Config.maxPolysVisible=2048;

theWorld = new World();
cameraController = new CameraOrbitController(theWorld.getCamera());
cameraController.cameraAngle = 0;
theWorld.setAmbientLight(127, 127, 127);
}

Texture loading...

Code: [Select]
// Only rescale if we have to
size = Transform.upperPowerOfTwo(size);
Texture t = new Texture(BitmapHelper.rescale(bitmap, size, size));
t.compress();
textManager.addTexture(textureName, t);

And the loading of the model...

Code: [Select]
Object3D obj = Object3D.mergeAll(Loader.load3DS(shapestream, 1));
obj.rotateY((float)Math.toRadians(90));
obj.rotateZ((float)Math.toRadians(90));
obj.translate(0,0,-6f);
world.addObject(obj);

float[] bb = obj.getMesh().getBoundingBox();
float height = (bb[3] - bb[2]);
new Light(world).setPosition(new SimpleVector(0, -height/2, height));

world.buildAllObjects();

Logcat...
Code: [Select]
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading Texture...
I/jPCT-AE(10791): Texture loaded...65536 bytes/128*128 pixels!
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Expanding buffers...16384 bytes
I/jPCT-AE(10791): Expanding buffers...24576 bytes
I/jPCT-AE(10791): Expanding buffers...32768 bytes
I/jPCT-AE(10791): Expanding buffers...40960 bytes
I/jPCT-AE(10791): Expanding buffers...49152 bytes
I/jPCT-AE(10791): Expanding buffers...57344 bytes
I/jPCT-AE(10791): Expanding buffers...65536 bytes
I/jPCT-AE(10791): Expanding buffers...73728 bytes
I/jPCT-AE(10791): Expanding buffers...81920 bytes
I/jPCT-AE(10791): Expanding buffers...163840 bytes
I/jPCT-AE(10791): Expanding buffers...245760 bytes
I/jPCT-AE(10791): Expanding buffers...327680 bytes
I/jPCT-AE(10791): Expanding buffers...409600 bytes
I/jPCT-AE(10791): Expanding buffers...491520 bytes
I/jPCT-AE(10791): Expanding buffers...573440 bytes
I/jPCT-AE(10791): Expanding buffers...655360 bytes
I/jPCT-AE(10791): Expanding buffers...737280 bytes
I/jPCT-AE(10791): Expanding buffers...819200 bytes
I/jPCT-AE(10791): Expanding buffers...901120 bytes
I/jPCT-AE(10791): File from InputStream loaded...893524 bytes
I/jPCT-AE(10791): Processing new material Color_00!
I/jPCT-AE(10791): Processing new material Color_01!
I/jPCT-AE(10791): Processing new material Cladding!
I/jPCT-AE(10791): Processing new material Material!
I/jPCT-AE(10791): Processing new material Roofing_!
I/jPCT-AE(10791): Processing new material Color_02!
I/jPCT-AE(10791): Processing new material Color_03!
I/jPCT-AE(10791): Processing new material _Roofing!
I/jPCT-AE(10791): Processing new material Brick_St!
I/jPCT-AE(10791): Processing new material _Fencing!
I/jPCT-AE(10791): Processing new material _Translu!
I/jPCT-AE(10791): Processing new material Transluc!
I/jPCT-AE(10791): Processing new material Sketchy_!
I/jPCT-AE(10791): Processing new material Color_F1!
I/jPCT-AE(10791): Processing new material Fencing_!
I/jPCT-AE(10791): Processing new material Claddi01!
I/jPCT-AE(10791): Processing new material _Brick_T!
I/jPCT-AE(10791): Processing new material Wood_Flo!
I/jPCT-AE(10791): Processing new material _Wood_Ch!
I/jPCT-AE(10791): Processing new material Wood_Boa!
I/jPCT-AE(10791): Processing new material _Claddin!
I/jPCT-AE(10791): Processing new material Materi01!
I/jPCT-AE(10791): Processing new material _Wood__F!
I/jPCT-AE(10791): Processing new material Beige!
I/jPCT-AE(10791): Processing new material _Wood_OS!
I/jPCT-AE(10791): Processing new material Water_De!
I/jPCT-AE(10791): Processing new material _Tile_Ch!
I/jPCT-AE(10791): Processing new material Color_04!
I/jPCT-AE(10791): Processing new material _Ivory_1!
I/jPCT-AE(10791): Processing new material _LightGr!
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob_1
I/jPCT-AE(10791): Object 'DoorKnob_1_jPCT0' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob01
I/jPCT-AE(10791): Object 'DoorKnob01_jPCT1' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob02
I/jPCT-AE(10791): Object 'DoorKnob02_jPCT2' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob03
I/jPCT-AE(10791): Object 'DoorKnob03_jPCT3' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob04
I/jPCT-AE(10791): Object 'DoorKnob04_jPCT4' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob05
I/jPCT-AE(10791): Object 'DoorKnob05_jPCT5' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob06
I/jPCT-AE(10791): Object 'DoorKnob06_jPCT6' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob07
I/jPCT-AE(10791): Object 'DoorKnob07_jPCT7' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob08
I/jPCT-AE(10791): Object 'DoorKnob08_jPCT8' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob09
I/jPCT-AE(10791): Object 'DoorKnob09_jPCT9' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob10
I/jPCT-AE(10791): Object 'DoorKnob10_jPCT10' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob11
I/jPCT-AE(10791): Object 'DoorKnob11_jPCT11' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob12
I/jPCT-AE(10791): Object 'DoorKnob12_jPCT12' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob13
I/jPCT-AE(10791): Object 'DoorKnob13_jPCT13' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob14
I/jPCT-AE(10791): Object 'DoorKnob14_jPCT14' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob15
I/jPCT-AE(10791): Object 'DoorKnob15_jPCT15' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob16
I/jPCT-AE(10791): Object 'DoorKnob16_jPCT16' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob17
I/jPCT-AE(10791): Object 'DoorKnob17_jPCT17' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob18
I/jPCT-AE(10791): Object 'DoorKnob18_jPCT18' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob19
I/jPCT-AE(10791): Object 'DoorKnob19_jPCT19' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob20
I/jPCT-AE(10791): Object 'DoorKnob20_jPCT20' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob21
I/jPCT-AE(10791): Object 'DoorKnob21_jPCT21' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob22
I/jPCT-AE(10791): Object 'DoorKnob22_jPCT22' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob23
I/jPCT-AE(10791): Object 'DoorKnob23_jPCT23' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob24
I/jPCT-AE(10791): Object 'DoorKnob24_jPCT24' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob25
I/jPCT-AE(10791): Object 'DoorKnob25_jPCT25' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob26
I/jPCT-AE(10791): Object 'DoorKnob26_jPCT26' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob27
I/jPCT-AE(10791): Object 'DoorKnob27_jPCT27' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob28
I/jPCT-AE(10791): Object 'DoorKnob28_jPCT28' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob29
I/jPCT-AE(10791): Object 'DoorKnob29_jPCT29' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob30
I/jPCT-AE(10791): Object 'DoorKnob30_jPCT30' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob31
I/jPCT-AE(10791): Object 'DoorKnob31_jPCT31' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: DoorKnob32
I/jPCT-AE(10791): Object 'DoorKnob32_jPCT32' created using 47 polygons and 28 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh01
I/jPCT-AE(10791): Object 'Mesh01_jPCT33' created using 16675 polygons and 8120 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh02
I/jPCT-AE(10791): Object 'Mesh02_jPCT34' created using 484 polygons and 244 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh03
I/jPCT-AE(10791): Object 'Mesh03_jPCT35' created using 220 polygons and 112 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh04
I/jPCT-AE(10791): Object 'Mesh04_jPCT36' created using 256 polygons and 130 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh05
I/jPCT-AE(10791): Object 'Mesh05_jPCT37' created using 256 polygons and 130 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh06
I/jPCT-AE(10791): Object 'Mesh06_jPCT38' created using 252 polygons and 128 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh07
I/jPCT-AE(10791): Object 'Mesh07_jPCT39' created using 1344 polygons and 660 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Mesh08
I/jPCT-AE(10791): Object 'Mesh08_jPCT40' created using 228 polygons and 116 vertices.
I/jPCT-AE(10791): Processing object from 3DS-file: Model
I/jPCT-AE(10791): Name in hierarchy found: Model
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob_1
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob01
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob02
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob03
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob04
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob05
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob06
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob07
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob08
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob09
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob10
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob11
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob12
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob13
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob14
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob15
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob16
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob17
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob18
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob19
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob20
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob21
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob22
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob23
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob24
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob25
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob26
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob27
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob28
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob29
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob30
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob31
I/jPCT-AE(10791): Name in hierarchy found: DoorKnob32
I/jPCT-AE(10791): Name in hierarchy found: Mesh01
I/jPCT-AE(10791): Name in hierarchy found: Mesh02
I/jPCT-AE(10791): Name in hierarchy found: Mesh03
I/jPCT-AE(10791): Name in hierarchy found: Mesh04
I/jPCT-AE(10791): Name in hierarchy found: Mesh05
I/jPCT-AE(10791): Name in hierarchy found: Mesh06
I/jPCT-AE(10791): Name in hierarchy found: Mesh07
I/jPCT-AE(10791): Name in hierarchy found: Mesh08
I/jPCT-AE(10791): Adding Lightsource: 0
I/jPCT-AE(10791): Normal vectors calculated in 565ms!
I/jPCT-AE(10791): MSAA enabled with 2 samples!
I/jPCT-AE(10791): Initializing GL20 render pipeline...
I/jPCT-AE(10791): Accessing shaders via JAR!
I/jPCT-AE(10791): Loading default shaders !
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...2008 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...4496 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 3: 0/32
I/jPCT-AE(10791): Loading default shaders (Tex0)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...201 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...4020 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 6: 0/29
I/jPCT-AE(10791): Loading default shaders (Tex1)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...871 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...4390 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 9: 0/32
I/jPCT-AE(10791): Loading default shaders (Tex0Light0)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...201 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...1293 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 12: 0/7
I/jPCT-AE(10791): Loading default shaders (Fog)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...328 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...4267 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 15: 0/32
I/jPCT-AE(10791): Loading default shaders (FogLight0)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...328 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...1608 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 18: 0/10
I/jPCT-AE(10791): Loading default shaders (Tex0Amb)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...199 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...757 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 21: 0/3
I/jPCT-AE(10791): Loading default shaders (Depth)!
I/jPCT-AE(10791): 0 shaders in replacement map!
I/jPCT-AE(10791): Default fragment shader is: /defaultFragmentShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...745 bytes
I/jPCT-AE(10791): Default vertex shader is: /defaultVertexShader.src
I/jPCT-AE(10791): Loading file from InputStream
I/jPCT-AE(10791): Text file from InputStream loaded...248 bytes
I/jPCT-AE(10791): Compiling shader program!
I/jPCT-AE(10791): Handles of 24: 0/0
I/jPCT-AE(10791): GL20 render pipeline initialized!
I/jPCT-AE(10791): OpenGL vendor:     ARM
I/jPCT-AE(10791): OpenGL renderer:   Mali-400 MP
I/jPCT-AE(10791): OpenGL version:    OpenGL ES 2.0
I/jPCT-AE(10791): OpenGL renderer initialized (using 2 texture stages)
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 228/144 vertices in 17ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 72/40 vertices in 3ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 1059/363 vertices in 11ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 102/50 vertices in 2ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 42/18 vertices in 0ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 2304/936 vertices in 19ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 201/115 vertices in 2ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 12/8 vertices in 1ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 6/4 vertices in 0ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 99/55 vertices in 2ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 603/211 vertices in 8ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 243/125 vertices in 3ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 336/164 vertices in 4ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 156/58 vertices in 2ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 30/16 vertices in 12ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 186/62 vertices in 3ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 282/196 vertices in 4ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 540/336 vertices in 6ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 12/8 vertices in 0ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 84/40 vertices in 1ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 4653/2541 vertices in 44ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 23997/11328 vertices in 273ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 10689/4940 vertices in 115ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 270/184 vertices in 3ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 768/193 vertices in 5ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 13437/5585 vertices in 130ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 72/48 vertices in 1ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 864/348 vertices in 8ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 90/44 vertices in 1ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 2286/1128 vertices in 19ms!
I/jPCT-AE(10791): Subobject of object 42/object44 compiled to indexed fixed point data using 75/45 vertices in 1ms!
I/jPCT-AE(10791): Object 42/object44 compiled to 31 subobjects in 916ms!

Many thanks for any suggestions...

[attachment deleted by admin]

49
Support / Re: Draw ground level grid
« on: October 19, 2012, 10:43:53 am »
No problem Egon, I've got an alternative method now.

50
Support / Re: Draw ground level grid
« on: October 18, 2012, 05:09:26 pm »
Nope - this is purely to give an indication of the ground, without actually obscuring the 'real' ground under your feet.
All models still want to be rendered as normal.

51
Support / Re: Draw ground level grid
« on: October 17, 2012, 12:01:51 pm »
Due to the coordinate systems / transforms occurring within the application (based on real-world position) the 'ground' is rotated in different planes (arbitrary x,y,z rotations), and so the camera is also rotated to view the current scene as if it were level.
Therefore, in order to place models within the scene, they also have to be rotated to align with the current camera view, for which I store the required rotations as up and direction vectors.
This all happens at runtime as the models/ objects are dynamically created from in-bound data.

There is possibly easier ways to get the same result, but the current method works well.
An alternative, possibly proffered (?), method could be to create a plane with a high level of transparency to represent the ground and add this.

Incidentally I have managed to create the grid with Polylines now by calculating the real-world coordinates and running them through the existing transformational process to world coordinates, but its a little bulky compared to starting with world coordinates and setting their direction (see screeny), although I would like to use Polylines a lot more within the scene compared to creating very thin Objects.

Hope this makes some sense!

[attachment deleted by admin]

52
Support / Re: Draw ground level grid
« on: October 15, 2012, 04:14:03 pm »
At runtime

53
Support / Re: Draw ground level grid
« on: October 14, 2012, 08:16:30 pm »
This maybe more of a maths question (not my best subject!) but, given I can't use the same functions on a Polyline() as an Object3D, I thought I would still post the query...

I have direction and up vectors from my camera position which I usually supply to Object3D to ensure the objects are aligned correctly with my scene;

Code: [Select]
SimpleVector dir = new SimpleVector(
camera.frontX,
camera.frontY,
camera.frontZ
);
SimpleVector up = new SimpleVector(
camera.upX,
camera.upY,
camera.upZ);

obj.setOrientation(dir, up);

but Polyline() doesn't have the setOrientation() method. Can anyone suggest how I use these vectors with the polyline coordinates (points) to rotate the line?
Thanks in advance


54
Support / Re: Draw ground level grid
« on: October 13, 2012, 03:17:25 pm »
Thanks Egon.
Sorry about the Javadoc - I was looking at the desktop version!

Have now sorted (as a test) as the origin was completely wrong for the scene.

Cheers.

55
Support / Draw ground level grid
« on: October 13, 2012, 01:05:04 pm »
Hi.
I am trying to draw a basic grid of 100m size tiles at floor/ ground level within my scene (think '80s Tron!)
I thought the new Polyline() class would be idea for this but it doesn't get rendered at all. :) Would Polyline be the right choice for this, or should I be creating something with Plane() ? Incidentally I want to be able to switch it on and off, but I can't see a method for removing/ changing the visibility of poylines on World().
Code: [Select]
public static Polyline testPolyLine(SimpleVector origin) {
SimpleVector o = origin;

SimpleVector[] points = new SimpleVector[4];
points[0] = new SimpleVector(o.x,o.y,o.z-100);
points[1] = new SimpleVector(o.x,o.y,o.z+100);
points[2] = new SimpleVector(o.x,o.y-100,o.z);
points[3] = new SimpleVector(o.x,o.y+100,o.z);

return new Polyline(points, new RGBColor(130, 130, 130));

}
And at start-up (when a position is known)
Code: [Select]
getRenderer().getTheWorld().addPolyline( Utilities.testPolyLine( gridOrigin ) );

As a note; the java doc doesn't include the Polyline() class...

Many thanks in advance.

56
Support / Re: [Tips] Android, augmented reality 3D with JPCT + Camera.
« on: February 17, 2012, 06:53:53 pm »
Thanks Egon, that's done the trick.

As an aside, you wouldn't have a good bit of code for working out the actual available memory for the running application?  (Just wonder if you do anything already in jPCT in terms of memory checking)

Thanks again,

Mike

57
Support / Re: [Tips] Android, augmented reality 3D with JPCT + Camera.
« on: February 17, 2012, 02:13:11 pm »
Egon,
Unfortunately some test users (including myself) are getting an IndexOutOfBounds exception within the AAConfigChooser() now.
This code
Code: [Select]
    setEGLContextClientVersion(2);
    if (Main.isTablet()) {
    setEGLConfigChooser(8, 8, 8, 8, 16, 8);
    } else {
    setEGLConfigChooser(new AAConfigChooser(this, true));
    }
getHolder().setFormat(PixelFormat.TRANSLUCENT);

has been working fine for months, but now running it on lesser devices to my Galaxy SII results in the following stack trace on start-up:
Code: [Select]
FATAL EXCEPTION: GLThread 9
 java.lang.ArrayIndexOutOfBoundsException
  at com.threed.jpct.util.AAConfigChooser.chooseConfig(AAConfigChooser.java:131)
  at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:918)
  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1248)
  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

I must add that I have had to download a more recent beta of jPCT-AE as my dev environment died and I had to re-acquire several libraries - I don't know if this would make a difference...

Any thoughts/ tips would be great.

58
Support / Re: object list not being consistent during rendering
« on: December 11, 2011, 08:55:12 pm »
Egon,
The additional log entry up to and including is;
Quote

12-11 12:17:47.200: INFO/jPCT-AE(14229): VBO created for object 'object525'
12-11 12:17:47.200: INFO/jPCT-AE(14229): VBO created for object 'object525'
12-11 12:17:47.240: INFO/jPCT-AE(14229): VBO created for object 'object30'
12-11 12:17:48.280: INFO/jPCT-AE(14229): [ 1323605868284 ] - WARNING: There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!
12-11 12:17:48.285: INFO/jPCT-AE(14229): [ 1323605868285 ] - ERROR: java.lang.NullPointerException
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:1020)
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:151)
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at com.threed.jpct.World.compile(World.java:2055)
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at com.threed.jpct.World.renderScene(World.java:1093)
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at com.awila.app.graphics.JpctRenderer.onDrawFrame(JpctRenderer.java:110)
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1388)
12-11 12:17:48.285: INFO/jPCT-AE(14229):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1138)



59
Support / object list not being consistent during rendering
« on: December 11, 2011, 01:01:44 pm »
Hi,
I wanted to check if there is a specific order to adding and building objects within the world(!) on an ongoing basis.

My application is dynamically creating and building objects based on a download, and then adding them into the world, but very quickly this results in the message
Quote
There's a problem with the object list not being consistent during rendering. This is often caused by concurrent modification of jPCT objects on a thread different from the rendering thread!

I am trying to store the un-built objects built within an arraylist as they are downloaded and created, and then based on a timer within the onDrawFrame() method rattle through the list adding them into the world to try and ensure that the render thread is in control, but this doesn't help.

What seems to happen is that (for example) 1300 objects are created, then the addObject timer kicks in and adds them to the world - this is fine. The next time the addObject timer kicks in, it adds another 20 objects to the world, at which point the above error happens and kills the application. (Previously the objects were added as they were downloaded)

I have tried calling theWorld.buildAllObjects(); and theWorld.compileAllObjects(frameBuffer); after the objects are added, which helps stability for the first set of objects, but the error still happens the second time around.

Code: [Select]
public void onDrawFrame(GL10 arg0) {
long thisFrameTime = System.currentTimeMillis();

// Render the scene
theWorld.renderScene(frameBuffer);
theWorld.draw(frameBuffer);
frameBuffer.display();

if (thisFrameTime - addTime >= 5000) addObjectsToWorld();
}

private void addObjectsToWorld() {
//if (runed) return;
int i=0;
for (Dataset ds : theApp.getTheRegistry().getDataContainer()) {
for (Feature f : ds.getFeatureCollection()) {
if (f.isBuilt() && f.isVisible() && !f.isInWorld()) {
for (A_Object3D o : f.get3DObjects()) {
f.setInWorld(true);
theWorld.addObject(o);
}
i++;
}
}
}

if (i>0) {
theWorld.buildAllObjects();
try {
theWorld.compileAllObjects(frameBuffer);
} catch (Exception e) {
e.printStackTrace();
}
}
Log.i("Render","Added "+i+" objects to world");
addTime = System.currentTimeMillis();
}

Any help would be much appreciated

60
Support / Re: [Tips] Android, augmented reality 3D with JPCT + Camera.
« on: December 01, 2011, 05:49:00 pm »
Brilliant - thats done it!

The final setup within the SurfaceView is...
Code: [Select]
setEGLContextClientVersion(2);
setEGLConfigChooser(new AAConfigChooser(this, true));
getHolder().setFormat(PixelFormat.TRANSLUCENT);
//setEGLConfigChooser(8, 8, 8, 8, 16, 8);//Tablet compatible (RETEST)

// Setup the renderer
String inC = Globals.App_Prefs.getString("BackgroundColour", "0,0,0,0");
RGBColor background = Utilities.decodeColour(inC);
mRenderer = new JpctRenderer(background);
setRenderer(mRenderer);

All I have to do now is align the objects to the world without billboarding!

Cheers.

[attachment deleted by admin]

Pages: 1 2 3 [4] 5