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

Pages: [1] 2
1
Support / Re: Way to rotate loaded model permanently
« on: January 31, 2012, 11:37:24 pm »
Egon always first :) I wasted two hours to adjust my code and it doesn't worked until I saw that solution. jPCT has always what I need.
Thanks.

2
Support / Way to rotate loaded model permanently
« on: January 31, 2012, 11:26:00 pm »
Hi,

I load md2 model and it's rotated at start around Y-axis by 180 degrees. My game is taht object goes into the screen and should see its back but now I see front. Is here some way to rotate this object during loading?


EDIT:

I found solution a little bit too late.

Code: [Select]
object.rotateY((float) Math.PI);
object.rotateMesh();
object.clearRotation();

Sorry for cluttering.

3
Support / Re: Camera always behind object
« on: January 30, 2012, 08:52:23 pm »
Exactly what I needed. Thanks this command I understood much more about it all. Thank you!

4
Support / Re: Camera always behind object
« on: January 30, 2012, 06:18:08 pm »
:) Yeah, just a moment ago I saw it and use of it solved problem. I thought that with changing reference coordinates it will be easy then with moving object "into the screen" by this
Code: [Select]
object.translate(0, 0, move); Rotating has mentioned function with setting reference, translation doesn't as I see. So it moves in one direction despite rotation, any clue to change this?

5
Support / Re: Camera always behind object
« on: January 30, 2012, 05:16:49 pm »
I ask here for next clue.
I have camera behind object. My problem now is with rotating. I use object.rotateX() to rotate up and down and object.rotateY() to right and left. It's correct until I rotate object only up/down or left/right because the refernce axes are ok. When I use both rotations, e.g. first right (it's ok) and then up - object rotates around its initial x axis. How could I change reference coordinate system? Like it will be attached to screen (x,y parralel to screen , z orthogonal). I hope you know what I mean.

6
Support / Re: Too late rendering
« on: January 30, 2012, 04:32:21 pm »
I have satysfying effect thanks appropriate SkyBox size adjusting.
Thanks a lot for help.

7
Support / Re: Too late rendering
« on: January 28, 2012, 10:30:28 pm »
No. Sorry for obscurity. Alpha for a texture used in blitting. I thought about blittnig two skies, one dark blue blit all the time and one with stars with changed alpha from 0 to 255 and back. Then stars could appear and disappear smoothly :D   I saw texture.add function which pass alpha of the second texture. So I created the second by this public Texture(int width, int height, int alpha) and added it with weight = 1 to star_sky. Of course I change alpha. But it doesn't work :D

8
Support / Re: Too late rendering
« on: January 28, 2012, 09:55:45 pm »
Probably it was. BTW is it possible to manage the texture's alpha ? It could help me to make this background less borring in case when I will have still problem with SkyBox. I set in texture creator boolean useAlpha as true but what to do now?

9
Support / Re: Too late rendering
« on: January 28, 2012, 09:17:04 pm »
Of course you were right EgonOlsen :) . I should send you big beer when I will finish my game :D

However this static background looks lousy  :-\ Need to back to SkyBox and find out how to set it correctly.

10
Support / Re: Too late rendering
« on: January 28, 2012, 08:38:31 pm »
Finally I found problem, when I removed SkyBox everything show up very fast and I can control it with mentioned Config.farPlane.
But now problem with SkyBox. To be honest I don't need all the sky. Better way for me could be some "static" background in every frame. Why "static"? I'd like to change it with some preset time (to look like blinking).
And this is next thing I can't deal with. I tried this:

Code: [Select]
frameBuffer.clear();
frameBuffer.blit(sky,0,0,0,0,512,512,FrameBuffer.OPAQUE_BLITTING);

world.renderScene(frameBuffer);
world.draw(frameBuffer);

frameBuffer.display();

sky is the texture added to TextureManager and has size 512x512. But I get:

Code: [Select]
01-28 19:03:39.921: E/AndroidRuntime(893): FATAL EXCEPTION: GLThread 8
01-28 19:03:39.921: E/AndroidRuntime(893): java.lang.NullPointerException
01-28 19:03:39.921: E/AndroidRuntime(893): at com.threed.jpct.GLRenderer.blit(GLRenderer.java:1453)
01-28 19:03:39.921: E/AndroidRuntime(893): at com.threed.jpct.GLRenderer.execute(GLRenderer.java:1892)
01-28 19:03:39.921: E/AndroidRuntime(893): at com.threed.jpct.FrameBuffer.blit(FrameBuffer.java:587)
01-28 19:03:39.921: E/AndroidRuntime(893): at my.game.GameActivity$MyRenderer.onDrawFrame(GameActivity.java:870)
01-28 19:03:39.921: E/AndroidRuntime(893): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
01-28 19:03:39.921: E/AndroidRuntime(893): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

How could I fix it to have this background?

11
Support / Re: Camera always behind object
« on: January 17, 2012, 09:54:27 pm »
Now it works almost. Already have such problems:
1. I call this method in ticker and screen shakes a little trying all the time adjust camera position even if there is no move, but I think I can solve it when I will call this only if there is some turning action and I will use another camera setter to keep camera in distance during game (object moves all the time forward like in AlienRunner),
2. moving left or right cause that camera is more and more closer and minimal distance is when object achives 180 degrees to default position (distance changing doesn't exist when there is no moving forward along Z axis ),
3. moving up and down behaves similiary but only when there was no left or right, if was e.g. 90 degrees right I can watch like it rotates form side,
4. I made mentioned object's moving forward in ticker by
Code: [Select]
thing.translate(0, 0, move); and even if I turn by making some rotation object moves forward along the old Z axis (e.g. when its rotatated the movement is from right to left, not "into the screen") why not the new ? Is it the same like with camera?

Today I have no more time. Maybe you have met this issues and know some solutions.
Thanks for previous help:)

12
Support / Re: Camera always behind object
« on: January 17, 2012, 07:51:56 pm »
I have to admit I don't know how to use it correctly. Probably don't understand 3D transormations. I found this on forum:
Code: [Select]
   private void moveCamera() {
      SimpleVector oldCamPos = camera.getPosition();
      oldCamPos.scalarMul(9f);
      SimpleVector carCenter = car.getTransformedCenter();
      SimpleVector zOffset = car.getZAxis();
      zOffset.scalarMul(-250f);
      SimpleVector camPos = new SimpleVector(carCenter);
      camPos.add(camYOffset);
      camPos.add(zOffset);
      camPos.add(oldCamPos);
      camPos.scalarMul(0.1f);
      camera.setPosition(camPos);
      camera.lookAt(carCenter);
   }

and there was also video. It works there exactly I would like to get. Could you clarify it for me?

13
Support / Re: Too late rendering
« on: January 17, 2012, 07:47:32 pm »
Thanks a lot. Now I see difference. Unfortunately I test it on emulator so I have hope it will work much better on real device.

14
Support / Too late rendering
« on: January 17, 2012, 11:15:06 am »
Hi,

I'm trying to do a game where object moves "into the screen" and object is always in the middle. Some hurdles will be showed and I want they appear also in the middle and become more and more bigger when are closer. It's situation almost like in AlienRunner. My problem is that hurdles appear too late, suddenly on the scrren, when they are too close. As it's initial phase I use only primitives as hurdles so they are not big things to render. What could be the problem?

15
Support / Camera always behind object
« on: January 17, 2012, 10:58:21 am »
Hi,

could you give me some clue how to do that camera always looks on object the same way? Something like in Third Person Shooter. Should I calculate an angle and use translation or there is some better way?

Pages: [1] 2