set Orientation diminish cylinder size

Started by Garytech, January 31, 2014, 10:00:07 AM

Previous topic - Next topic

Garytech

Hi, First and foremost, thank you very much for this amazing Java library you made. Being a novice Android developper, your library is very useful.

In my Android app, I use two primitives: spheres and cylinders.

I wanna connect spheres with cylinders. ( I don't use Polylines because I wanna keep track of the Object3D )

the problem is ; when I create a cylinder it is extremely thin

   public static Object3D Liens(Object3D sphere1, Object3D sphere2){
      
      Object3D cylinder = Primitives.getCylinder(100, 1f,sphere1.getOrigin().distance(sphere2.getOrigin())/2);
      cylinder.setOrigin(Univers.Middle(sphere1,sphere2));
      cylinder.setOrientation( new SimpleVector(0,0,1),cylinder.getOrigin());
      cylinder.build();
      return cylinder;
   }
        public static SimpleVector Middle(Object3D astre1, Object3D astre2){
      SimpleVector milieu = astre2.getOrigin().calcAdd(astre1.getOrigin());
      milieu.scalarMul(0.5f);
      return milieu;
   }
You, once, responded to someone who was complaining about enlargement of objects, I downloaded the new Jar but unfortunately it doesn't fix my problem ...

EgonOlsen

I'm not sure what you mean...you are obviously creating a cylinder that's pretty high but thin. If you don't want that, then don't do it. You can simply multiply the scale with some value and divide scaleHeight by the same value and you should get a thicker cylinder of the same length. I fail to see the 'bug' here.... ???