Main Menu
Menu

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.

Show posts Menu

Messages - lapusneanugabi

#1
Support / Re: rotate the orientation of scene
April 27, 2012, 11:03:10 AM
Quote from: EgonOlsen on April 27, 2012, 10:56:11 AM
I don't get the question. What does the orientation has to do with the game's logic?

rephrase.

I want to rotate the orientation of scene from portrait to landscape. how can i do this?
#2
Support / rotate the orientation of scene
April 27, 2012, 08:53:53 AM
Hi,

I want to rotate the orientation of scene from portrait to landscape without the logic of game to be affected.

How can i do this?
#3
Support / Re: Orientating a car object to face a point
February 27, 2012, 09:38:49 PM
Hi!
I have the same problem. I want to rotate a car from the old position to the next.
I have the following code:

SimpleVector carOldPosition = car.getTransformedCenter();   
SimpleVector tr = new SimpleVector(-locO.x + loc.x,  -locO.y + loc.y, -3.059705E-7f);
car.translate(tr);
SimpleVector directionVector = new SimpleVector(
                  carOldPosition.x - car.getTransformedCenter().x
              ,   carOldPosition.y -  car.getTransformedCenter().y
              ,   carOldPosition.z -  car.getTransformedCenter().z);

Matrix rotationMatrix = directionVector.getRotationMatrix();
car.setRotationMatrix(rotationMatrix);
car.rotateX((float) Math.PI/2f);
car.rotateMesh();


Is not the desired behavior
#4
Support / Re: Camera path Follow
February 26, 2012, 07:48:52 PM
Thanks!
This code with some adjustment at some values  works perfectly.

private void moveCamera() {
      SimpleVector oldCamPos=camera.getPosition();
      SimpleVector oldestCamPos=new SimpleVector(oldCamPos);
      oldCamPos.scalarMul(9f);

      SimpleVector carCenter=car.getTransformedCenter();
      SimpleVector camPos=new SimpleVector(carCenter);
      SimpleVector zOffset=car.getZAxis();
      SimpleVector yOffset=new SimpleVector(0, -100, 0);
      zOffset.scalarMul(-250f);

      camPos.add(zOffset);
      camPos.add(yOffset);

      camPos.add(oldCamPos);
      camPos.scalarMul(0.1f);

      SimpleVector delta=camPos.calcSub(oldestCamPos);
      float len=delta.length();

      if (len!=0) {
         /**
          * Do a collision detection between the camera and the ground to prevent the camera from
          * moving into the ground.
          */
         theWorld.checkCameraCollisionEllipsoid(delta.normalize(), new SimpleVector(20, 20, 20), len, 3);
      }

      /**
       * And finally: Look at the car
       */
      camera.lookAt(car.getTransformedCenter());
   }
#5
Support / Camera path Follow
February 26, 2012, 06:36:25 AM
Hi!

I want to create a track race and i don't know how to set my camera to follow the position of car.