www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Mr_Chaos on June 22, 2014, 08:52:43 pm

Title: Help with a simple problem
Post by: Mr_Chaos on June 22, 2014, 08:52:43 pm
First of all, thanks for all the support so far, and I'm sorry to ask for support again.

The program is a trains simulator.
First i had every part of the track being 1 Object3D, but the performance was not good (there are up to 6000 elements in the biggest model), so now everything is merged into 1 Object3D and it's working fine.
Every element of the track also has a status color, so I've made a big texture where every element has 4 x 4 pixel for colors and the plan is to change it when the status of an element changes (max once 1 second).
Now my problem is that I would like an arrow on every element showing the direction, but I allready have a texture, so I'm kinda lost.
My first suggestion was to merge both status and direction into 1 texture, but the problem is that for 6000 elements it would get very big and I would like to port it to Android at a later stage.

So it there any better way of doing this ?
Title: Re: Help with a simple problem
Post by: AGP on June 22, 2014, 10:42:25 pm
Try using the TextureInfo class to add a Texture on top of the other. It should work (and you set a TextureInfo to an Object3D the same way you would set a Texture).
Title: Re: Help with a simple problem
Post by: Mr_Chaos on June 25, 2014, 09:45:27 pm
Try using the TextureInfo class to add a Texture on top of the other. It should work (and you set a TextureInfo to an Object3D the same way you would set a Texture).

AGP you're the man!!!