WTF!!!
No, I did not use calcTextureWrapping-methods (at least not that I know of).
Here is my full class:
package com.dogfight.util;
import java.awt.Color;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.Texture;
import com.threed.jpct.TextureInfo;
import com.threed.jpct.TextureManager;
import com.threed.jpct.World;
public class Unit extends Object3D{
private final float MARKER_SIZE = 20.0f;
private final float ROTATION_SPEED = 0.03f;
private Object3D marker = null;
private Object3D heightLine = null;
private TextureInfo tInfo = null;
public Unit(World world, String texture){
super(16);
TextureManager tm = TextureManager.getInstance();
tInfo = new TextureInfo(tm.getTextureID("frame"));
tInfo.add(tm.getTextureID(texture), TextureInfo.MODE_ADD);
marker = buildMarker();
marker.setTexture(tInfo);
marker.calcNormals();
marker.setTransparency(0);
marker.setLighting(LIGHTING_NO_LIGHTS);
marker.setAdditionalColor(Color.WHITE);
world.addObject(marker);
addChild(marker);
}
public Object3D buildMarker(){
Object3D mrkr = new Object3D(8);
mrkr.setCulling(false);
float offset = MARKER_SIZE/2;
mrkr.addTriangle(new SimpleVector(-offset, 0,-offset), 0, 1,
new SimpleVector( offset, 0,-offset), 1, 1,
new SimpleVector( 0,-MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector( offset, 0,-offset), 0, 1,
new SimpleVector( offset, 0, offset), 1, 1,
new SimpleVector( 0,-MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector( offset, 0, offset), 0, 1,
new SimpleVector(-offset, 0, offset), 1, 1,
new SimpleVector( 0,-MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector(-offset, 0, offset), 0, 1,
new SimpleVector(-offset, 0,-offset), 1, 1,
new SimpleVector( 0,-MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector( offset, 0,-offset), 0, 1,
new SimpleVector(-offset, 0,-offset), 1, 1,
new SimpleVector( 0,MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector( offset, 0, offset), 0, 1,
new SimpleVector( offset, 0,-offset), 1, 1,
new SimpleVector( 0,MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector(-offset, 0, offset), 0, 1,
new SimpleVector( offset, 0, offset), 1, 1,
new SimpleVector( 0,MARKER_SIZE, 0), 0.5f, 0);
mrkr.addTriangle(new SimpleVector(-offset, 0,-offset), 0, 1,
new SimpleVector(-offset, 0, offset), 1, 1,
new SimpleVector( 0,MARKER_SIZE, 0), 0.5f, 0);
return mrkr;
}
public Object3D createLine (SimpleVector point, float width, String textureName){
Object3D line = new Object3D( 8 );
float offset = width / 2.0f;
/*
// Quad A:
line.addTriangle( new SimpleVector( pointA.x-offset, pointA.y, pointA.z ), 0, 0,
new SimpleVector( pointA.x+offset, pointA.y, pointA.z ), 0, 1,
new SimpleVector( pointB.x+offset, pointB.y, pointB.z ), 1, 1,
TextureManager.getInstance().getTextureID( textureName ) );
line.addTriangle( new SimpleVector( pointB.x+offset, pointB.y, pointB.z ), 0, 0,
new SimpleVector( pointB.x-offset, pointB.y, pointB.z ), 0, 1,
new SimpleVector( pointA.x-offset, pointA.y, pointA.z ), 1, 1,
TextureManager.getInstance().getTextureID( textureName ) );
// Quad B:
line.addTriangle( new SimpleVector( pointA.x, pointA.y, pointA.z + offset ), 0, 0,
new SimpleVector( pointA.x, pointA.y, pointA.z - offset ), 0, 1,
new SimpleVector( pointB.x, pointB.y, pointB.z - offset ), 1, 1,
TextureManager.getInstance().getTextureID( textureName ) );
line.addTriangle( new SimpleVector( pointB.x, pointB.y, pointB.z - offset ), 0, 0,
new SimpleVector( pointB.x, pointB.y, pointB.z + offset ), 0, 1,
new SimpleVector( pointA.x, pointA.y, pointA.z + offset ), 1, 1,
TextureManager.getInstance().getTextureID( textureName ) );
// If you don't want the line to react to lighting:
line.setLighting( Object3D.LIGHTING_NO_LIGHTS );
line.setAdditionalColor(new java.awt.Color(0.2f,0.2f,0.2f));
line.setCulling(false);
*/
// done
return line;
}
public void update(){
//marker.rotateY(ROTATION_SPEED);
}
}
The declaration of the Red texture is in the main class, but there is no calcTextureWrapping there either.
I can post it here but I don't think that the problem is there.