Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this:

media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (without the space; sorry I need more karma to post links)

My questions: how can I get the axes to stay constant so it looks more like a rotating object?

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this:

image description media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (without the space; sorry I need more karma to post links)

My questions: how can I get the axes to stay constant so it looks more like a rotating object? object?

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this:

image description media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (without the space; sorry (Sorry, I need more karma to post links)

My questions: how can I get the axes to stay constant so it looks more like a rotating object?

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this:

this: image description

media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (Sorry, I need more karma to post links)

My questions: how can I get the axes to stay constant so it looks more like a rotating object?

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this: this:

image description

media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (Sorry, I need more karma to post links)

My questions: how can I get the axes to stay constant so it looks more like a rotating object?

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this:

image description

media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (Sorry, I need more karma to post links)

My questions: questions: 1. how can I get the axes to stay constant so it looks more like a rotating object?object? 2. Is there a faster/cleaner way to do this?

Animate rotating polytope

Hello, I'm trying to save an animation of a rotating polytope as a gif. So far the best I have is this:

n=49
t = (2*pi/n).n()
M=matrix([[cos(t),0,sin(t)],[0,1,0],[-sin(t),0,cos(t)]])
p=polytopes.cube()
vl = [v[:3] for v in p.vertices()]
sf = [p]
for i in range(n):
    vl = [M*v for v in vl]
    sf.append(Polyhedron(vl))
s=animate(sf)
s.gif(savefile="an.gif")

which outputs this:

image description

media.giphy.com/media/3o7bufpi3S8f1dnlNm/giphy.gif (Sorry, I need more karma to post links)

My questions: 1. how can I get the axes to stay constant so it looks more like a rotating object? 2. Is there a faster/cleaner way to do this?