.png)
Ti에 텍스트를 표시하고 싶습니다.케이Z는 다음과 같이 원근적으로 왜곡됩니다.
TeX.SE에는 유사한 솔루션이 많이 있습니다(여기,여기, 또는여기), 그러나 내가 찾은 것들은 모두 경사와 기울기를 사용하여 원근감을 가짜로 만든 것입니다.
솔루션은 텍스트를 다음과 같이 변환해야 합니다.
- 일반적으로 수평으로 평행한 모든 선이 눈에 띄게 수렴하는 수평 소실점이 있습니다.
- 일반적으로 수직으로 평행한 모든 선이 수렴하는 수직 소실점이 있거나 엄격하게 평행을 유지합니다(위의 예와 같이).
- 귀하의 솔루션을 통해 사용자가 소실점을 명시적으로 정의할 수 있다면 보너스입니다.
이것을 출발점으로 사용할 수 있습니다.
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\node[draw,align=left] at (0,0) {some text\\maybe with line breaks};
\end{tikzpicture}
\end{document}
답변1
이 접근 방식은 단어를 작은 삼각형으로 나누고 각 삼각형에 기울기와 기울기를 적용합니다. 이는 일반적인 비선형 변환뿐만 아니라 투영에도 적용됩니다.
이전에 등장한 적이 있습니다.
\documentclass[border=9,tikz]{standalone}
\begin{document}
\fontsize{188pt}{0}\bfseries
\pgfmathdeclarefunction{fxx}{2}{\pgfmathparse{fx(#1+1,#2)-fx(#1,#2)}}
\pgfmathdeclarefunction{fxy}{2}{\pgfmathparse{fy(#1+1,#2)-fy(#1,#2)}}
\pgfmathdeclarefunction{fyx}{2}{\pgfmathparse{fx(#1,#2+1)-fx(#1,#2)}}
\pgfmathdeclarefunction{fyy}{2}{\pgfmathparse{fy(#1,#2+1)-fy(#1,#2)}}
\begin{tikzpicture}
\pgfmathdeclarefunction{gx}{2}{\pgfmathparse{3*#1-20}}
\pgfmathdeclarefunction{gy}{2}{\pgfmathparse{3.1622*#2}}
\pgfmathdeclarefunction{gz}{2}{\pgfmathparse{#1+10}}
\pgfmathdeclarefunction{fx}{2}{\pgfmathparse{gx(#1,#2)*6/gz(#1,#2)}}
\pgfmathdeclarefunction{fy}{2}{\pgfmathparse{gy(#1,#2)*6/gz(#1,#2)}}
\clip(-15,-9)rectangle(15,10);
\foreach\i in{0,...,40}{
\foreach\j in{-3,...,3}{
\pgfmathsetmacro\aa{fxx(\i,\j)}
\pgfmathsetmacro\ab{fxy(\i,\j)}
\pgfmathsetmacro\ba{fyx(\i,\j)}
\pgfmathsetmacro\bb{fyy(\i,\j)}
\pgfmathsetmacro\xx{fx (\i,\j)}
\pgfmathsetmacro\yy{fy (\i,\j)}
\pgflowlevelobj{
\pgfsettransformentries{\aa}{\ab}{\ba}{\bb}{\xx cm}{\yy cm}
}{
\clip(1,0)--(0,0)--(0,1)--cycle;
\draw(1,0)--(0,0)--(0,1)--cycle;
\tikzset{shift={(-\i,-\j)}}
\path(20,.5)node{WORDART};
}
\pgfmathsetmacro\aa{fxx(\i ,\j+1)}
\pgfmathsetmacro\ab{fxy(\i ,\j+1)}
\pgfmathsetmacro\ba{fyx(\i+1,\j )}
\pgfmathsetmacro\bb{fyy(\i+1,\j )}
\pgfmathsetmacro\xx{fx (\i+1,\j+1)}
\pgfmathsetmacro\yy{fy (\i+1,\j+1)}
\pgflowlevelobj{
\pgfsettransformentries{\aa}{\ab}{\ba}{\bb}{\xx cm}{\yy cm}
}{
\clip(0,0)--(-1,0)--(0,-1)--cycle;
\draw(0,0)--(-1,0)--(0,-1)--cycle;
\tikzset{shift={(-\i-1,-\j-1)}}
\path(20,.5)node{WORDART};
}
}
}
\end{tikzpicture}
\end{document}