买者自负 ...

买者自负 ...

我必须画一个相机镜头的示意图,所以我尽力让这幅画看起来像一个真正的镜头。我曾多次被告知,它看起来更像一个扬声器比相机镜头更

为了改善这幅画,我认为一个好的起点是在镜头玻璃上添加一些反射。但我不知道如何在 Tikz 中继续。我尝试过的大多数透明度和阴影效果让它看起来更糟……

这是我尝试过的 MWE

\documentclass[tikz]{standalone}
\usetikzlibrary{calc}
\usetikzlibrary{fadings}
\usetikzlibrary{decorations.text}
\tikzfading[name=fade inside, inner color=transparent!90, outer color=transparent!40]

\begin{document}
    \begin{tikzpicture} 
        \coordinate (baseSupportLunette) at (0,-4);
        \coordinate (coinSupportCameras) at  -- ($(baseSupportLunette)+(-3,1.75)$);
        \coordinate (moteurTilt) at (-1.75,0);

        \draw[very thick,gray,dashed] (baseSupportLunette) -- (0,3);

        % lens 
        \filldraw[black!85] (0,0) circle (1.75cm);
        \draw[darkgray] (0,0) circle (0.2);
        \shade [ball color=white,path fading=fade inside] (0,0) circle (0.195);
        \draw[gray] (0,0) circle (0.5);
        \draw[] (0,0) circle (0.6);
        \draw[darkgray] (0,0) circle (0.75);
        \shade [ball color=white,path fading=fade inside] (0,0) circle (1.245);
        \draw[darkgray,thick] (0,0) circle (1.25);
        \draw[thick] (0,0) circle (1.35);       

        % lens support
        \draw[line width=1mm,darkgray] (0,-2.25) -- (baseSupportLunette); 

        % structure
        \draw[darkgray,line width=1mm,rounded corners] (1.75,0)%
        -- (2.3,0)%
        -- (2.3,-2.25)%
        -- (coinSupportCameras)%
        -- (-3,0) -- (moteurTilt); 

        % lens border
        \draw[very thick] (0,0) circle (1.75); 

        % top rotation arrow
        \draw[very thick,stealth-stealth] (-0.125,2.625) arc [start angle=100, end angle=440,x radius=0.75cm, y radius=0.125cm];   

        % side rotation arrow
        \draw[very thick,stealth-stealth] (-2.25,0.125) arc [start angle=10, end angle=350,x radius=0.125cm, y radius=0.75cm];

        % lens label
        \path [postaction={decorate,decoration%
        ={raise=0pt,text along path, reverse path=true,%
        text align/align=center,%
        text align/left indent={4.5553093477052cm},%
        text color=lightgray,%
        text=|\sffamily\scriptsize|CAMERA LENS}}]%
         (0,0) circle (1.45cm);         
    \end{tikzpicture}
\end{document}

答案1

Z 是不是灯光效果工具。除非您希望逐像素绘制它们,否则这不适用,我想如果您不需要可扩展的东西,这始终是一个选择。该软件包不是为此设计的。

Mark Wibrow 会想出某种东西来实时反射棱镜光,从而证明我完全错了。但 TiZ 仍然不是一个好选择为此,因为其他工具......嗯,有些工具实际上听说过光......

买者自负 ...

灯光效果

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,fadings,decorations.text}
\tikzfading[name=fade inside, inner color=transparent!90, outer color=transparent!40]

