Author Topic: How to change the plane size  (Read 1777 times)

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
How to change the plane size
« on: September 20, 2014, 07:45:47 am »
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

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: How to change the plane size
« Reply #1 on: September 20, 2014, 10:31:06 am »
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 ?

Offline gamenewer

  • long
  • ***
  • Posts: 171
    • View Profile
Re: How to change the plane size
« Reply #2 on: September 20, 2014, 12:34:27 pm »
mmm, add    obj.invert();  and set  correct u v  . It seems ok!  :)


« Last Edit: September 20, 2014, 03:41:21 pm by gamenewer »