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

Pages: 1 ... 10 11 [12]
166
Support / Re: Object3D's transparency issue
« on: January 01, 2015, 08:59:37 pm »
It is possible to use transparent skins in Minecraft.
A skin is a 64x32 png file.
Since every bodypart can have transparent elements, I decided to enable transparency for every part.
Is 'alpha testing' easy to do?
Or are there other solutions?

I tried to make the parts not touch each other using about 0.03f space between the parts. But it did not help at all...
Is it possible to have more drawing/sorting precision? Using the Config perhaps?

What will happen in I enlarge the parts a lot and zoom out the camera? The same?

167
Support / Re: Object3D's transparency issue
« on: December 31, 2014, 01:25:45 pm »
On tablet the issue is visible, on phones it isn't (I suppose the width of the screen does have an effect on the bug's visibility)

Anyway, here is a screenshot: https://dl.dropboxusercontent.com/u/47988037/Android/Skin%20Viewer%203D/Screenshot/bug.png
(Look at the right arm (biological left arm))

168
Support / Re: Object3D's transparency issue
« on: December 29, 2014, 04:15:39 pm »
The issue in post #2 does not happen on all devices for some reason...
But it does on a few...
Is there an easier solution?

169
Support / Re: Object3D's transparency issue
« on: December 09, 2014, 05:45:14 pm »
Thanks for the replies!

I kind of solved my problem already.
I added
Code: [Select]
box.setSortOffset(9); to both RightLeg.java and LeftLeg.java (which seemed to work)
I think this fix was a bit logical (now that I think about it... :|)

