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

Pages: 1 ... 3 4 [5] 6
Bugs / Re: OutOfMemoryError
« on: May 03, 2008, 06:45:59 pm »
It's entirely reproducable in my own code. Though it's very large, and it's entirely possible that something else is going wrong though. That's why I was wondering if there was an easy way to locate the source of the leak.

But I'll see if I can combine the bits together

Bugs / OutOfMemoryError
« on: May 03, 2008, 05:24:32 pm »

I've been experiencing OutOfMemory (heap) errors in my application when I repeatedly create a new world object and populate it (with the same objects each time). To my knowledge, this can only really be caused by some kind of memory leak. As the memory used before and after the world is recreated should be identical.

In trying to track down this problem, the only clue I've discovered is that preventing rendering of my world object seems to remove the OutOfMemory error. The function which, when removed from my main loop, eliminates the OutOfMemoryError is as follows:

Code: [Select]
public void renderWorld()
if (switchMode != 0)

World theWorld = gstate.getWorld();


if (!wireframe)
theWorld.drawWireframe(buffer, Color.white);


Any clues as to why this might be causing problems if the world and camera are changed by another object? Anything obviously amiss?
Or any ideas as to how to find this stupid error?

Other hints welcome :P

Support / Re: Terrains, caves and editors
« on: October 02, 2007, 03:56:29 pm »
Seems a little complicated, but I'll take a look at it.

Thanks for the tip!

Support / Terrains, caves and editors
« on: October 01, 2007, 10:02:37 am »

I'm trying to find a quick way of making the insides of some caves in JPCT.

Might anyone have a good idea of any tool which might be available to make this fast and relatively pain free? I've seen various terrain editors, but they usually only operate on a single plane. I've also considered building one, but I'm not entirely confident of my algorithmic polygon skills :)

Any ideas?


Support / Re: UV Texturing
« on: July 11, 2007, 11:32:10 pm »
Excellent, thanks very much!

Support / Re: UV Texturing
« on: July 11, 2007, 05:45:40 pm »
Well, this comes back to my original problem - I'm wondering whether there could be something missing from my 3DS file. I know from messing around in Blender that there are particular steps I need to take (and haven't) to apply a texture directly there. So I was wondering if maybe there was something missing there.

Maybe if I could send you the 3DS file I'm using?

Support / Re: UV Texturing
« on: July 11, 2007, 04:15:31 pm »
I've tried the regular wrap and the spherical wrap and they don't have much difference.

The console produces the output "Loading Texture...images/2.jpg" and doesn't seem to mention any kind of loading error, so I guess that's okay and bits.length returns 1.

One thing I do notice is that the shading of the model changes (without altering the lighting or any additional colours) as I try various textures. To me, this implies that the texture is being applied, but in an unusual way. Have I missed something, or is this a known effect of something silly I've done?

Or is this a possible effect of using wrapping so naively?

Support / UV Texturing
« on: July 11, 2007, 11:30:58 am »

Another newbie-ish question I'm afraid. Hopefully not too hard.

I have a fairly complex model in 3DS format and I'm trying to wrap a texture around it. Unless I'm much mistaken, I think I'm trying to do UV texturing.

I was under the impression from forum postings and javadocs that jpct is able to do this to some degree, and I've tried the following code:

Object3D[] bits = Loader.load3DS(filename, 10f);
Texture tex = new Texture("images/2.jpg");
texMan.addTexture("text", tex);


As well as a number of variations (merging the Object3D[] together and applying the texture to that, applying the texture to each element of the Object3D[]) but without any luck. When the area is rendered, everything has the dummy (plain white) texture. I've called calcTextureWrap and recreateTextureCoords after setting the texture and before building it. I haven't got any envmapping stuff anywhere (which I understand would ruin things).

Have I made the faulty assumption that JPCT can do this for me? Or is it something I need to do in my model editor to make this work?

I'm rendering with openGL if that makes any difference :)

Bugs / Re: Light positions?
« on: July 08, 2007, 02:19:57 pm »
Is it a simple mix?
The output shows 0.0 which is not one of the inputs. And it loses 3.0 which is one of the inputs.

If it was mixing them, surely the values would be the same, but in the wrong order? Whereas this shows different values.