\begin{document}
\begin{tikzpicture}
  \coordinate (baseSupportLunette) at (0,-4);
  \coordinate (coinSupportCameras) at  -- ($(baseSupportLunette)+(-3,1.75)$);
  \coordinate (moteurTilt) at (-1.75,0);

  \draw[very thick,gray,dashed] (baseSupportLunette) -- (0,3);

  % lens
  \filldraw[black!85] (0,0) circle (1.75cm);
  \draw [darkgray] (0,0) circle (0.2);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (0.195);
  \draw [gray] (0,0) circle (0.5);
  \draw[] (0,0) circle (0.6);
  \draw [darkgray] (0,0) circle (0.75);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (1.245);
  \draw [darkgray,thick] (0,0) circle (1.25);
  \draw [thick] (0,0) circle (1.35);
  \begin{scope}
    \clip (0,0) circle (1.75);
    \foreach \i in {8,...,10,11} \shade [ball color=white!85!blue, blend mode=hard light, opacity=1] (135:{1.3*(10-\i}) circle ({0.13*\i});
    \shade [ball color=white!85!blue, shading angle=0, blend mode=hard light, opacity=1] (0,0) circle (1.3);
  \end{scope}
  % lens support
  \draw[line width=1mm,darkgray] (0,-2.25) -- (baseSupportLunette);

  % structure
  \draw[darkgray,line width=1mm,rounded corners] (1.75,0)%
  -- (2.3,0)%
  -- (2.3,-2.25)%
  -- (coinSupportCameras)%
  -- (-3,0) -- (moteurTilt);

  % lens border
  \draw[very thick] (0,0) circle (1.75);

  % top rotation arrow
  \draw[very thick,stealth-stealth] (-0.125,2.625) arc [start angle=100, end angle=440,x radius=0.75cm, y radius=0.125cm];

  % side rotation arrow
  \draw[very thick,stealth-stealth] (-2.25,0.125) arc [start angle=10, end angle=350,x radius=0.125cm, y radius=0.75cm];

  % lens label
  \path [postaction={decorate,decoration%
    ={raise=0pt,text along path, reverse path=true,%
      text align/align=center,%
      text align/left indent={4.5553093477052cm},%
      text color=lightgray,%
      text=|\sffamily\scriptsize|CAMERA LENS}}]%
  (0,0) circle (1.45cm);
\end{tikzpicture}
\end{document}

编辑

shadings这是添加库的效果

% Mark Wibrow's suggestion
    \shade [shading=color wheel, path fading=fade inside] circle (1.3);

作为Mark Wibrow建议

带色轮阴影

或者,使用

    \shade [shading=color wheel black center, path fading=fade inside] circle (1.3);

色轮阴影略有不同

正如建议的那样,半径仅为1,对我来说看起来很奇怪。

建议半径

但或许我只是错了。

编辑 编辑

彩色版本的完整代码:

% ateb: https://tex.stackexchange.com/a/375369/ addaswyd o gwestiwn jrojasqu: https://tex.stackexchange.com/q/375362/
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{fadings,decorations.text,shadings}
\tikzfading[name=fade inside, inner color=transparent!90, outer color=transparent!40]

\begin{document}
\begin{tikzpicture}
  \coordinate (baseSupportLunette) at (0,-4);
  \coordinate (moteurTilt) at (-1.75,0);

  % lens
  \filldraw[black!85] (0,0) circle (1.75cm);
  \draw [darkgray] (0,0) circle (0.2);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (0.195);
  \draw [gray] (0,0) circle (0.5);
  \draw[] (0,0) circle (0.6);
  \draw [darkgray] (0,0) circle (0.75);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (1.245);
  \draw [darkgray,thick] (0,0) circle (1.25);
  \draw [thick] (0,0) circle (1.35);
  \begin{scope}
    \clip (0,0) circle (1.75);
    % Mark Wibrow's suggestion
    \shade [shading=color wheel, path fading=fade inside] circle (1);
    \foreach \i in {8,...,10,11} \shade [ball color=white!85!blue, blend mode=hard light, opacity=1] (135:{1.3*(10-\i}) circle ({0.13*\i});
    \shade [ball color=white!85!blue, shading angle=0, blend mode=hard light, opacity=1] (0,0) circle (1.3);
  \end{scope}

  % lens border
  \draw[very thick] (0,0) circle (1.75);

  % lens label
  \path [postaction={decorate,decoration%
    ={raise=0pt,text along path, reverse path=true,%
      text align/align=center,%
      text align/left indent={4.5553093477052cm},%
      text color=lightgray,%
      text=|\sffamily\scriptsize|CAMERA LENS}}]%
  (0,0) circle (1.45cm);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (baseSupportLunette) at (0,-4);
  \coordinate (moteurTilt) at (-1.75,0);

  % lens
  \filldraw[black!85] (0,0) circle (1.75cm);
  \draw [darkgray] (0,0) circle (0.2);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (0.195);
  \draw [gray] (0,0) circle (0.5);
  \draw[] (0,0) circle (0.6);
  \draw [darkgray] (0,0) circle (0.75);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (1.245);
  \draw [darkgray,thick] (0,0) circle (1.25);
  \draw [thick] (0,0) circle (1.35);
  \begin{scope}
    \clip (0,0) circle (1.75);
    % Mark Wibrow's suggestion
    \shade [shading=color wheel, path fading=fade inside] circle (1.3);
    \foreach \i in {8,...,10,11} \shade [ball color=white!85!blue, blend mode=hard light, opacity=1] (135:{1.3*(10-\i}) circle ({0.13*\i});
    \shade [ball color=white!85!blue, shading angle=0, blend mode=hard light, opacity=1] (0,0) circle (1.3);
  \end{scope}

  % lens border
  \draw[very thick] (0,0) circle (1.75);

  % lens label
  \path [postaction={decorate,decoration%
    ={raise=0pt,text along path, reverse path=true,%
      text align/align=center,%
      text align/left indent={4.5553093477052cm},%
      text color=lightgray,%
      text=|\sffamily\scriptsize|CAMERA LENS}}]%
  (0,0) circle (1.45cm);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (baseSupportLunette) at (0,-4);
  \coordinate (moteurTilt) at (-1.75,0);

  % lens
  \filldraw[black!85] (0,0) circle (1.75cm);
  \draw [darkgray] (0,0) circle (0.2);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (0.195);
  \draw [gray] (0,0) circle (0.5);
  \draw[] (0,0) circle (0.6);
  \draw [darkgray] (0,0) circle (0.75);
  \shade [ball color=white,path fading=fade inside] (0,0) circle (1.245);
  \draw [darkgray,thick] (0,0) circle (1.25);
  \draw [thick] (0,0) circle (1.35);
  \begin{scope}
    \clip (0,0) circle (1.75);
    % Mark Wibrow's suggestion
    \shade [shading=color wheel black center, path fading=fade inside] circle (1.3);
    \foreach \i in {8,...,10,11} \shade [ball color=white!85!blue, blend mode=hard light, opacity=1] (135:{1.3*(10-\i}) circle ({0.13*\i});
    \shade [ball color=white!85!blue, shading angle=0, blend mode=hard light, opacity=1] (0,0) circle (1.3);
  \end{scope}

  % lens border
  \draw[very thick] (0,0) circle (1.75);

  % lens label
  \path [postaction={decorate,decoration%
    ={raise=0pt,text along path, reverse path=true,%
      text align/align=center,%
      text align/left indent={4.5553093477052cm},%
      text color=lightgray,%
      text=|\sffamily\scriptsize|CAMERA LENS}}]%
  (0,0) circle (1.45cm);
\end{tikzpicture}
\end{document}

相关内容