Main Menu
Menu

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.

Show posts Menu

Messages - Mauri

#1
Support / Re: primitives colour
April 07, 2012, 10:44:48 PM
Unfortunately I cannot model the cubes with a 3D editor, since the idea of the android application is to generate dynamically the models  by reading info from XML files. However I think I can use one basic texture and generate the other textures only when and if needed. That would reduce the number of textures and should speed things up a bit.
Cheers
#2
Support / Re: primitives colour
April 07, 2012, 10:28:13 PM
Thank you.
Using coloured textures does indeed solve the colour issue, but the performance hit is massive.  I am trying now to build a 15x15x15 matrix of cubes. If I leave the coloured textures out of the code, all the cubes are drawn and the frame rate is a very happy 60fps. But if I include the textures (one per cube) only about 500 of the cubes are shown and the frame rate drops to about 17-20fps
mmmmm back to the drawing board for me then.
Thanks again!
#3
Support / Re: primitives colour
April 07, 2012, 06:29:26 PM
OK I forgot to mention something that may be important here. I wanted all the cubes to rotate together, so after creating all the cubes i also merged them into a single Object3D with MergeAll()
Could it be that the color is lost when merging? and if so, is there a way to fix this?
#4
Support / Re: primitives colour
April 07, 2012, 06:22:14 PM
Thanks again for your time.
The values returned by getAdditionalColor() are the correct ones for all cubes.
I am using OpenGL ES 1.1
Cheers
#5
Support / Re: primitives colour
April 07, 2012, 05:05:18 PM
Thanks for your reply. This is the code I have and I tried ambient light from (0,0,0) , which made my cubes very dark grey to 250,250,250 which made them almost white
world = new World();
world.setAmbientLight(0, 0, 0);

sun = new Light(world);
sun.setIntensity(250, 250, 250);

the colour I have for the cubes at the moment is red=241 green =90 blue=43
#6
Support / primitives colour
April 07, 2012, 04:21:46 PM
Hi everyone,
first post here with a problem that probably is incredibly daft, but as I have just started out with both JPCT and android coding  I hope I will not get told off too badly for my question  :)
I want to visualise a model which is made of cubes and cylinders (1000+ cubes usually and cylinders, well I am not sure how many of them yet).
I am using the primitives to do this and I have been able, so far, to visualise the cubes just fine. However, when I try to add a solid colour to the cubes all I get is  grey cubes (the grey shade changes according to the ambient light), but there is no trace of the colour I wanted for my objects. This is what I have done:
public Object3D MakeCube(float size, float posX, float posY, float posZ, int red, int green, int blue) {

Object3D acube = Primitives.getCube(size);
RGBColor cubeColour= new RGBColor(red,green,blue);
acube.setAdditionalColor(cubeColour);
acube.rotateY(-(float) Math.PI/4f);
acube.rotateMesh();
acube.translate(posX, posY, posZ);
acube.translateMesh();
acube.strip();     
acube.build();

return(acube);
}


Where am I going wrong? thanks in advance for the replies.
Cheers.