Author Topic: Resize plane  (Read 3570 times)

Offline rodplamo

  • byte
  • *
  • Posts: 18
    • View Profile
Resize plane
« on: June 17, 2011, 10:11:54 am »
Hi everyone,

I'm still developing my AR browser, and now i have a new doubt. I need display different size images, and i use a plane with this image like texture. But, if image isn't square, image resizes it and it adapts to plane size... How can i convert an square plane to a rectangle?

Thanks!!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Resize plane
« Reply #1 on: June 17, 2011, 04:44:10 pm »
You can use an IVertexController to manipulate the mesh of an existing Object3D to deform it. Or you can write your own method that creates rectangles of any size. That's pretty easy...all you need is to create an Object3D and add two polygons of the given size.
Another option is to tweak the rotation matrix by hand to add non-uniform scaling...that might work (you should be able to find some references in the forum), but it has some drawbacks when you are using lighting or jPCT's own scaling on such an object.

Offline rodplamo

  • byte
  • *
  • Posts: 18
    • View Profile
Re: Resize plane
« Reply #2 on: June 20, 2011, 01:54:01 pm »
I want to do most simple solution but I don't know how add polygons to Object3D...


Offline rodplamo

  • byte
  • *
  • Posts: 18
    • View Profile
Re: Resize plane
« Reply #4 on: June 21, 2011, 10:08:50 am »
Ok, i think understand it, but after, when i add two triangles, this will be only one object? I say this because i want to put one only texture in the rectangle created...

Thank you very much EgonOlsen

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Resize plane
« Reply #5 on: June 21, 2011, 10:10:47 am »
I don't get your last question... ???