Menu

Keeping objects (TGLSphere, TGLLines) appearance

Help
LefjuCabro
2016-11-02
2016-12-05
  • LefjuCabro

    LefjuCabro - 2016-11-02

    Hello GLScene's users,

    I am a new user of GLScene and I am impress of these capabilities. However I got some problems for using it correctly...

    In my case I want to zoom in/out into my scene and keeping objects appearances. With MouseWheel event I can zoom in/out into my scene with AdjustDistanceToTarget but the objects (TGLSphere, TGLLines) increased/decreased. For example, in my GLSceneViewer, spheres have radius of 0.1 and when I zoom in/out I want to keep this aspect.

    Is there any method or do I scan all objects and modify each radius (for TGLSphere) and lineWidth (for TGLLines) ?

    Thanks for your advices.

    Regards

     
  • Jerome.D (BeanzMaster)

    Hi what do you want to exactl ? this comportment is normal, if you are near an object is bigger, it's normal you are in 3D not in 2D. Explain more you want exactly.

     
  • LefjuCabro

    LefjuCabro - 2016-11-07

    Hi Jerome,

    I understand that we are in 3D so objects are bigger when we approach an object, no matter with that.

    But in my case I don't want enlarged objects when I zoom in. I want them to keep original radius appearance. For example, original sphere radius is 0.1. When I mouse wheel up, radius is still 0.1 but I have to decrease this radius in order to have same sphere appearance as the original.

    Regards

     
  • Jerome.D (BeanzMaster)

    This behaviour is not recommended if you want see object that not scaling use a sprite via TGLHud and set position. but on each time you zoom you can try to call this for each object :

    procedure UpdateObject(myobject:TGLSceneObject;constantzoomfactor:single=5.0);
    var
      d: Single;
      v: TVector;
      I: Integer;
    begin
        d := Viewer.Camera.distanceTo(myobject) / constantzoomfactor;  
       // View referer a.k.a the parent of myobject   
      // myobject.Direction := FUIBaseGizmo.Direction;
      // myobject.Up := FUIBaseGizmo.Up;
    
       if myobject.Visible then
         myobject.Scale.AsVector := VectorMake(d, d, d);
    end;
    

    but for 500 is not fair. If you want make a soft in 3D but showing something in 2D use ortho perspective it will be better or you must use a 2D solution and use sprites instead.
    what you want to search to do exactly ? what is your project ?

     

    Last edit: Jerome.D (BeanzMaster) 2016-11-09
  • LefjuCabro

    LefjuCabro - 2016-11-17

    Hi,

    My soft is a meshing tool: users build a mesh ( = a physical structure) by creating spheres and lines.
    I want to keep 3D because users could move around the structure.

    Attached some screenshots of application that inspired my project: spheres in Init and ZoomIn have same radius.

     

    Last edit: LefjuCabro 2016-11-17
  • Pavel Vassiliev

    Pavel Vassiliev - 2016-12-05

    Jerome,
    Have a look at my private message to you about preparing the next release
    PW

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.