그림이 3D로 보이도록 과거 원뿔의 일부를 투명하게 만들려면 어떻게 해야 합니까?

그림이 3D로 보이도록 과거 원뿔의 일부를 투명하게 만들려면 어떻게 해야 합니까?

저는 최근에 tikz를 시작했는데 라벨이 붙은 부분을 어떻게 투명하게 만들 수 있는지 전혀 모르겠습니다! 누군가가 나를 도울 수 있기를 바랍니다. 미리 감사드립니다여기에 이미지 설명을 입력하세요

\usepackage{tikz,tikz-3dplot}
\tdplotsetmaincoords{80}{45}
\tdplotsetrotatedcoords{-90}{180}{-90}
\begin{document} 
\begin{figure}[!h]
\centering

 \tikzset{surface/.style={draw=blue!70!black, fill=blue!40!white, fill opacity=.6}}

 \newcommand{\coneback}[4][]{
 \draw[canvas is xy plane at z=#2, #1] (45-#4:#3) arc (45-#4:225+#4:#3) -- (O) --cycle;
 }
 \newcommand{\conefront}[4][]{
 \draw[canvas is xy plane at z=#2, #1] (45-#4:#3) arc (45-#4:-135+#4:#3) -- (O) --cycle;
 }
 \begin{tikzpicture}[tdplot_main_coords, grid/.style={help lines,blue!40!white,opacity=0.2},scale=1]
  \coordinate (O) at (0,0,0);
   \fill[blue!40!white,opacity=0.5] (-4,-4,0) -- (-4,4,0) -- (4,4,0) -- (4,-4,0) -- cycle;
  
   \foreach \x in {-4,...,4}
     \foreach \y in {-4,...,4}
     {
         \draw[grid] (\x,-4) -- (\x,4);
         \draw[grid] (-4,\y) -- (4,\y);
     }
   \coneback[surface]{-3}{2}{-12}
   \conefront[surface]{-3}{2}{-12}
   \draw[->] (-4,0,0) -- (4,0,0) {};
   \draw[->] (0,-4,0) -- (0,4,0) {};
   \coneback[surface]{3}{2}{12}
   \draw[-,dashed] (0,0,-2.65) -- (0,0,2.65) node[above] {};
   \draw[-,dashed] (0,0,-4) -- (0,0,-3.35) node[above] {};
   \draw[->,dashed] (0,0,3.35) -- (0,0,4) node[above] {$time$};
   \conefront[surface]{3}{2}{12}
   \fill (4,0,2) circle (2pt) node[above right] {$C$};
   \fill (0,0,0) circle (2pt) {};
   \fill (-0.5,-0.85,2.2) circle (2pt) node[above left] {$A$};
   \fill (1.3,0.5,2) circle (2pt) node[above left] {$B$};
   \draw[->,red] (0,0,0) -- (4,0,2) node[below, pos=0.6, rotate=26.5651,scale=0.70,black] {$\textbf{spacelike vector}$};
   \draw[->,red] (0,0,0) -- (1.3,0.5,2) node[below, pos=0.65, rotate=55.1459,scale=0.70,black] {$\textbf{lightlike vector}$};
   \draw[->,red] (0,0,0) -- (-0.5,-0.85,2.2) node[above, pos=0.57, rotate=-65.8557,scale=0.70,black] {$\textbf{timelike vector}$};
   \node[black] at (0,0,3) {$Future\,\,Light\,\,Cone$};
   \node[black] at (0,0,-3) {$Past\,\,Light\,\,Cone$};
   \node[black] at (0,0.05,0.3) {$O$};
   \node[black] at (0,4.7,0) {$space$};
   \node[black] at (5,-0.3,0) {$space$};
 \end{tikzpicture}
 \caption{Light Cone in 2d Space plus a Time Dimension}
 \label{cone}
\end{figure}

답변1

아래쪽 원뿔을 먼저 그립니다. 그런 다음 평면을 그린 다음 위쪽 원뿔을 그립니다. 파란색 바탕에 파란색을 사용하면 앞에 무엇이 있는지 확인하기가 더 어려워지기 때문에 색 구성표를 변경하는 것도 도움이 될 수 있습니다. 추가 대비를 제공하기 위해 평면의 윤곽을 잡을 수 있습니다. 마지막으로 시간 축을 분할하여 과거 절반이 평면 앞에 그려지도록 하겠습니다.

여기에 이미지 설명을 입력하세요

\begin{figure}[!h]
\centering

 \tikzset{surface/.style={draw=blue!70!black, fill=blue!20!white, fill opacity=.6}}

 \newcommand{\coneback}[4][]{
 \draw[canvas is xy plane at z=#2, #1] (45-#4:#3) arc (45-#4:225+#4:#3) -- (O) --cycle;
 }
 \newcommand{\conefront}[4][]{
 \draw[canvas is xy plane at z=#2, #1] (45-#4:#3) arc (45-#4:-135+#4:#3) -- (O) --cycle;
 }
 \begin{tikzpicture}[tdplot_main_coords, grid/.style={help lines,violet!40!white,opacity=0.5},scale=1]
  \coordinate (O) at (0,0,0);
  
     \coneback[surface]{-3}{2}{-12}
   \conefront[surface]{-3}{2}{-12} 
  
   \fill[violet!40!white,opacity=0.5] (-4,-4,0) -- (-4,4,0) -- (4,4,0) -- (4,-4,0) -- cycle;
  
   \foreach \x in {-4,...,4}
     \foreach \y in {-4,...,4}
     {
         \draw[grid] (\x,-4) -- (\x,4);
         \draw[grid] (-4,\y) -- (4,\y);
         \draw[violet] (-4,4)--(-4,-4)--(4,-4)--(4,4)--cycle;
     }

   \draw[->] (-4,0,0) -- (4,0,0) {};
   \draw[->] (0,-4,0) -- (0,4,0) {};
   \coneback[surface]{3}{2}{12}
   \draw[-,dashed] (0,0,-2.65) -- (0,0,2.65) node[above] {};
   \draw[-,dashed] (0,0,-4) -- (0,0,-3.35) node[above] {};
   \draw[->,dashed] (0,0,3.35) -- (0,0,4) node[above] {$time$};
   \conefront[surface]{3}{2}{12}
   \fill (4,0,2) circle (2pt) node[above right] {$C$};
   \fill (0,0,0) circle (2pt) {};
   \fill (-0.5,-0.85,2.2) circle (2pt) node[above left] {$A$};
   \fill (1.3,0.5,2) circle (2pt) node[above left] {$B$};
   \draw[->,red] (0,0,0) -- (4,0,2) node[below, pos=0.6, rotate=26.5651,scale=0.70,black] {$\textbf{spacelike vector}$};
   \draw[->,red] (0,0,0) -- (1.3,0.5,2) node[below, pos=0.65, rotate=55.1459,scale=0.70,black] {$\textbf{lightlike vector}$};
   \draw[->,red] (0,0,0) -- (-0.5,-0.85,2.2) node[above, pos=0.57, rotate=-65.8557,scale=0.70,black] {$\textbf{timelike vector}$};
   \node[black] at (0,0,3) {$Future\,\,Light\,\,Cone$};
   \node[black] at (0,0,-3) {$Past\,\,Light\,\,Cone$};
   \node[black] at (0,0.05,0.3) {$O$};
   \node[black] at (0,4.7,0) {$space$};
   \node[black] at (5,-0.3,0) {$space$};
 \end{tikzpicture}
 \caption{Light Cone in 2d Space plus a Time Dimension}
 \label{cone}
\end{figure}

관련 정보