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 - 3-S-E

Pages: [1]
1
Support / Re: Y-Axis - Up-Vector - Confusion
« on: October 03, 2011, 10:39:04 pm »
@Egon:

I've written my own CameraControl-Class, that aggregates the jpct-Cam and do all the translation- / rotation-tracking, storing, modifying fun. But that all starts with initializing the jpct-Cam, that goes something like this:

Code: [Select]
// Initialize camera object
this.cam = cam;
this.camPosition = camPosition;
this.cam.setOrientation(new SimpleVector(0.0f, 0.0f, 1.0f), new SimpleVector(0.0f, 1.0f, 0.0f));
this.cam.setPosition(this.camPosition);

... where "this.cam" is the jpct-Cam.
Point is: "setOrientation" does not have any effect at the "up-Vector" argument.
I could also write:

Code: [Select]
this.cam.setOrientation(new SimpleVector(0.0f, 0.0f, 1.0f), new SimpleVector(0.0f, 0.0f, 0.0f));
or

Code: [Select]
this.cam.setOrientation(new SimpleVector(0.0f, 0.0f, 1.0f), new SimpleVector(0.0f, -1.0f, 0.0f));
or

Code: [Select]
this.cam.setOrientation(new SimpleVector(0.0f, 0.0f, 1.0f), new SimpleVector(1.0f, 0.0f, 0.0f));
or whatever without any behavior-changes to the camera. What do I misunderstand here?

2
Support / Re: Y-Axis - Up-Vector - Confusion
« on: October 02, 2011, 06:31:22 pm »
Okay, I figured it out by myself now.

My confusion is based on the modification I've made to the cube code-snippet:

Code: [Select]
public static Object3D getBox(float x, float y, float z) {
Object3D box = new Object3D(12);

SimpleVector upperLeftFront = new SimpleVector(-x, -y, -z);
SimpleVector upperRightFront = new SimpleVector(x, -y, -z);
SimpleVector lowerLeftFront = new SimpleVector(-x, y, -z);
SimpleVector lowerRightFront = new SimpleVector(x, y, -z);

SimpleVector upperLeftBack = new SimpleVector(-x, -y, z);
SimpleVector upperRightBack = new SimpleVector(x, -y, z);
SimpleVector lowerLeftBack = new SimpleVector(-x, y, z);
SimpleVector lowerRightBack = new SimpleVector(x, y, z);

// Front
box.addTriangle(upperLeftFront, 0, 0, lowerLeftFront, 0, 1, upperRightFront, 1, 0);
box.addTriangle(upperRightFront, 1, 0, lowerLeftFront, 0, 1, lowerRightFront, 1, 1);

// Back
box.addTriangle(upperLeftBack, 0, 0, upperRightBack, 1, 0, lowerLeftBack, 0, 1);
box.addTriangle(upperRightBack, 1, 0, lowerRightBack, 1, 1, lowerLeftBack, 0, 1);

// Upper
box.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1, upperRightBack, 1, 0);
box.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1, upperRightFront, 1, 1);

// Lower
box.addTriangle(lowerLeftBack, 0, 0, lowerRightBack, 1, 0, lowerLeftFront, 0, 1);
box.addTriangle(lowerRightBack, 1, 0, lowerRightFront, 1, 1, lowerLeftFront, 0, 1);

// Left
box.addTriangle(upperLeftFront, 0, 0, upperLeftBack, 1, 0, lowerLeftFront, 0, 1);
box.addTriangle(upperLeftBack, 1, 0, lowerLeftBack, 1, 1, lowerLeftFront, 0, 1);

// Right
box.addTriangle(upperRightFront, 0, 0, lowerRightFront, 0, 1, upperRightBack, 1, 0);
box.addTriangle(upperRightBack, 1, 0, lowerRightFront, 0, 1, lowerRightBack, 1, 1);

// box.setTexture("base");
box.build();

return box;
}

My function takes three arguments and creates a box around the world-origin.
Because of the counterintuitive direction of the Y-axis and the need to insert a negativ value for the up-direction, I've used a negativ y-value as argument and flipped it inside the function...  :o

My question to the functionality of the cam-orientation function is still valid... :)

3
Support / Y-Axis - Up-Vector - Confusion
« on: October 02, 2011, 04:56:01 pm »
Hi folks,

I have a big problem understanding the decision of making the pos. y-axis pointing downwards. This makes the whole thing totally counterintuitive for me even if this is a correct right-hand system. I've never used a 3D-creating app that turns the Y-axis this way and I think this makes the jpct engine unnecessary complicated.

Nevertheless...

I used the "Box-Primitive" code snipped from the wiki and applied a texture to it. The texture is placed upside-down. A texture applied to the bottom-part of the Box appears on the top of the box. So the "lower"-points are the upper ones, or what? Okay, so I tried to rotate my cam around the direction-axis by setting the up-vector from (0.0f, -1.0f, 0.0f) to (0.0f, +1.0f, 0.0f), but nothing happend.

I'm really confused... Can someone please give me a hint, what I don't understand at this topic?

Ciao

Edit: Setting the Y-axis pointing downwards is like climbing a 2 miles high mountain by digging a 2 miles deep hole!

4
Support / Re: Code example to build your own GUI menu
« on: July 24, 2011, 12:31:52 pm »
Thank you man!
I'm back from my vacation and about to continue my project. Your GUI Code seams to be perfect for my intentions, so I'll give it a try today and report back, if everything works fine. If I'll have to modifie something, I'll report too.  8)

5
Support / Re: Can't get the shading right - 3ds / obj
« on: July 04, 2011, 02:06:18 pm »
If I enable this flat-shading mode, I get this:



It's still the same 3ds-file as attached to my initial post.

No Diffuse-Colors either.

6
Support / Can't get the shading right - 3ds / obj
« on: July 04, 2011, 11:38:21 am »
Hi all,

the day before I was trying to import a 3ds and an obj file into my jPCT-AE based app, but couldn't figure out why the shading of the faces went so damn wrong.

This is how it should be (flat shaded with diffuse-colors on dedicated polys):



And this is a capture from my SGS2 device how it becomes:




I've tried to export my (triangle-only - no quads, no fancy stuff) model to a 3ds-file with 3ds max 2012 and Blender 2.58 (btw.: the worst and non-intuitive modeling-tool ever! Sorry, but it irritates me every time again I'm trying to give it a chance). Then I've tried to export it to obj with 3ds max and maya 2012 - same result on import in jPCT.

I've attached both, the 3ds- and obj-files.

Please give me a hint, what I'm doing wrong?!

Cheers...

[attachment deleted by admin]

Pages: [1]