Please, please do me the huge favour of reading this through. My deadline is christmas, and its drawing dangerously near:O

I currently have all tiles and objects(including npcs) in zordered linked list.I draw the full list, including the models in the right order.

Unfortunately, I cant really cache the 3d models when its their turn to be rendered. It uses way too much memory. So, I must render them each time they are needed.

I have implemented a "dirty rectangles" system, so only the objects(tiles/npcs/etc) that intersect a dirty rectangle will be redrawn.

Here are the steps in order...IGNORING DIRTY RECTS:)

-Iterate through map objects, painting each at the right location...-If its a tile, then paint a tile...-If its an avatar(npc/player), then render model to 200x200 framebuffer,with a MAGENTA background. Create new image with MAGENTA set to TRANSPARENT. Paint onto main backbuffer.

Now, that works. It really does. The problem is it seems like a lot of trouble. Is there any ways I can improve this?

Is faster/possible to make the map into some kind of 3d object itself, dynamically?Is it possible to set the framebuffer jpct renders onto transparent, to cut out an extra step?

Also, how on earth could I have several different avatars?I would think a separate world for each model would work perfectly,but is it too memory intensive?

Thank you in advance for this!

BTW: My FPS is ~80 when im not painting anything new, but drops to~30 when im in fullscreenmode, and moving my character.In window mode, im lucky if i get 18, and its only ONE character:(.

My tiles are 2D images. The dimensions are 48x24, and tiles with heightgo up in increments of 15px.

I need to draw to another bufferedimage, because I NEED the model to have a TRANSPARENT background, so it can be drawn onto the map:)I use MAGENTA as the background color, because its least used in my models:)If I could get the thing to be transparent itself, OR PERHAPS get jpctto render STRAIGHT ONTO my bufferedimage?

Is it possible to do that?

The models are 3D, and thats it:).I currently set the camera and lights to a roughly isometric angle,and make them look at the models center. This also happens to be the (0,0) of the world space, i think.

If I were to draw several different characters, id have to keep moving the camera and lights(might be slow), or maybe you can hide all but the current model im rendering by setting them to totally transparent.

The other, probably easier way, might be to make a new world for each object, but i would imagine id be frowned on by people here;).

Hold the presses~! Have you ever considered making a lot of planes of your tiles and then use Object3D.setBillboarding(boolean mode)? Billboarding is something where the texture will always face the camera or so....

Oh, Object3D also have setVisibility(boolean). As quoted from the javadoc,

Quote

Sets the object to visible/invisible. Invisible objects won't be processed/rendered at all.

Hold the presses~! Have you ever considered making a lot of planes of your tiles and then use Object3D.setBillboarding(boolean mode)? Billboarding is something where the texture will always face the camera or so....

Oh, Object3D also have setVisibility(boolean). As quoted from the javadoc,

Quote

Sets the object to visible/invisible. Invisible objects won't be processed/rendered at all.

That sounds like something you wanted...

That will be very,very helpful! Thank you for pointing that out:).Thats one less problem.

Don't create an object per tile. That's too much...as you've already noticed. Create the landscape as one single object out of single triangles (by using addTriangle) or create a plane of that size/tiling and manipulate that using an IVertexController as rolz suggested. In your code (if i've understood that correctly at first glance), you are are creating 50*50=2500 objects with 50*50*2=5000 polygons each, i.e. 12m polygons...a bit too much, isn't it?

Since addtriangle() sounds too complicated, I wanted to know if its okay to recursively create an instance Plane object and merge that onto the bigger shape and pray that the Java garbage collector to handle the memory stuff? athanazio posted code for that, and I was hoping that is not a bad solution...

Any idea what I could do Egon? I am assuming you are speakingto athanazio in that last post?

I am unsure it would be worth putting the tiles as billboarded planes,as I need in excess of 8,000 in some cases.Surely 2D is the way to go for me? Wouldnt it be faster to draw?Especially considering I plan only to use Software Rendering:).

Is there any tricks for getting 3d models onto bufferedimages,with the background transparent?Everything I say sounds confusing:)

At the minute, im pretending that the render is a 2d sprite with a MAGENTA background, which i set all MAGENTA pixels to transparent.

I don't see where in his code he's doing this :?: To me, it looks like as if he's just adding 5000 polygons in form of a 50*50 plane 2500 times into that array. Creating an object out of single triangles actually isn't that hard. There should be some code for this in the terrain-example in that old 0.96zip that's still available here: http://www.jpct.net/download/jpctapi_096.zip (This is just for demonstration purpose...the rest of this stuff is outdated...don't use it).