I would like to know if it's possible to draw a cylinder in a 3 dimensional space in tikz, such as I'm able to turn around/ change the point of view? (cf. \begin{tikzpicture}[>=latex, x={(0:1cm)}, y={(90:1cm)}, z={(30:0.4cm)}]
I read several posts saying it's difficult.
I've already a flat drawing,
%%%%%%%%%%%%%%%%%% INTRODUCTION %%%%%%%%%%%%%%%%%%
\documentclass[border=10pt]{standalone}
%%%%%%%%%%%%%%%%%% PACKAGE %%%%%%%%%%%%%%%%%%
\usepackage{tikz, tkz-euclide}% permet de dessiner des figures, des graphiques
\usepackage{adjustbox}% permet de déterminer une taille de fenêtre
%% FONT
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tgadventor}% paquet de police de caractère TGadventor
\usepackage{sansmath}% Copie-colle la police active dans
% \sfdefault (/!\ N'EST PAS UNE POLICE DE CARACTÈRES)
\usepackage{xcolor}
%%%%%%%%%%%%%%%%%% INPUT %%%%%%%%%%%%%%%%%%
%\input{types/f3d_figlab}
%%%%%%%%%%%%%%%%%%%% Cylinder %%%%%%%%%%%%%%%%%%%%%
\tikzset{pics/cylinder/.style={code={%
\tikzset{cylinder/.cd,#1}%
\def\pv##1{\pgfkeysvalueof{/tikz/cylinder/##1}}
% depth of the cylinder
\newcommand{\depth}{\pv{ray}*\pv{scale}*0.25}
\fill[baseinf] (0,0) circle (\pv{ray}*\pv{scale} cm and \depth cm);
\fill[corps] (\pv{ray}*\pv{scale},0) -- (\pv{ray}*\pv{scale},\pv{height}*\pv{scale}) arc (360:180:\pv{ray}*\pv{scale} cm and \depth cm) -- (-\pv{ray}*\pv{scale},0) arc (180:360:\pv{ray}*\pv{scale} cm and \depth cm);
\fill[basesup] (0,\pv{height}*\pv{scale}) circle (\pv{ray}*\pv{scale} cm and \depth cm);
\draw[thick] (-\pv{ray}*\pv{scale},\pv{height}*\pv{scale}) -- (-\pv{ray}*\pv{scale},0) arc (180:360:\pv{ray}*\pv{scale} cm and \depth cm) -- (\pv{ray}*\pv{scale},\pv{height}*\pv{scale}) ++ (-\pv{ray}*\pv{scale},0) circle (\pv{ray}*\pv{scale} cm and \depth cm)
;
\draw[thick, densely dashed] (-\pv{ray}*\pv{scale},0) arc (180:0:\pv{ray}*\pv{scale} cm and \depth cm);
% Mesure de la hauteur
\draw[thick,<->]
(\pv{ray}*\pv{scale}+0.4,0) -- (\pv{ray}*\pv{scale}+0.4,\pv{height}*\pv{scale}) node[midway, right] {\pv{height}~\pv{unit}};
% Mesure du rayon
\draw[thick,<->]
(0,-\depth-0.4) -- (\pv{ray}*\pv{scale},-\depth-0.4) node[midway, below] {\pv{ray}~\pv{unit}};
\draw (0,0) node[circle, fill=black, opacity=.8, scale=.3] {};
}},
cylinder/.cd,
ray/.initial=5,
height/.initial=5,
fill/.initial=gray,
unit/.initial=cm,
scale/.initial=1,
}
%%%%%%%%%%%%%%%%%% DOCUMENT %%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[font={\sansmath\sffamily},line width=0.4mm , line cap=round, line join=round, >=latex, x={(0:1cm)}, y={(90:1cm)}, z={(75:0.6cm)}]
% calibration cross
%\pic at (5,0,0) {calcross};
% Figures
\pic{cylinder={ray=63, height=50, scale=.07, corps/.style={draw,fill=orange!20}, basesup/.style={draw,fill=orange!20},}};
\end{tikzpicture}
\end{document}

baseinf,corpsandbasesupare missing. – Mar 18 '20 at 18:20\documentclasscommand, include any necessary packages and be as small as possible to demonstrate your problem. At the moment we have to guess what packages etc you are using before we can compile your code. – Mar 18 '20 at 23:07