1
Support / Scaling an object (Self Created)
« on: August 11, 2016, 07:10:28 am »Can anybody plz help with this problem I am stuck with .
I have created a simple cube using
Object3D.addtriangle(sv....)
The problem is I DK how to add scaling capability to it .What are the vec calcs to be applied to make it scalable . Plz .
Here is the code :
SimpleVector upperLeftFront=new SimpleVector(-0.8,-0.8f,-1);
SimpleVector upperRightFront=new SimpleVector(0.8,-0.8f,-1);
SimpleVector lowerLeftFront=new SimpleVector(-0.8,0.8f,-1);
SimpleVector lowerRightFront=new SimpleVector(0.8,0.8f,-1);
SimpleVector upperLeftBack = new SimpleVector( -0.8, -0.8, 1);
SimpleVector upperRightBack = new SimpleVector(0.8, -0.8, 1);
SimpleVector lowerLeftBack = new SimpleVector( -0.8, 0.8, 1);
SimpleVector lowerRightBack = new SimpleVector(0.8, 0.8, 1);
SimpleVector upperLeftLeft=new SimpleVector(-1,-0.8,0.8 );
SimpleVector upperRightLeft=new SimpleVector(-1,-0.8,-0.8 );
SimpleVector lowerLeftLeft=new SimpleVector(-1,0.8,0.8 );
SimpleVector lowerRightLeft=new SimpleVector(-1,0.8,-0.8 );
SimpleVector upperLeftRight = new SimpleVector( 1, -0.8, -0.8 );
SimpleVector upperRightRight = new SimpleVector(1, -0.8, 0.8 );
SimpleVector lowerLeftRight = new SimpleVector( 1, 0.8, -0.8 );
SimpleVector lowerRightRight = new SimpleVector(1, 0.8, 0.8 );
SimpleVector upperLeftUp=new SimpleVector(-0.8,-1,0.8 );
SimpleVector upperRightUp=new SimpleVector(0.8,-1,0.8 );
SimpleVector lowerLeftUp=new SimpleVector(-0.8,-1,-0.8 );
SimpleVector lowerRightUp=new SimpleVector(0.8,-1,-0.8 );
SimpleVector upperLeftBottom = new SimpleVector( -0.8, 1, 0.8 );
SimpleVector upperRightBottom = new SimpleVector(0.8, 1, 0.8 );
SimpleVector lowerLeftBottom = new SimpleVector( -0.8, 1, -0.8 );
SimpleVector lowerRightBottom = new SimpleVector(0.8, 1, -0.8 );
Object3D sample = new Object3D(44);