How to change the plane size

Started by gamenewer, September 20, 2014, 07:45:47 AM

Previous topic - Next topic

gamenewer

Hello ,  I use Primitives.getPlane to create a plane to show texture ,  bu t how can I change the create plane size ? for e.g  set x = 128  and set y =  256  so  plane can fit to show image? thanks

gamenewer

I use this  code:

       Object3D obj = new Object3D(2);
            float x = 64;
            float y = 128;
       SimpleVector s1 = new SimpleVector(-x/2,y/2,0);
       SimpleVector s2 = new SimpleVector(-x/2,-y/2,0);
       SimpleVector s3 = new SimpleVector(x/2,-y/2,0);
       SimpleVector s4 = new SimpleVector(x/2,y/2,0);
      
       obj.addTriangle(s1,s2,s3);
       obj.addTriangle(s1,s3,s4);

and set texture  , but  see nothing  ~~~ :(  what's wrong ?

gamenewer

#2
mmm, add    obj.invert();  and set  correct u v  . It seems ok!  :)