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

Pages: 1 [2] 3 4 5
16
Support / Re: Object3D's transparency issue
« on: January 01, 2015, 09:09:46 pm »
As a matter of fact, alpha testing is an easy thing if you already have the shader. If you have the shader code, then you have just to load the shader and apply it to all objects that should use alpha testing. Do you have question about my little sample?

17
Support / Re: The question about billboarding
« on: December 29, 2014, 10:28:42 pm »
I just use the RenderHook for convenience. It shouldn't make a differece whether doing it in onDrawFrame oder within the hook...

Maybe you can test it with using a RenderHook. If this also doesn't work you may create a little sample project that shows the probem.

18
Support / Re: The question about billboarding
« on: December 29, 2014, 02:32:37 pm »
A special camera set shouldn't be needed, but the camera shouldn't look at your object from above.

What do you mean by "seems no effect"? Don't you see the object anymore or doesn't it rotate correctly?

If you can't see the object anymore maybe your object is flat and is rotated so that it's absolutely flat for the camera. Then a rotation of the object around Y-Axis may help.

If it doesn't rotate correctly check that you don't enable billboarding anymore, because it would override our own calculations.

19
Support / Re: The question about billboarding
« on: December 28, 2014, 03:09:56 pm »
Here, have a little sample that shows how you might calculate the rotation.

Code: [Select]
package info.flowersoft.collisionproblemtext;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import com.threed.jpct.Camera;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.GLSLShader;
import com.threed.jpct.IRenderHook;
import com.threed.jpct.Light;
import com.threed.jpct.Object3D;
import com.threed.jpct.RGBColor;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.World;
import com.threed.jpct.util.ExtendedPrimitives;

import android.support.v7.app.ActionBarActivity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;

public class MainActivity extends ActionBarActivity {

GLSurfaceView view;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

getSupportActionBar().hide();

view = new GLSurfaceView(this);
view.setEGLContextClientVersion(2);

view.setRenderer(new GLSurfaceView.Renderer() {

private World world;
private FrameBuffer buffer;

private Object3D sprite;

@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
world = new World();
world.getCamera().moveCamera(Camera.CAMERA_MOVEIN, 1);
world.getCamera().setOrientation(new SimpleVector(0, 1, 1), new SimpleVector(0, -1, 1));
world.getCamera().moveCamera(Camera.CAMERA_MOVEOUT, 10);
world.getCamera().moveCamera(Camera.CAMERA_MOVELEFT, 5);

Light light = new Light(world);
light.setPosition(new SimpleVector(0, -50, 0));

Object3D plane = ExtendedPrimitives.createPlane(10);
plane.rotateZ(0.01f);
world.addObject(plane);

sprite = ExtendedPrimitives.createSprite();
sprite.setAdditionalColor(RGBColor.BLACK);
sprite.setLighting(Object3D.LIGHTING_NO_LIGHTS);
sprite.scale(2);
sprite.setBillboarding(Object3D.BILLBOARDING_DISABLED);
sprite.setRenderHook(new IRenderHook() {

@Override
public void setTransparency(float transparency) {
}

@Override
public void setCurrentShader(GLSLShader shader) {
}

@Override
public void setCurrentObject3D(Object3D obj) {
SimpleVector dir = world.getCamera().getPosition().calcSub(obj.getTransformedCenter());
dir.y = 0;
dir = dir.normalize();
dir.scalarMul(-1);
SimpleVector up = new SimpleVector(0, -1, 0);
obj.setOrientation(dir, up);
}

@Override
public boolean repeatRendering() {
return false;
}

@Override
public void onDispose() {
}

@Override
public void beforeRendering(int polyID) {
}

@Override
public void afterRendering(int polyID) {
}
});
world.addObject(sprite);
}

@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
buffer = new FrameBuffer(width, height);
}

@Override
public void onDrawFrame(GL10 gl) {
world.getCamera().moveCamera(Camera.CAMERA_MOVERIGHT, 0.005f);

buffer.clear();
world.renderScene(buffer);
world.draw(buffer);
buffer.display();
}
});

setContentView(view);
}
}

20
Support / Re: The question about billboarding
« on: December 28, 2014, 12:57:00 pm »
I think the problem is that objects with billboarding won't keep their Y-Axis parallel to the Y-axis in world coordinates. A solution would be to disable billboarding on the object and to calculate the the rotation yourself. It would be nice if this functionality could be integrated directly into jPCT because it's often needed for things like trees :) .

21
Support / Re: 3ds not render perfectly
« on: December 09, 2014, 12:37:11 pm »
If some triangles aren't drawn it also may be a problem with the order of vertex points in the triangles. To test this you may try to call setCulling(False) on your model.

22
Support / Re: Object3D's transparency issue
« on: December 08, 2014, 05:38:28 pm »
As already suggested, a fragment shader using alpha testing would be the best solution. Except if you want semi transparent textures...

Here a little sample how this works: https://dl.dropboxusercontent.com/u/1618711/web/software/AlphaTest.zip

23
Support / Re: Run code on GPU/CPU !
« on: May 06, 2014, 09:14:43 am »
Do you mean using a software renderer? As far as I know you can't use one in jPCT-AE :-\.

24
Support / Re: Scale many objects together
« on: April 23, 2014, 10:00:10 am »
I'm not sure, but may it work to add all your objects to an empty parent object which you scale instead?

25
Projects / Re: LAZYLION 2D ENGINE
« on: April 19, 2014, 09:53:34 am »
Please don't capslock/shout at us. I'm to scared now to test your engine.

btw. why no pics showing your engine in action?

26
Support / Re: Object3D.setTextureMatrix() issue?
« on: April 13, 2014, 10:38:10 am »
Have you loaded the texture with flag alpha true? Does the transparency work if you don't apply a texture matrix?

27
Projects / Re: SPACECOP 3D v2
« on: April 11, 2014, 11:44:21 am »
Pics would be nice. I won't install something without knowing how it looks like.

28
Support / Re: Object/ Polygon draw order
« on: March 21, 2014, 04:00:23 pm »
You mean Object3D.setSortOffset()? I didn't know that method yet but it works good. Thank you very much :D .

29
Support / Re: Object/ Polygon draw order
« on: March 21, 2014, 12:40:24 pm »
I would really appreciate to see a feature to define a draw order for transparent objects. It would be helpful for the 2D (3D based) engine I'm currently working on.

30
Bugs / Re: Overlay.setSourceCoordinates() has no effect
« on: February 16, 2014, 11:13:27 am »
Sure, no one really needs a calcScalarMul-method as some lines more can erase it's functionality. The point is, that in fast writing something I would prefer the short form with calc* and whenever I do this I notice this inconsistency.

Pages: 1 [2] 3 4 5