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

Topics - gucky

#1
Support / Odd behavior of the translation
January 26, 2011, 10:35:24 PM
Since I'm actually about to learn how to use the engine, I tried to order 4 cubes in a pattern shown below in the "intended" image. For doing this I first created an object which extends the Object3D class:
public class Field extends com.threed.jpct.Object3D

Then I overrided the constructor:

public Field(int posX, int posY, Field next){
        super(Primitives.getCube(10));
        setXY(); //<-stuff for the getX / getY functions
matrix.translate(getX()*30,0 , getY()*30);
this.setTranslationMatrix(matrix);
}


In onSurfaceChanged I add the 4 fields to the scene:


for (com.theDiceGame.Field f : fields){
f.strip();
f.build();
System.out.println("Translation: "+f.getTranslation());
world.addObject(f);
}


That seems to work. In the simulator will be 4 cubes visible. But they are not positioned as I intended them to.

How I intended them to be positioned.


How they are positioned

The System.out reads like this, which should be the correct translations:
Translation: (0.0,0.0,0.0)
Translation: (30.0,0.0,0.0)
Translation: (30.0,0.0,30.0)
Translation: (0.0,0.0,30.0)


I also checked the rotation (because It looks like they where rotated by 45° and then translated) but the rotation Matrix is 0 except on the diagonal which should be a zero rotation.

#2
Support / Logger-file location (Newbe question)
January 25, 2011, 11:44:00 AM
Hello everyone,

since I'm starting to get a bit used to Android I wanted to write a little 3D application. For debugging reasons I need to get some messages which I tried to log.  (like this one: Logger.log("Translation: "+f.getTranslation());)

My problem is, I don't know where the logfile is saved. I looked everywhere in my project (since it is not big I finished quickly) and after that looked in the documentation for a possibility to set my own path. Can you tell me where that log-file is located?

Thanks,
gucky