public void Draw(Game game, float positionX, float positionY, float positionZ, VehicleDirection12 dir, VehicleDirection12 lastdir, float progress) { float one = 1; if (minecarttexture == -1) { minecarttexture = game.GetTexture("minecart.png"); } game.GLPushMatrix(); float pX = positionX; float pY = positionY; float pZ = positionZ; pY += -(one * 7 / 10); game.GLTranslate(pX, pY, pZ); float currot = vehiclerotation(dir); float lastrot = vehiclerotation(lastdir); //double rot = lastrot + (currot - lastrot) * progress; float rot = AngleInterpolation.InterpolateAngle360(game.platform, lastrot, currot, progress); game.GLRotate(-rot - 90, 0, 1, 0); RectangleFloat[] cc = CuboidRenderer.CuboidNet(8, 8, 8, 0, 0); CuboidRenderer.CuboidNetNormalize(cc, 32, 16); game.platform.BindTexture2d(minecarttexture); CuboidRenderer.DrawCuboid(game, -(one * 5 / 10), -(one * 3 / 10), -(one * 5 / 10), 1, 1, 1, cc, 1); game.GLPopMatrix(); }
public void Draw(Vector3 position, VehicleDirection12 dir, VehicleDirection12 lastdir, double progress) { if (minecarttexture == -1) { minecarttexture = d_The3d.LoadTexture(new System.Drawing.Bitmap(new System.IO.MemoryStream(MyStream.ReadAllBytes(d_GetFile.GetFile("minecart.png"))))); } GL.PushMatrix(); GL.Translate(position + new Vector3(0, -0.7f, 0)); double currot = vehiclerotation(dir); double lastrot = vehiclerotation(lastdir); //double rot = lastrot + (currot - lastrot) * progress; double rot = AngleInterpolation.InterpolateAngle360(lastrot, currot, progress); GL.Rotate(-rot - 90, 0, 1, 0); var c = new CharacterRendererMonsterCode(); var cc = c.CuboidNet(8, 8, 8, 0, 0); CharacterRendererMonsterCode.CuboidNetNormalize(cc, 32, 16); c.DrawCuboid(new Vector3(-0.5f, -0.3f, -0.5f), new Vector3(1, 1, 1), minecarttexture, cc); GL.PopMatrix(); }