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

#1
Support / Re: Odd behavior of the translation
January 27, 2011, 12:17:18 AM
Great, I got it to work now. Thank you for your fast and accurate help!
#2
Support / Re: Odd behavior of the translation
January 26, 2011, 11:29:33 PM
Yes you are correct, I'm viewing them from the top. And I think the 45° rotation of the primitive might explains my problem. When turning the cubes by 45° in my mind and then also turn the camera by 45° it should be correct. Is there a way to create a cube without the pre-rotation?

I now rotate the cube when creating it (and before translating it) , but this feels a bit off. Or is it the best way to deal with the Problem? And it looks odd as well.




This is the camera setting:
Camera cam = world.getCamera();
cam.setPosition(20, -60, 20);
cam.lookAt(game.getFields().getFirst().getTransformedCenter());


@Second post:
No there shouldn't be any relations and I create them all in a LinkedList. Thank you for the example, I will have a look at it!
#3
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.

#4
Support / Re: Logger-file location (Newbe question)
January 26, 2011, 10:12:37 PM
Thanks to all of you. I where now able to do both.
#5
Support / Re: Logger-file location (Newbe question)
January 25, 2011, 01:17:48 PM
Thanks for the answer but DDMS isn't working right. (It starts with an exception and won't show any data while the emulator is running) I believe you, that DDMS is more useful and I will try to get it running, but right now I could fix my problem just with the logfile.

Doesn't anybody know where it is?
#6
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