Results 1 to 3 of 3

Thread: How to change polygon 3D object position in pcl visualizer?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How to change polygon 3D object position in pcl visualizer?

    Hello,

    I have successfully loaded the polygon mesh 3D object file but every time it's loaded on the center position of the viewer.
    Qt Code:
    1. boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer;
    2. viewer->addModelFromPolyData("/somepath/car.obj");
    To copy to clipboard, switch view to plain text mode 
    I have tried below but its only helping me to change roatation and its scale but not position.
    Qt Code:
    1. vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
    2. transform->RotateZ(90);
    3. transform->Scale(10, 10, 10);
    4. viewer->addModelFromPolyData(poly_data, transform, "poly_id", 0);
    To copy to clipboard, switch view to plain text mode 
    I want to change the position of the object file, like based on user preference I want to set axis center on front/back edge of car.
    Please give me some suggestions.

    Thanks.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to change polygon 3D object position in pcl visualizer?

    Well, vtkTransform -does- have a Translate() method. You found Rotate() and Scale(), why didn't you find Translate()?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to change polygon 3D object position in pcl visualizer?

    Actually I have tried this, but used some big values that set that object too far from the origin, looks hidden to me and that's why I didn't try again.

    But yes it's working. Thanks

Similar Threads

  1. Replies: 2
    Last Post: 30th October 2016, 05:53
  2. How to create audio visualizer?
    By Thippu in forum Newbie
    Replies: 2
    Last Post: 23rd December 2015, 16:31
  3. Moving object position in a layout
    By qtnewbi3 in forum Qt Programming
    Replies: 0
    Last Post: 17th November 2011, 20:25
  4. Position Object in QT?
    By kokonomutsu in forum Newbie
    Replies: 2
    Last Post: 11th October 2011, 10:37
  5. How to define object position unchangeable ?
    By andre_teprom in forum Newbie
    Replies: 2
    Last Post: 31st July 2011, 23:59

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.