www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: rodplamo on June 17, 2011, 10:11:54 am

Title: Resize plane
Post by: rodplamo 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!!
Title: Re: Resize plane
Post by: EgonOlsen 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.
Title: Re: Resize plane
Post by: rodplamo 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...
Title: Re: Resize plane
Post by: EgonOlsen on June 20, 2011, 02:49:39 pm
For example: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#addTriangle(com.threed.jpct.SimpleVector, float, float, com.threed.jpct.SimpleVector, float, float, com.threed.jpct.SimpleVector, float, float) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#addTriangle(com.threed.jpct.SimpleVector, float, float, com.threed.jpct.SimpleVector, float, float, com.threed.jpct.SimpleVector, float, float))
Title: Re: Resize plane
Post by: rodplamo 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
Title: Re: Resize plane
Post by: EgonOlsen on June 21, 2011, 10:10:47 am
I don't get your last question... ???