3d emulation with tikz
Clash Royale CLAN TAG#URR8PPP
up vote
6
down vote
favorite
I am trying to draw a 3d arbitrary volume using tikz
.
The 2d equivalent is like(courtesy: this):
beginframe
begintikzpicture
pgfmathsetseed3
draw[fill=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd) node at (0,0) ;
endtikzpicture
endframe
Is it possible to give it a 3d feeling? like a diffused lighting effect or something?
tikz-pgf
add a comment |Â
up vote
6
down vote
favorite
I am trying to draw a 3d arbitrary volume using tikz
.
The 2d equivalent is like(courtesy: this):
beginframe
begintikzpicture
pgfmathsetseed3
draw[fill=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd) node at (0,0) ;
endtikzpicture
endframe
Is it possible to give it a 3d feeling? like a diffused lighting effect or something?
tikz-pgf
add a comment |Â
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I am trying to draw a 3d arbitrary volume using tikz
.
The 2d equivalent is like(courtesy: this):
beginframe
begintikzpicture
pgfmathsetseed3
draw[fill=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd) node at (0,0) ;
endtikzpicture
endframe
Is it possible to give it a 3d feeling? like a diffused lighting effect or something?
tikz-pgf
I am trying to draw a 3d arbitrary volume using tikz
.
The 2d equivalent is like(courtesy: this):
beginframe
begintikzpicture
pgfmathsetseed3
draw[fill=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd) node at (0,0) ;
endtikzpicture
endframe
Is it possible to give it a 3d feeling? like a diffused lighting effect or something?
tikz-pgf
asked Aug 31 at 18:02
BaRud
80321321
80321321
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
8
down vote
accepted
Here is an option using shade
and the ball
preset
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetseed3
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endtikzpicture
enddocument
Some more examples
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetmacroS3
foreach X in 1,...,3
foreach Y in 1,...,3
beginscope[shift=(S*X,S*Y)]
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
4
down vote
A very small addendum to Milo's great answer: sometimes you want the bright spot not to be where shade[ball color=...]...
puts it. You could either define your own shading, or, what is perhaps simpler, clip a circle with a shifted center against that shape. The following animation is supposed to give you an idea what's possible. In the end, you will have to decide on your own what looks realistic, or switch to asymptote
, which computes realistic shadings for you.
documentclass[tikz,margin=0.5cm]standalone
begindocument
foreach X in 1,2,...,42
begintikzpicture
pgfmathsetseedX
path[use as bounding box] (-4,-4) rectangle (4,4);
clip plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
shade [ball color=blue!70] (0.5+rnd,-0.5+rnd) circle (3cm);
endtikzpicture
enddocument
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
accepted
Here is an option using shade
and the ball
preset
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetseed3
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endtikzpicture
enddocument
Some more examples
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetmacroS3
foreach X in 1,...,3
foreach Y in 1,...,3
beginscope[shift=(S*X,S*Y)]
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
accepted
Here is an option using shade
and the ball
preset
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetseed3
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endtikzpicture
enddocument
Some more examples
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetmacroS3
foreach X in 1,...,3
foreach Y in 1,...,3
beginscope[shift=(S*X,S*Y)]
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endscope
endtikzpicture
enddocument
add a comment |Â
up vote
8
down vote
accepted
up vote
8
down vote
accepted
Here is an option using shade
and the ball
preset
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetseed3
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endtikzpicture
enddocument
Some more examples
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetmacroS3
foreach X in 1,...,3
foreach Y in 1,...,3
beginscope[shift=(S*X,S*Y)]
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endscope
endtikzpicture
enddocument
Here is an option using shade
and the ball
preset
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetseed3
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endtikzpicture
enddocument
Some more examples
documentclass[tikz,margin=0.5cm]standalone
begindocument
begintikzpicture
pgfmathsetmacroS3
foreach X in 1,...,3
foreach Y in 1,...,3
beginscope[shift=(S*X,S*Y)]
shade [ball color=blue!70] plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
endscope
endtikzpicture
enddocument
edited Aug 31 at 18:20
answered Aug 31 at 18:06


Milo
5,53321345
5,53321345
add a comment |Â
add a comment |Â
up vote
4
down vote
A very small addendum to Milo's great answer: sometimes you want the bright spot not to be where shade[ball color=...]...
puts it. You could either define your own shading, or, what is perhaps simpler, clip a circle with a shifted center against that shape. The following animation is supposed to give you an idea what's possible. In the end, you will have to decide on your own what looks realistic, or switch to asymptote
, which computes realistic shadings for you.
documentclass[tikz,margin=0.5cm]standalone
begindocument
foreach X in 1,2,...,42
begintikzpicture
pgfmathsetseedX
path[use as bounding box] (-4,-4) rectangle (4,4);
clip plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
shade [ball color=blue!70] (0.5+rnd,-0.5+rnd) circle (3cm);
endtikzpicture
enddocument
add a comment |Â
up vote
4
down vote
A very small addendum to Milo's great answer: sometimes you want the bright spot not to be where shade[ball color=...]...
puts it. You could either define your own shading, or, what is perhaps simpler, clip a circle with a shifted center against that shape. The following animation is supposed to give you an idea what's possible. In the end, you will have to decide on your own what looks realistic, or switch to asymptote
, which computes realistic shadings for you.
documentclass[tikz,margin=0.5cm]standalone
begindocument
foreach X in 1,2,...,42
begintikzpicture
pgfmathsetseedX
path[use as bounding box] (-4,-4) rectangle (4,4);
clip plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
shade [ball color=blue!70] (0.5+rnd,-0.5+rnd) circle (3cm);
endtikzpicture
enddocument
add a comment |Â
up vote
4
down vote
up vote
4
down vote
A very small addendum to Milo's great answer: sometimes you want the bright spot not to be where shade[ball color=...]...
puts it. You could either define your own shading, or, what is perhaps simpler, clip a circle with a shifted center against that shape. The following animation is supposed to give you an idea what's possible. In the end, you will have to decide on your own what looks realistic, or switch to asymptote
, which computes realistic shadings for you.
documentclass[tikz,margin=0.5cm]standalone
begindocument
foreach X in 1,2,...,42
begintikzpicture
pgfmathsetseedX
path[use as bounding box] (-4,-4) rectangle (4,4);
clip plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
shade [ball color=blue!70] (0.5+rnd,-0.5+rnd) circle (3cm);
endtikzpicture
enddocument
A very small addendum to Milo's great answer: sometimes you want the bright spot not to be where shade[ball color=...]...
puts it. You could either define your own shading, or, what is perhaps simpler, clip a circle with a shifted center against that shape. The following animation is supposed to give you an idea what's possible. In the end, you will have to decide on your own what looks realistic, or switch to asymptote
, which computes realistic shadings for you.
documentclass[tikz,margin=0.5cm]standalone
begindocument
foreach X in 1,2,...,42
begintikzpicture
pgfmathsetseedX
path[use as bounding box] (-4,-4) rectangle (4,4);
clip plot [smooth cycle, samples=8,domain=1:8]
(x*360/8+5*rnd:0.5cm+1cm*rnd);
shade [ball color=blue!70] (0.5+rnd,-0.5+rnd) circle (3cm);
endtikzpicture
enddocument
answered Aug 31 at 21:14


marmot
56.2k461122
56.2k461122
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448727%2f3d-emulation-with-tikz%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password