考虑以下代码:
\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}