考慮以下程式碼:
\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}
\psset{viewpoint = 15 -30 11, Decran = 10}
\begin{pspicture}[solidmemory](-8.25,-1)(5.3,2.05)
\psSolid[object = point, args = 15.5 3 7.3, name = L]
\psSolid[object = point, args = -55 2 3.5, name = R]
\psSolid[object = line, linecolor = red!50, linestyle = dashed, linewidth = 2pt, args = R L]
\psSolid[object = parallelepiped, a = 6.0, b = 6.0, c = 6.5, RotZ = -15, fillcolor = blue!50, name = parallelepipedum, action = draw*](0 0 1.5)
\multido{\iA = 0+1}{8}{%
\psSolid[object = point, linecolor = black, definition = solidgetsommet, args = parallelepipedum \iA, name = C\iA]
\psset{object = line, linecolor = darkgray!50, linestyle = dotted}
\psSolid[args = L C\iA]
\psSolid[args = R C\iA]
}
\psSolid[object = parallelepiped, a = 6.0, b = 6.0, c = 6.5, RotZ = -15, name = parallelipipidum, action = draw](0 0 1.5)
\multido{\iB = 0+1}{4}{%
\psSolid[object = point, definition = solidgetsommet, args = parallelipipidum \iB, name = Top\iB, action = none]
}
\psSolid[object = line, args = Top0 Top2]
\psSolid[object = line, args = Top1 Top3]
\psSolid[object = point, definition = solidcentreface, args = parallelipipidum 0]
\end{pspicture}
\end{document}
有人可以幫我調整參數,讓每對灰色虛線完美重疊在一起。
我已經嘗試了很長時間,但我仍處於黑暗之中。:(
我應該指出,所討論的參數是args = 15.5 3 7.3
、args = -55 2 3.5
和a = 6.0, b = 6.0, c = 6.5, RotZ = -15
。 (兩個物件的a
、b
、c
和的值RotZ
應該相同。)
答案1
- 平行於地面的線的消失點位於視線水平,因此物體
z
的位置point
需要等於z
的值viewpoint
。 - 指向水平角的直線的消失點
theta
位於x=tan(theta)*yv + xv
,其中yv
和xv
是的x
和y
分量viewpoint
。 - 消失點位於地平線上,即
y=0
。
因此,對於 的視點15 -30 11
和 的長方體的旋轉-15 degrees
,消失點位於23.04 0 11
和-96.96 0 11
:
\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}
\psset{viewpoint = 15 -30 11, Decran = 6}
\begin{pspicture}[solidmemory](-8.25,-1)(5.3,2.05)
\psSolid[object = point, args = 23.04 0 11, name = L]
\psSolid[object = point, args = -96.96 0 11, name = R]
\psSolid[object = line, linecolor = red!50, linestyle = dashed, linewidth = 2pt, args = R L]
\psSolid[object = parallelepiped, a = 8.0, b = 8.0, c = 8.5, RotZ = -15, fillcolor = blue!50, name = parallelepipedum, action = draw*](0 0 1.5)
\multido{\iA = 0+1}{8}{%
\psSolid[object = point, linecolor = black, definition = solidgetsommet, args = parallelepipedum \iA, name = C\iA]
\psset{object = line, linecolor = darkgray!50, linestyle = dotted}
\psSolid[args = L C\iA]
\psSolid[args = R C\iA]
}
\psSolid[object = parallelepiped, a = 8.0, b = 8.0, c = 8.5, RotZ = -15, name = parallelipipidum, action = draw](0 0 1.5)
\multido{\iB = 0+1}{4}{%
\psSolid[object = point, definition = solidgetsommet, args = parallelipipidum \iB, name = Top\iB, action = none]
}
\psSolid[object = line, args = Top0 Top2]
\psSolid[object = line, args = Top1 Top3]
\psSolid[object = point, definition = solidcentreface, args = parallelipipidum 0]
\end{pspicture}
\end{document}