Thanks a lot for the support! (I have no idea what alpha testing is, so I guess it is better I don't have to use that difficult stuff xD)

My final question: Is my app project-worthy? (for this page: http://www.jpct.net/projects.html)

170
Support / Re: Object3D's transparency issue
« on: December 08, 2014, 04:40:24 pm »
The 'issue' is very small though, but noticable. (see screenshot in attachment)
Since the camera rotates around the 'center', the 'issue' moves from the left leg to the right leg and visa versa.

Well this is my code:

SkinActivity.class (the GameRenderer class in this class only)
Code: [Select]
class GameRenderer implements GLSurfaceView.Renderer {
final World mainWorld;
final Camera mainCamera;
FrameBuffer frameBuffer;

public GameRenderer(World world) {
this.mainWorld = world;
this.mainCamera = this.mainWorld.getCamera();
}


@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {

}

@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
this.frameBuffer = new FrameBuffer(width, height);

totalSkin.hasAlpha();
InnerHead iH = new InnerHead();
OuterHead oH = new OuterHead();
Body b = new Body();
RightArm rA = new RightArm();
LeftArm lA = new LeftArm();
RightLeg rL = new RightLeg();
LeftLeg lL = new LeftLeg();

mainWorld.addObject(iH);
mainWorld.addObject(oH);
mainWorld.addObject(b);
mainWorld.addObject(rA);
mainWorld.addObject(lA);
mainWorld.addObject(rL);
mainWorld.addObject(lL);

this.mainWorld.setAmbientLight(255, 255, 255);

final float dScreen = (float) height/(float)width;

this.mainCamera.setPosition(0, 0.25f, (-9 / dScreen));
this.mainCamera.lookAt(b.getCenter());

iH.translate(0, -2.51f, 0);
oH.translate(0, -2.605f, 0);
rA.translate(-1.5f, 0, 0);
lA.translate(1.5f, 0, 0);
rL.translate(-0.5f, 3f, 0);
lL.translate(0.5f, 3f, 0);


System.runFinalization();
System.gc();
MemoryHelper.compact();
}

@Override
public void onDrawFrame(GL10 gl) {
frameBuffer.clear(new RGBColor(132, 189, 240));

SimpleVector moveLine = new SimpleVector(0.333f, 0, 0.333f);
com.threed.jpct.Matrix m = moveLine.normalize().getRotationMatrix();
m.rotateAxis(m.getYAxis(), (float) -Math.PI / 2f);
mainCamera.moveCamera(Camera.CAMERA_MOVEIN, 10);
mainCamera.rotateAxis(m.invert3x3().getYAxis(),
moveLine.length() / 30f);
mainCamera.moveCamera(Camera.CAMERA_MOVEOUT, 10);
mainCamera.lookAt(mainWorld.getObjectByName("body").getCenter());

final Texture t1 = TextureManager.getInstance().getTexture("bg");
frameBuffer.blit(t1, 0, t1.getHeight(), 0, 0, t1.getWidth(),
-t1.getHeight(), frameBuffer.getWidth(),
frameBuffer.getHeight(), -1, false);
mainWorld.renderScene(frameBuffer);
mainWorld.draw(frameBuffer);
frameBuffer.display();
}

}

Body:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

public class Body extends Object3D {

private static final long serialVersionUID = 8216608860877707087L;

public Body() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-1, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(1, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-1, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(1, 1.5f, -0.5f);

SimpleVector upperLeftBack = new SimpleVector(-1, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(1, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-1, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(1, 1.5f, 0.5f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("bodyfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("bodyfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("bodyback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("bodyback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("bodytop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("bodytop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodybottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodybottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodyright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("bodyright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("bodyleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("bodyleft"));

this.setTransparency(300);

box.setName("body");

box.build();
}
}


Innerhead:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

public class InnerHead extends Object3D {

private static final long serialVersionUID = 4848178494608221837L;

public InnerHead() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-1, -1, -1);
SimpleVector upperRightFront = new SimpleVector(1, -1, -1);
SimpleVector lowerLeftFront = new SimpleVector(-1, 1, -1);
SimpleVector lowerRightFront = new SimpleVector(1, 1, -1);

SimpleVector upperLeftBack = new SimpleVector(-1, -1, 1);
SimpleVector upperRightBack = new SimpleVector(1, -1, 1);
SimpleVector lowerLeftBack = new SimpleVector(-1, 1, 1);
SimpleVector lowerRightBack = new SimpleVector(1, 1, 1);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("headfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("headfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("headback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("headback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("headtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("headtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("headright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("headleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("headleft"));

this.setTransparency(300);

box.setName("head");

box.setSortOffset(9);

box.build();
}
}

Leftarm:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

//biological left :p
public class LeftArm extends Object3D{

/**
*
*/
private static final long serialVersionUID = -5036321054138114930L;

public LeftArm() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);

SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("armfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("armleft"));

this.setTransparency(300);

box.setName("leftarm");


box.build();
}
}

Leftleg:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

//biological left
public class LeftLeg extends Object3D{
/**
*
*/
private static final long serialVersionUID = 4705719438846904180L;

public LeftLeg() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);

SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("legfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("legleft"));

this.setTransparency(300);

box.setName("leftleg");


box.build();
}
}

Outerhead:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

public class OuterHead extends Object3D{

private static final long serialVersionUID = 3950765561884516490L;

public OuterHead() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-1.1f, -1.1f, -1.1f);
SimpleVector upperRightFront = new SimpleVector(1.1f, -1.1f, -1.1f);
SimpleVector lowerLeftFront = new SimpleVector(-1.1f, 1.1f, -1.1f);
SimpleVector lowerRightFront = new SimpleVector(1.1f, 1.1f, -1.1f);

SimpleVector upperLeftBack = new SimpleVector(-1.1f, -1.1f, 1.1f);
SimpleVector upperRightBack = new SimpleVector(1.1f, -1.1f, 1.1f);
SimpleVector lowerLeftBack = new SimpleVector(-1.1f, 1.1f, 1.1f);
SimpleVector lowerRightBack = new SimpleVector(1.1f, 1.1f, 1.1f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("hatfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("hatfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("hatback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("hatback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("hattop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("hattop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("hatright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("hatleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("hatleft"));

this.setTransparency(300);


box.setName("hat");

box.build();
}
}

Rightarm:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

//biological right
public class RightArm extends Object3D{

/**
*
*/
private static final long serialVersionUID = -5257845406283197478L;

public RightArm() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);

SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("armfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("armback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("armtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("armright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("armleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("armleft"));

this.setTransparency(300);

box.setName("rightarm");


box.build();
}
}

Rightleg:
Code: [Select]
package com.aeroshark333.skinviewer.skinparts;

import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.TextureManager;

//biological right
public class RightLeg extends Object3D {

/**
*
*/
private static final long serialVersionUID = 8223363127837467932L;

public RightLeg() {

super(12);

final Object3D box = this;

SimpleVector upperLeftFront = new SimpleVector(-0.5f, -1.5f, -0.5f);
SimpleVector upperRightFront = new SimpleVector(0.5f, -1.5f, -0.5f);
SimpleVector lowerLeftFront = new SimpleVector(-0.5f, 1.5f, -0.5f);
SimpleVector lowerRightFront = new SimpleVector(0.5f, 1.5f, -0.5f);

SimpleVector upperLeftBack = new SimpleVector(-0.5f, -1.5f, 0.5f);
SimpleVector upperRightBack = new SimpleVector(0.5f, -1.5f, 0.5f);
SimpleVector lowerLeftBack = new SimpleVector(-0.5f, 1.5f, 0.5f);
SimpleVector lowerRightBack = new SimpleVector(0.5f, 1.5f, 0.5f);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1,
upperRightFront, 1, 0, TextureManager.getInstance()
.getTextureID("legfront"));
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1,
lowerRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legfront"));
// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1,
lowerLeftBack, 0, 1,
TextureManager.getInstance().getTextureID("legback"));
// Top
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legtop"));
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, TextureManager.getInstance()
.getTextureID("legtop"));
// Bottom
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legbottom"));
// Right
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1,
lowerLeftFront, 0, 1, TextureManager.getInstance()
.getTextureID("legright"));
// Left
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1,
upperRightBack, 1, 0, TextureManager.getInstance()
.getTextureID("legleft"));
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1,
lowerRightBack, 1, 1, TextureManager.getInstance()
.getTextureID("legleft"));

this.setTransparency(300);

box.setName("rightleg");


box.build();
}
}

171
Support / Re: Object3D's transparency issue
« on: December 06, 2014, 11:31:42 pm »
Well here is the idea:
The app I am working on is a skinviewer for Minecraft and Minebuilder.
The user selects a .png file skin and the app will 'visualise' a 3D version of it.
Since skin files usually contain transparent areas, I have decided to enable transparency on every object.
The objects do not move (yet), but the camera rotates around the objects/skin. (I will add user input and animation-ish movements later)

I released the app today:
https://play.google.com/store/apps/details?id=com.aeroshark333.skinviewer (this version has box1's transparency disabled though, the next update will include the sorting order)

I am not a really good developer, neither am I very good with Java and OpenGL. But this is some kind of hobby :)

The transparency issue with the objects next to each other depends on the device too I guess


172
Support / Re: Object3D's transparency issue
« on: December 06, 2014, 05:28:34 pm »
Thanks for the quick reply and it worked! :D

However, I have another issue now...
I have a box3 and a box4 next to each other (touched).
Both faces that touch each othe, do intersect each other on the whole face.
And I get something like in the picture... (both have transparency set to 300)

Picture: Left one is what I got. Right one is what I want.

173
Support / Object3D's transparency issue
« on: December 06, 2014, 12:07:56 pm »
Hey everyone,

I had a hard time trying to register to this forums, so I used my schoolemail...  :o
Anyway, I have an issue with 2 Object3D's...
Both objects are cubed. They have individual textures on each face.
Both objects have this transparency value:
Code: [Select]
this.setTransparency(300);
Box1 is in box2. (their center point is equal)
Box1's dimensions: 2f * 2f * 2f
Box2's dimensions: 2.2f * 2.2f * 2.2f
Box2 has more transparent area's than box1.
However, box2's non-transparent textures don't seem to be visible...
When I remove
Code: [Select]
this.setTransparency(300); from box1, then those non-transparent textures do show up... (but then I get black-ish areas on the box1 texture...)

How can I solve this problem?

Cheers,
Abiram

PS: This library is AWESOME   ;D

Pages: 1 ... 10 11 [12]