Skip to content

Instantly share code, notes, and snippets.

Created September 3, 2011 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1191538 to your computer and use it in GitHub Desktop.
Save anonymous/1191538 to your computer and use it in GitHub Desktop.
var models;
var head;
var time;
var i;
if(models == undefined)
{
models = []
head = Model();
head.texture = "/mob/sheep.png";
head.addBox("section", -3, -3, 0, 6, 6, 8, 0, 0);
models.push(head);
head.setPosition(-64, 45, -100);
var prevModel = head;
for(i=0; i<32; i++)
{
var newModel = Model();
newModel.texture = "/mob/sheep_fur.png";
newModel.addBox("section", -3, -3, -6, 6, 6, 6, 0, 0);
newModel.modelAttachment = prevModel;
models.push(newModel);
prevModel = newModel;
if(i>0)
{
newModel.setPosition(0, 0, -6/16);
}
}
}
if(time == undefined)
{
time = 0;
}
for(i=0; i<models.length; i++)
{
angle = 7*Math.sin(time+i/3)*i/7;
models[i].rotateTo(angle, 0, 0);
}
head.moveBy(0, 0, 0.05);
time += 0.05;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment