Author Topic: set Orientation diminish cylinder size  (Read 1441 times)

Offline Garytech

  • byte
  • *
  • Posts: 1
    • View Profile
set Orientation diminish cylinder size
« on: January 31, 2014, 10:00:07 am »
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 ...
« Last Edit: January 31, 2014, 12:24:53 pm by Garytech »

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: set Orientation diminish cylinder size
« Reply #1 on: February 01, 2014, 10:50:05 am »
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.... ???