Support / Re: Lighting issue
« on: July 08, 2007, 12:25:34 pm »

Thanks for your help...

I took my simple model and split the polygons (there are, I think, about 10 in those examples) in to much smaller ones - all hail Blender's split functionality - now if I can only make it work with every Object at once.

And things started improving. The arch is still a bit weird, but I haven't tried splitting that up yet.

One thing that confused me for a while was that the light intensity controls amount of light as well as the shade. So lights of (20, 20, 200) are almost entirely white (with little patches of blue). I still haven't figured out exactly how that works. Suffice to say it is not like the HTML colour tables where the proportions of the numbers control the shade :)

Trial and error seems the way to go :)

Bugs / Light positions?
« on: July 08, 2007, 12:12:39 pm »

I think this is a bug...

Light l = new Light(theWorld);
l.setPosition(new SimpleVector(1.0, 2.0, 3.0));

Gives output: (0.0,1.0,2.0)
Whereas I would expect: (1.0,2.0,3.0)

Using version 1.14 of JPCT

Support / Re: Lighting issue
« on: July 07, 2007, 03:04:28 pm »

Forgive my newbishness, but my understanding of tessellation was that involved splitting a complex polygon in to smaller ones.
Is this something that JPCT can do automatically? I've tried various settings with triangles and triangle strips, but it doesn't seem to improve the quality of the lighting.

Or do I need to modify the model?

I'm also still not certain why the floor appears unlit. Even when moving the light source to (54, 80, -228) (a very distance from the floor) the floor is unlit.

Support / Re: Lighting issue
« on: July 07, 2007, 11:13:19 am »
Thanks for the reply.

In all the screenshots I've shown below, the following settings are used:

buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
Config.fadeoutLight = true;
Config.linearDiv = 100;
Config.farPlane = 500;
theWorld.setFogParameters(500, 0, 0, 0);

(Not sure whether fogging has any relevance here or not)

The first screenshot shows what happens when I have discard distance at 350, ambient light at 25, 25, 25 and a single light source:
theWorld.addLight(new SimpleVector(54, 0, -228), 50, 50, 100)
As you can see, the walls on the left and right are lit, but none of the other walls are. Despite the fact that the light source should be in the center of the area (assuming I've placed it correctly)

This second screenshot is another view of the first screenshot

Third screenshot occurs when I then set the discard distance to -1. Suddenly the back wall becomes blue. Although the floor still remains unlit. Again, the distance from the light source to the floor should be much smaller than to the wall with the arches - yet they get lit and the floor does not.

Finally, the fourth screenshot has the ambient light removed. The extra weirdness here (which is also present in the previous shot - albeit less obvious) is that the area between my two arches is not lit in the same way as the arches themselves, which again seems rather odd.

Support / Lighting issue
« on: July 06, 2007, 10:37:15 pm »

I'm having a bit of difficulty adding lighting to a simple hollowed out box that I've made.
The 3DS file can be found at:
and the light I'm trying to add is: theWorld.addLight(new SimpleVector(54, 0, -228), 50, 50, 100);

(For the curious).

The problem I'm having is that in adding this light, two opposite walls of my cube are lit. The other faces remain entirely unlit, which seems rather confusing to me - or is this how it is supposed to behave?

I've also noticed that in setting the ambient lighting to (25,25,25) the above light source turns from a nice blue to a bright white light (although otherwise the ambient lighting seems to behave). Again, this seems a little strange to me. Should the overall environment not get a little lighter, but the light source remain blue?

Any ideas?

Support / Tiled texture on an infinitly big plane?
« on: March 26, 2007, 09:13:16 pm »
I'm trying to achieve a particular effect, and I'm not sure whether it's possible - and if it is, how it might be done. I'm open to blindingly obvious solutions which make me look like an idiot as well as cunningly clever solutions (although they may beg more questions).

So I have a user controlled camera (forward/backward/left/right) in an empty world. However, I'd like to give the user some kind of visual feedback for the movement of the camera. So for example, that they can see how quickly the camera is moving.
So what I was hoping to do was to apply a black/white tiled texture on to an entire plane (infinitely big in all directions). So no matter how far the camera moves, the user will continue to see the camera is moving.



Pages: 1 ... 3 4 [5] 6