Sunday, April 15, 2007

Text output in VTK (2D and 3D)

*Purpose: VTK supports both 2D and 3D text rendering. For 2D, it usually uses vtkTextActor. We can control its font, shadow and display position (in 2D screen coordinates). For 3D, many possible options can be used. One favorable option is to use vtkVectorText with vtkLinearExtrusionFilter. It gives high-quality 3D text rendering.

(Please first follow the VTK installation guide to build VTK from source)




There major VTK classes are used in this demo: vtkTextActor, vtkVectorText, vtkLinearExtrusionFilter.

10 comments:

dave morris said...

Can you help me create a CMake config file for this simple project? I'm just barely getting started with VTK, and I'd like to try out your text example on OS/X, without access to Visual Studio.

Thanks for your help,

Dave

dave morris said...

Nevermind, I ended up getting it to work with this in my CMakeLists.txt file:

cmake_minimum_required(VERSION 2.6)

PROJECT(VTK3DText)

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
FIND_PACKAGE(VTK)
IF(VTK_FOUND)
INCLUDE (${USE_VTK_FILE})
LINK_LIBRARIES(vtkRendering vtkGraphics vtkImaging vtkIO vtkFiltering vtkCommon )
IF (${VTK_MAJOR_VERSION} GREATER 4)
LINK_LIBRARIES( vtkWidgets )
ENDIF (${VTK_MAJOR_VERSION} GREATER 4)
ENDIF(VTK_FOUND)

ADD_EXECUTABLE(VTK3DText demo_vtk_text_output.cpp)
TARGET_LINK_LIBRARIES(VTK3DText vtkIO vtkFiltering vtkCommon vtkRendering)

I may be including some stuff that isn't necessary in there, but it works, so I'm happy. I realize this post is pretty old now, but it came up first on google for "vtk 3d text".

Anonymous said...

Wow! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Excellent choice of colors!

My website - http://www.xxxhardcoretubes.com (www.tidinz.com)

Anonymous said...

Howdy I am so excited I found your blog, I really found you
by error, while I was researching on Google for something else,
Anyways I am here now and would just like to say thanks a lot for a fantastic post and a all round thrilling blog (I also
love the theme/design), I don't have time to look over it all
at the minute but I have bookmarked it and also added in your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the great job.


Also visit my webpage LED Leuchten

Anonymous said...

I just couldn't depart your web site before suggesting that I really enjoyed the standard info a person provide to your visitors?
Is gonna be back ceaselessly to inspect new posts

Stop by my blog ... fuzzy footies

Anonymous said...

A refractometer can pinpoint the percentage of sugar in other confections as well, including
jams, jells, candy, ice cream and gelees. well, I hear they are doing great things with prosthetics these days.
I do think a sheep's milk cheese is preferable, however, due to its relatively strong flavor and compatibility with
parsnip.

my weblog best mandoline slicer

Anonymous said...

Disaster comes often because the people and societies
we yearn to dominate feel precisely the same way about us. Many
of these pharmacies that are not part of the Pfizer franchise would
claim that they are selling sildenafil tablets. Well what are we going
to blame, how about video games.

Feel free to surf to my site - game of war fire age hack

Anonymous said...

sex cams
I'm impressed, I have to admit. Seldom do I come across a blog that's both equally educative and amusing,
and let me tell you, you've hit the nail on the head.
The problem is an issue that too few people are speaking intelligently about.
Now i'm very happy that I came across this in my hunt for something concerning this.
cam sex

Here is my homepage - spanking-erfahrungen

Anonymous said...

In the present times, this software is being run on Microsoft Windows operating systems.
Actually there are no more criminal case cheat space to accommodate the acceptable
coloring for it. At last, the gamers are necessary to
vanish tensions criminal case cheat and frustrations. With the facility of free mobile games have taken TV viewing to
a number over them, so it can provide the very good quality pictures.



My webpage - criminal case cheats

Anonymous said...

ecig, electronic cigarettes, smokeless cigarettes, best electronic cigarettes, smokeless cigarettes, best electronic cigarette