von BlackDevil » Do 23. Jan 2014, 16:00
Ich hab in der Zwischenzeit mal mein Hirn benutzt
\documentclass{scrbook}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\foreach \x in {0pt,0.75pt,...,3pt}
{
\foreach \y in {0pt,0.75pt,...,3pt}
{
\pgfmathsetmacro\resulta{\x + \y}
\pgfmathsetmacro\resultb{cos(30) * \y}
\shade[ball color=gray] (\resulta,\resultb) circle (0.25);
}
}
\foreach \x/\name in {0cm/a,1cm/b,2cm/c,3cm/d}
{
\shade[ball color=gray!50] (\x,-2) circle (0.25);
\node (\name) at (\x,-2) {\name};
}
\end{tikzpicture}
\end{document}
Das resultiert schon mal in einem der 3D Perspektive sehr ähnlichen Raster. Die Kugeln unten drunter sind nun noch nicht so perfekt angeordnet, weiß aber auch noch nicht so ganz wo ich sonst damit hin soll. Würde aber passen. Ich weiß nun nur noch nicht wie ich die Kugeln im Raster benennen soll, also Nodes hinzufügen soll. Meine bisherigen Versuche in die erste For-Schleife eine zweite Variable \name hinzuzufügen endete darin, das jede Reihe den gleichen Namen hatte...
Vielleicht macht es das nun einfacher zu helfen

Im Zweifelsfall schau ich bei der TexWelt vorbei
Edit:
Ta-da
\documentclass{scrbook}
\begin{document}
\usetikzlibrary{backgrounds}
\begin{tikzpicture}
\foreach[count=\i] \x in {0pt,0.75pt,...,3pt}
{
\foreach[count=\j] \y in {0pt,0.75pt,...,3pt}
{
\pgfmathsetmacro\resulta{\x + \y}
\pgfmathsetmacro\resultb{cos(30) * \y}
\shade[ball color=gray] (\resulta,\resultb) circle (0.25);
\node[circle] (\i\j) at (\resulta,\resultb) {\i\j};
}
}
\foreach \x/\nameb in {0cm/a,1cm/b,2cm/c,3cm/d}
{
\shade[ball color=gray!50] (\x,-1) circle (0.2);
\node[circle] (\nameb) at (\x,-1) {\nameb};
}
\begin{pgfonlayer}{background}
\foreach \letter in {a,b,c,d}
{
\foreach \x in {1,2,...,5}
{
\foreach \y in {1,2,...,5}
{
\draw[->] (\letter) -- (\x\y);
}
}
}
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
Ich hab in der Zwischenzeit mal mein Hirn benutzt
[code]
\documentclass{scrbook}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\foreach \x in {0pt,0.75pt,...,3pt}
{
\foreach \y in {0pt,0.75pt,...,3pt}
{
\pgfmathsetmacro\resulta{\x + \y}
\pgfmathsetmacro\resultb{cos(30) * \y}
\shade[ball color=gray] (\resulta,\resultb) circle (0.25);
}
}
\foreach \x/\name in {0cm/a,1cm/b,2cm/c,3cm/d}
{
\shade[ball color=gray!50] (\x,-2) circle (0.25);
\node (\name) at (\x,-2) {\name};
}
\end{tikzpicture}
\end{document}[/code]
Das resultiert schon mal in einem der 3D Perspektive sehr ähnlichen Raster. Die Kugeln unten drunter sind nun noch nicht so perfekt angeordnet, weiß aber auch noch nicht so ganz wo ich sonst damit hin soll. Würde aber passen. Ich weiß nun nur noch nicht wie ich die Kugeln im Raster benennen soll, also Nodes hinzufügen soll. Meine bisherigen Versuche in die erste For-Schleife eine zweite Variable \name hinzuzufügen endete darin, das jede Reihe den gleichen Namen hatte...
Vielleicht macht es das nun einfacher zu helfen :) Im Zweifelsfall schau ich bei der TexWelt vorbei :)
Edit:
Ta-da 8) :D
[code]
\documentclass{scrbook}
\begin{document}
\usetikzlibrary{backgrounds}
\begin{tikzpicture}
\foreach[count=\i] \x in {0pt,0.75pt,...,3pt}
{
\foreach[count=\j] \y in {0pt,0.75pt,...,3pt}
{
\pgfmathsetmacro\resulta{\x + \y}
\pgfmathsetmacro\resultb{cos(30) * \y}
\shade[ball color=gray] (\resulta,\resultb) circle (0.25);
\node[circle] (\i\j) at (\resulta,\resultb) {\i\j};
}
}
\foreach \x/\nameb in {0cm/a,1cm/b,2cm/c,3cm/d}
{
\shade[ball color=gray!50] (\x,-1) circle (0.2);
\node[circle] (\nameb) at (\x,-1) {\nameb};
}
\begin{pgfonlayer}{background}
\foreach \letter in {a,b,c,d}
{
\foreach \x in {1,2,...,5}
{
\foreach \y in {1,2,...,5}
{
\draw[->] (\letter) -- (\x\y);
}
}
}
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
[/code]