Author Topic: Multiples Primitives  (Read 1732 times)

Offline RhoX

  • byte
  • *
  • Posts: 29
    • View Profile
Multiples Primitives
« on: August 10, 2011, 01:07:51 pm »
Hey, folks!

I am with another problem with my project, similar (if not equal) to the one of this post (http://www.jpct.net/forum2/index.php/topic,1996.msg14704/topicseen.html#msg14704)

I'm creating six Primitives which are Planes. But, when I translate them they get smaller (farther from the screen), or higher (closer to the screen), or upper, or more down.. something like that. By the other topic this is kind of a "bug" in jPCT-AE. Unfortunately, I couldn't solve the problem with any idea that Ive had. And I need those planes to build my interface.

Any suggestions?

Thanks in advance!

RhoX

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Multiples Primitives
« Reply #1 on: August 10, 2011, 01:38:09 pm »
I don't get the problem here...you complain that a plane actually gets translated when you translate it? That's now it should behave...what's the problem with that?

I guess you are refering to your "picking thread" in the second part of your post? If so, you can be pretty sure that this isn't a bug in the engine. I still haven't fully understood the problem with picking. A test case would be best.

Offline RhoX

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Multiples Primitives
« Reply #2 on: August 10, 2011, 08:23:34 pm »
Well, I think I didn't make myself clear, sorry. Just a little explain: example, when a plane is translated like (X, 0,0), it gets smaller and upper (seems like the translation made is by (X, some value of Y, some value of Z).
Here is a sequence of images, to explain:



See that the first plane (left most) is correct. But the others, which supposed to be at the same Height and Depth, are shifted.
I've tried many things and nothing worked at all. What I want is to align them at the same horizontal axis, like if they were 3 buttons at the screen.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Multiples Primitives
« Reply #3 on: August 10, 2011, 08:32:33 pm »
Your camera obviously isn't looking straight along the z-axis or otherwise, this can't happen. Either do so or translate by a multiple of Camera.getXAxis() instead.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Multiples Primitives
« Reply #4 on: August 10, 2011, 08:38:17 pm »
BTW: Any reason for not blitting the buttons instead of making them real 3d objects? Do you want to animate them?

Offline RhoX

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Multiples Primitives
« Reply #5 on: August 10, 2011, 08:58:32 pm »
Man! It worked with the camera looking to the z-axis! Thank you very much! I've not tried the second idea yet, but it seems that is going to work better for me.

About blitting... well, I've already seen some threads about it, but actually I couldn't understand the idea  ;D. Do you know any thread, tutorial or something like that could help me?

Thank you ver much again! :D

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Multiples Primitives
« Reply #6 on: August 10, 2011, 09:18:40 pm »
The idea is to "copy" a texture (or a part of it) to the screen. It's similar to a drawImage in Java2D.

Offline RhoX

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Multiples Primitives
« Reply #7 on: August 13, 2011, 09:35:17 pm »
EgonOlsen, thank you very much!

I've tried the blit method and it worked perfectly! It's really a magical stuff! heheheh  ;D

Thank you again!

RhoX