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 - Darkflame

Pages: 1 [2] 3 4
Feedback / Search in wiki unclickable in Chrome?
« on: December 11, 2010, 04:09:46 pm »
Anyone else having this problem;

The search box can't be clicked in.
Works fine in Opera.

Support / Re: Version updates!
« on: November 30, 2010, 02:12:26 pm »
Fantastic work!
Our project wouldn't be possible without this :)

Projects / Re: Projects anyone?
« on: November 10, 2010, 02:10:24 am »
Well, its not very polished, but we are using jPCT in a Android AR system.
You can read about our project here;
And if you goto the video section, you can see a (poorly filmed) clip with the current ar browser.

We will do better videos/pics and stuff later, but we are too busy getting the core functionality working. (The 3D is the easy/fun stuff by comparison :) )

Support / Re: "Too many textures added to the TextureManager."
« on: September 21, 2010, 09:50:41 pm »
I figured it out. It was a bit of a mis-direction issue - I wrongly identified the area of code going wrong.
It seems my object being "updated" was actually getting duplicated, lots of objects were appearing in the same place, and as they were all facing sprites this was unnoticeable. (interestingly the most recent object showed up at the "front").

So I'm guessing lots of identical textures were created rather then being replaced. (as my code looks at the object name to determine an update rather then a new texture).

Anyway,as you suggested I'm now using a unload followed by a replace.
This seems to work with at least 50 or so object updates now, so I think its working fine :)

Support / Re: "Too many textures added to the TextureManager."
« on: September 18, 2010, 10:43:30 pm »
If you want to replace a texture in the tm, why don't you use the replaceTexture-method?

I did try the replace function at firstit didn't seem to make any difference above was my attempt to "make sure".

If you want to replace a texture in the tm, why don't you use the replaceTexture-method? A faster way (if appropriate) would be to use an ITextureEffect to update the texture's content.

I was already quite impressed with the speed to be honest, but if it results in progressively increasing memory use, or some internal allocation being used up, Its not something I can live with.

To be honest, I know nothing of ITextureEffect or if it will be appropriate, so I'll just describe my scenario and you can see if it would fit;

* At runtime data is downloaded from the server.
* This data is used to position billboard-planes in the field of view with text on.
* At any time, new information can come from the sever changing the text on any of the billboard-planes.

Each billboard plan has an unique ID in its name field that matches its texture. So the method above is supposed to just take the next text and replace the old texture with it.
Its rather crude at the moment in regards to the size/placement of the text, but I'll fix that neater later.


Support / "Too many textures added to the TextureManager."
« on: September 17, 2010, 08:06:45 pm »
I'm trying to have lots of updateing textures in my project,and keep running into this error;

AndroidRuntime(22498): java.lang.RuntimeException: - ERROR: Too many textures added to the TextureManager. Adjust Config.maxTextures!

Heres my code for updating the texture;

