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

Pages: 1 [2] 3
16
Support / How to lock translations?
« on: July 30, 2013, 05:52:44 pm »
Hey!
At first, i wan't to translate the model to a point in the game.
Then i translate it again (with the camera Position), but  i clear the translations every frame.
When i clear the translations, the translation i made at the beginning is also cleared.
Can i lock the translation or translate it in a way that the translation doesn't get cleared when i call clearTranslations?

17
Support / How would you calculate centrifugal force?
« on: July 25, 2013, 11:05:02 pm »
Hey!
I have a spaceship flying around a planet with gravitation.
The spaceship should be able to find a stable orbit using the centrifugal force.
The gravitation is no problem, but i'm not sure about the centrifugal force.
Would it be better using a physics engine (e.g. JBullet) or trying doing that manually?
If manually, could you give me some advices how i should start?

18
Support / Re: Camera moving towards an object
« on: July 21, 2013, 03:49:16 pm »
Ok, but how do i calculate the direction vector between the camera and Object3D.getTransformedCenter()?
I thought this would do it, but i was wrong:
Code: [Select]
world.getCamera().moveCamera(world.getCamera().getPosition().calcAdd(planet.getTransformedCenter()), speed);

19
Support / Re: Linear Accelerometer has inaccurate values
« on: July 21, 2013, 01:05:22 pm »
Thanks, that worked great!
Even much better than expected!  ;D

20
Support / Re: Linear Accelerometer has inaccurate values
« on: July 20, 2013, 05:18:16 pm »
Sorry, but i have no idea what you mean^^

21
Support / Camera moving towards an object
« on: July 19, 2013, 11:23:33 pm »
Hey!
I try to move my camera to an object with this line:
Code: [Select]
world.getCamera().moveCamera(planet.getCenter(), speed);Shouldn't the camera stop moving in the center?
The Camera actually moves through the center and on the other side out.
I watched the distance between the camera and the center of the object, and the center is on the right place.

22
Support / Re: Linear Accelerometer has inaccurate values
« on: July 19, 2013, 11:12:14 pm »
I tried it, but then the problem is when my object moves, it trembles while moving...

23
Support / Re: Linear Accelerometer has inaccurate values
« on: July 18, 2013, 11:44:39 pm »
That's what i need, but i don't know how to implement it.
It is maybe just one or two lines to do it, but i don't get it to work.
Maybe i just think to complicated.

24
Support / Linear Accelerometer has inaccurate values
« on: July 18, 2013, 09:35:08 pm »
Hey!
I have a object infront of my camera that is controlled by the linear accelerometer.
Unfortunaly, the object trembles always, even if i hold my phone completely still and this really hurts my eyes.
Does anyone know how to remove this trembling?
I tried rounding the values given by the sensor, but then it trembles when switching between for example 0.09 and 0.1...

25
Support / Re: Alpha channel on texture does not work
« on: July 16, 2013, 07:22:09 pm »
Thx, works fine now!
And sorry for the many questions :)

26
Support / Alpha channel on texture does not work
« on: July 16, 2013, 07:08:10 pm »
Hey!
I'm trying to load a 100% transparent .png image, but in the game it's black, not transparent.
Here is what i'm using to load the texture:
Code: [Select]
tm.addTexture("earth_clouds", new Texture(this.context.getResources().openRawResource(R.raw.earth_cloudss),true));

27
Support / Re: How to set up Parallax mapping
« on: July 15, 2013, 11:37:26 pm »
opps  :-[
I tried this texture now:

but there is no change at all...

28
Support / Re: How to set up Parallax mapping
« on: July 15, 2013, 11:16:00 pm »
Ok, here are my textures:
Normalmap:

Heightmap:

Blank texture:

29
Support / Re: How to set up Parallax mapping
« on: July 15, 2013, 08:54:26 pm »
Ok, this is the code i'm using now:
Code: [Select]
InputStream vertexS = manager.open("vertex.glsl");
InputStream fragmentS = manager.open("fragment.glsl");
String vertex = Loader.loadTextFile(vertexS);
String fragment = Loader.loadTextFile(fragmentS);
GLSLShader shader = new GLSLShader(vertex,fragment);
shader.setUniform("heightScale", 1);
Texture height = new Texture(this.context.getResources().openRawResource(R.raw.earth_heightmap));
Texture normals = new Texture(this.context.getResources().openRawResource(R.raw.earth_normalmap));
Texture earth = new Texture(this.context.getResources().openRawResource(R.raw.earth));

TexelGrabber grabber = new TexelGrabber();
height.setEffect(grabber);
height.applyEffect();
int[] heighties = grabber.getAlpha();
AlphaMerger setter = new AlphaMerger(heighties);
normals.setEffect(setter);
normals.applyEffect();
tm.addTexture("earth_normalmap",normals);
tm.addTexture("earth",earth);
TextureInfo ti = new TextureInfo(TextureManager.getInstance().getTextureID("earth"));
ti.add(TextureManager.getInstance().getTextureID("earth_normalmap"),TextureInfo.MODE_BLEND);
planet.setTexture(ti);
planet.setShader(shader);
shader.setStaticUniform("invRadius", 0.0005f);

planet.build();
world.addObject(planet);
Now i have two other problems:
1.)My whole texture seems more dark. What could be the fault? The Normalmap?
2.)I can't see any Parallax mapping effect at all  :(
Here is a ingame screenshot:

30
Support / How to set up Parallax mapping
« on: July 15, 2013, 05:42:03 pm »
Hey!
I found the demo of Parallax mapping on youtube and also this topic in the forum: http://www.jpct.net/forum2/index.php/topic,2153.msg15839.htm
I do already have all the needed textures, but i don't know how to set up the shaders.
I found the wiki Page about shaders and tried setting it up with the GLSLShader class, but i don't know what setStaticUniform does or how i can use setRenderHook(shader) on android.
Is there a tutorial or a sample code out there?

Pages: 1 [2] 3