"Image Processing" VTK two-dimensional image labeling bug fix

Source: Internet
Author: User

In games or CAD software, we often display a two-dimensional image that is always user oriented next to the target to represent certain identities. VTK uses Vtkfollower to implement this feature, however, VTK7.1 and the following version of the bug, showing the use of vtkfollower, two-dimensional images can not render, only display a pure white rectangular box.
The solution must be to use Bing or valley Harmony brother to search, the original post site in: http://vtk.1045678.n5.nabble.com/possible-bug-in-vtk-7-1-OpenGL2-td5739717.html. Here the VTK owner indicates that the render function of the cxx source file for Vtkfollower writes a piece of code:

/* Render the texture * *
  /if (this->texture)
  {
    this->texture->render (ren);
    No code to render the two-dimensional tile
  

Fortunately the solution is relatively simple, add one line of code to the above code:

/* Render the texture *
  /if (this->texture)
  {
    this->texture->render (ren);
  }
  This->device->settexture (This->gettexture ())//new code to add

Then recompile VTK engineering files, generate LIB files, put into their own projects, you can achieve always user-oriented two-dimensional image tag.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.