Code: [Select]
private void updatedTexture(String Texturename, String text) {

Log.i("add", "update texture triggered with:"+Texturename+"|"+text);


Bitmap.Config config = Bitmap.Config.ARGB_8888;
FontMetricsInt fontMetrics = paint.getFontMetricsInt();
int fontHeight = fontMetrics.leading - fontMetrics.ascent
+ fontMetrics.descent;
int baseline =;
int height = fontMetrics.bottom -;

// have to add multiline support here
Bitmap charImage = Bitmap.createBitmap(closestTwoPower((int) paint
.measureText(text) + 10), 32, config);

Canvas canvas = new Canvas(charImage);
canvas.drawText(text, 10, baseline, paint); // draw text with a margin
// of 10

TextureManager tm = TextureManager.getInstance();

Texture testtext = new Texture(charImage, true); // the true specifys
                        // the texture has
// its own alpha. If
// not, black is
// assumed to be
// alpha!


if (tm.containsTexture(Texturename)) {

Log.i("add", "updating texture="+Texturename);


Log.i("add", "updated texture="+Texturename);

tm.addTexture(Texturename, testtext);

} else {
tm.addTexture(Texturename, testtext);


Note the last bit.

Surely this should ensure the texture is replaced and thus not cause too many to form :? Instead I get my textures either turning completely white, or causing this error. (or both) after a few updates.

Support / How to have a ContextMenu on the GLSurfaceView :?
« on: September 06, 2010, 01:00:18 pm »
Probably a real newbie question, but I'm having a little trouble working out how to have a context menu working
in my GLSurfaceView view.
There doesn't seem to be a "onCreateOptionsMenu" or
"onOptionsItemSelected" to override. (or its protected)

I do notice a "setOnCreateContextMenuListener" but I don't know how to
use it.
Anyone know?

Support / Re: Flicking 3d landscape...what am I doing wrong?
« on: September 05, 2010, 12:39:45 am »
This worked a charm btw. Nice and stable now.

Support / Re: Flicking 3d landscape...what am I doing wrong?
« on: August 31, 2010, 12:59:34 pm »
ok, I'll try putting all my camera manipulations into "public void onDrawFrame(GL10 gl) {..." and see if that helps.

Support / Flicking 3d landscape...what am I doing wrong?
« on: August 30, 2010, 10:47:44 pm »
While working on my AR application I noticed the landscape often "flicked" at first I thought this was a sensor issue, but dismissed that after I found the problem is still there even with a completely static set of co-ordinates.
Heres a video of the problem;

Essentially every time the sensors update now, this code runs;

Code: [Select]
Camera worldcam = world.getCamera();


float Z = xyzAngles.z;
float Y = xyzAngles.y;
float X = xyzAngles.x;

//worldcam.rotateCameraAxis(new SimpleVector(0,1,0), -Z);
//worldcam.rotateCameraAxis(new SimpleVector(1,0,0), X);
//worldcam.rotateCameraAxis(new SimpleVector(0,0,1), -Y);

worldcam.rotateCameraAxis(new SimpleVector(0,1,0), -0.081920266f);
worldcam.rotateCameraAxis(new SimpleVector(1,0,0), 0.5303804f);
worldcam.rotateCameraAxis(new SimpleVector(0,0,1), 0.84379244f);

Any idea's what cause's the graphical glitch?

Support / Re: Has anyone got this running on the 2.1 Emulator
« on: August 17, 2010, 01:11:58 pm »
Works fine on the emulator for me. Very slow, but certainly works.

Thought I might need visuals :)

Heres a screen from the app of my accident;

And a concept one quickly made in max;

I think I've identified that its caused by having pure black in a texture. That makes it transparent, and then some draw order issue makes it into a mask to the background? Either way I'd like a really reproduce this reliable in code. (and preferably understand why it happens)

[attachment deleted by admin]

When loading some of my 3ds models into the engine, I noticed occasionally I got an effect where the texture effectively cut right though to the background. That is, things were not just transparent, but made everything behind them invisible too.
This was due, as far as I could tell, due to mapping errors in my 3d file.

However, its a useful effect and Id like to reproduce it.
Specifically, as I'm working on an AR application it would be a good way to "mask out" real world objects so that other 3d objects could be seen to go behind them.

So I wondered what texture setting is needed to reproduce this effect intentionally?

Hope I explained myself well enough, if not I'll do a picture to illustrate.

Support / Re: 3DS Texture loading advice...
« on: August 12, 2010, 01:52:30 pm »
java.util package greatly simplifies these kind of things

Code: [Select]
Set<String> oldNames = textureManager.getNames();
// download and load your model here

Set<String> newNames = textureManager.getNames();
// now newNames contains the new texture names

Very elegant, worked a charm :)

Thanks for the help :)

Support / Re: 3DS Texture loading advice...
« on: August 11, 2010, 11:10:05 pm »
Ah, so I use
TextureManager.getInstance().getNames(); ?

That seems a good solution, but how would I isolate the names just added?
Would I have to count the number of names before hand, the number after, and then count backwards over the number of new ones added? Or is there a better way?
(And am I using too many question marks? or not?)

Pages: 1 [2] 3 4