Quantcast
Channel: Antworten auf: Drehung einer TIKZ Zeichnung im Raum um eine Achse
Viewing all articles
Browse latest Browse all 2

Antwort von esdd

$
0
0

Wenn Du angeben kannst, wie der x- und y-Vektor auf die zweidimensionale Zeichenebene projiziert werden, dann geht das auch halbwegs mit TikZ. Bei komplizierteren dreidimensionalen Sachen ist dann aber PSTricks sicher überlegen.

Wenn y-Achse bei Drehung um 0° nach links und die x-Achse in die Zeichenebene hinein zeigen sollen:

Open in Online-Editor
\pgfmathsetmacro\projektionx{-cos(\winkel+90)}\pgfmathsetmacro\projektiony{-cos(\winkel)}\tikzset{x={(\projektionx cm,0cm)},y={(\projektiony cm,0cm)},z={(0cm,1cm)}}

alt text

Code:

Open in Online-Editor
\documentclass[margin=5pt,tikz]{standalone}\begin{document}\foreach\winkel in {0,10,...,360}{%\pgfmathsetmacro\projektionx{-cos(\winkel+90)}\pgfmathsetmacro\projektiony{-cos(\winkel)}\tikzset{x={(\projektionx cm,0cm)},y={(\projektiony cm,0cm)},z={(0cm,1cm)}}\begin{tikzpicture}[
      strichpunkt/.style={dash pattern=on 5.5mm off 2mm on .5mm off 2mm, -,line width=1pt},
      achse/.style={->,blue},
      punkt/.style={circle,fill,red,inner sep=0pt,minimum size=.2cm},
      dreieck/.style={fill,green},
      nummer/.style={inner sep=.2pt},
    ]
    \node[anchor=south west,inner sep=0](Bild)at(1cm,7cm){\color{blue!10}\rule{8cm}{5cm}};
    \begin{scope}[xshift=5cm,yshift=8cm,line width=2pt]
        \draw[strichpunkt]
          (0,0,0)--(0,4,0)
          (0,0,0)--(0,0,4)
          (0,0,0)--(0,-4,0)
        ;
        \draw[achse](0,0,0)--(3,0,0)node[above]{$x$};
        \draw[achse](0,0,0)--(0,3,0)node[above]{$y$};
        \draw[achse](0,0,0)--(0,0,3)node[left]{$z$};
        \draw
          (0,4,-0.7)--(0,-4,-0.7)
          (0,4,0.7)--(0,-4,0.7)
          (0,0,-0.7)--(0,0,0.7)
          (0,0.7,4)--(0,0.7,0)--(0,-0.7,0)--(0,-0.7,4)
        ;
        \draw(0,0.9243,0.7)coordinate(p1)--+(0,0,.5)node[nummer,above]{0};
        \draw(0,0.7,0.9243)coordinate(p2)--+(0,.5,0)node[nummer,left]{1};
        \draw(0,-0.7,2.0414)coordinate(p3)--+(0,-.5,0)node[nummer,right]{2};
        \draw(0,-2.0414,0.7)coordinate(p4)--+(0,0,.5)node[nummer,above]{3};

        \foreach\i in {1,...,4}\node[punkt] at (p\i){};

        \path[dreieck]
          (0,0.7,0.7)--(0,1.1243,0.7)--(0,0.7,1.1243)--cycle
          (0,-0.7,0.7)--(0,-0.8414,0.7)--(0,-0.7,0.8414)--cycle
        ;
    \end{scope}\end{tikzpicture}%}\end{document}

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images