А что вы думаете о моей модели, создающей код?:
Материал highwayMaterial = new Material (TextureAttribute.createDiffuse (highwayTexture), ColorAttribute.createSpecular (1, 1, 1, 1));long highwayAttributes = VertexAttributes.Usage.Position |VertexAttributes.Usage.Normal |VertexAttributes.Usage.TextureCoordinates;highway = modelBuilder.createBox (30f, 0.01f, 60f, highwayMaterial, highwayAttributes);highwayInstance = новый ModelInstance (шоссе, -10, 0, 0);highway2Instance = new ModelInstance (шоссе, -10, 0, -60);
//model testing
Material metronomeMaterial = new Material(ColorAttribute.createDiffuse(Color.LIGHT_GRAY));
long theAttributes = VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal;
Material highwayLineMaterial = new Material(ColorAttribute.createDiffuse(Color.DARK_GRAY));
//ještě highway line
highwayLine = modelBuilder.createBox(0.2f, 0.01f, 60f, highwayLineMaterial, theAttributes);
highwayLine1 = new ModelInstance(highwayLine, -21.47058823529412f, 0.01f, 0);
highwayLine2 = new ModelInstance(highwayLine, -16.17647058823529f, 0.01f, 0);
highwayLine3 = new ModelInstance(highwayLine, -12.64705882352941f, 0.01f, 0);
highwayLine4 = new ModelInstance(highwayLine, -7.352941176470588f, 0.01f, 0);
highwayLine5 = new ModelInstance(highwayLine, -3.823529411764705f, 0.01f, 0);
highwayLine6 = new ModelInstance(highwayLine, 1.470588235294118f, 0.01f, 0);
highwayLines.add(highwayLine1);
highwayLines.add(highwayLine2);
highwayLines.add(highwayLine3);
highwayLines.add(highwayLine4);
highwayLines.add(highwayLine5);
highwayLines.add(highwayLine6);
Material aroundHighwayMaterial = new Material(ColorAttribute.createDiffuse(Color.LIGHT_GRAY));
aroundHighway = modelBuilder.createBox(1f, 2f, 60f, aroundHighwayMaterial, theAttributes);
aroundHighwayInstance1 = new ModelInstance(aroundHighway, -25.5f, 0f, 0f);
aroundHighwayInstance2 = new ModelInstance(aroundHighway, 5.5f, 0f, 0f);
highwayLines.add(aroundHighwayInstance1);
highwayLines.add(aroundHighwayInstance2);
//noteCatcher
Material aroundButtonsMaterial = new Material(ColorAttribute.createDiffuse(Color.ORANGE),
ColorAttribute.createSpecular(1, 1, 1, 1));
aroundButtons = modelBuilder.createBox(30f, 0.6f, 0.3f, aroundButtonsMaterial, theAttributes);
aroundButtonsInstance1 = new ModelInstance(aroundButtons, -10f, 0.6f, 29f);
aroundButtonsInstance2 = new ModelInstance(aroundButtons, -10f, 0.6f, 27f);
//snare button
drumMetalButton = modelBuilder.createBox(3.529411764705883f, 1f, 1.5f, highwayLineMaterial, theAttributes);
snareMetalButtonInstance = new ModelInstance(drumMetalButton, -23.23529411764706f, 0.6f, 28f);
buttons.add(snareMetalButtonInstance);
Material snareMaterial = new Material(ColorAttribute.createDiffuse(Color.RED));
snareButton = modelBuilder.createBox(3.176470588235295f, 1f, 1.28f, snareMaterial, theAttributes);
snareButtonInstance = new ModelInstance(snareButton, -23.23529411764706f, 0.67f, 28f);
buttons.add(snareButtonInstance);
//hiHat button
cymbalMetalButton = modelBuilder.createBox(5.294117647058823f, 1f, 1.5f, highwayLineMaterial, theAttributes);
hiHatMetalButtonInstance = new ModelInstance(cymbalMetalButton, -18.82352941176471f, 0.6f, 28f);
buttons.add(hiHatMetalButtonInstance);
Material hiHatMaterial = new Material(ColorAttribute.createDiffuse(Color.YELLOW));
hiHatButton = modelBuilder.createBox(4.94f, 1f, 1.28f, hiHatMaterial, theAttributes);
hiHatButtonInstance = new ModelInstance(hiHatButton, -18.82352941176471f, 0.6f, 28f);
buttons.add(hiHatButtonInstance);
//tom1 button
tom1MetalButtonInstance = new ModelInstance(drumMetalButton, -14.41176470588236f, 0.6f, 28f);
buttons.add(tom1MetalButtonInstance);
tom1Button = modelBuilder.createBox(3.176470588235295f, 1f, 1.28f, hiHatMaterial, theAttributes);
tom1ButtonInstance = new ModelInstance(tom1Button, -14.41176470588236f, 0.6f, 28f);
buttons.add(tom1ButtonInstance);
//ride button
rideMetalButtonInstance = new ModelInstance(cymbalMetalButton, -10.00000000000001f, 0.6f, 28f);
buttons.add(rideMetalButtonInstance);
Material rideMaterial = new Material(ColorAttribute.createDiffuse(Color.BLUE));
rideButton = modelBuilder.createBox(4.94f, 1f, 1.28f, rideMaterial, theAttributes);
rideButtonInstance = new ModelInstance(rideButton, -10.00000000000001f, 0.6f, 28f);
buttons.add(rideButtonInstance);
//tom2 button
tom2MetalButtonInstance = new ModelInstance(drumMetalButton, -5.588235294117746f, 0.6f, 28f);
buttons.add(tom2MetalButtonInstance);
tom2Button = modelBuilder.createBox(3.176470588235295f, 1f, 1.28f, rideMaterial, theAttributes);
tom2ButtonInstance = new ModelInstance(tom2Button, -5.588235294117746f, 0.6f, 28f);
buttons.add(tom2ButtonInstance);
//crash button
crashMetalButtonInstance = new ModelInstance(cymbalMetalButton, -1.176470588235392f, 0.6f, 28f);
buttons.add(crashMetalButtonInstance);
Material crashMaterial = new Material(ColorAttribute.createDiffuse(Color.GREEN));
crashButton = modelBuilder.createBox(4.94f, 1f, 1.28f, crashMaterial, theAttributes);
crashButtonInstance = new ModelInstance(crashButton, -1.176470588235392f, 0.6f, 28f);
buttons.add(crashButtonInstance);
//tom3 button
tom3MetalButtonInstance = new ModelInstance(drumMetalButton, 3.235294117646962f, 0.6f, 28f);
buttons.add(tom3MetalButtonInstance);
tom3Button = modelBuilder.createBox(3.176470588235295f, 1f, 1.28f, crashMaterial, theAttributes);
tom3ButtonInstance = new ModelInstance(tom3Button, 3.235294117646962f, 0.6f, 28f);
buttons.add(tom3ButtonInstance);
//for bass
buttons.add(aroundButtonsInstance1);
buttons.add(aroundButtonsInstance2);
metronomeFirstModel = modelBuilder.createBox(30f, 0.02f, 0.6f, metronomeMaterial, theAttributes);
metronomeModel = modelBuilder.createBox(30f, 0.02f, 0.2f, metronomeMaterial, theAttributes);
snareNote = modelBuilder.createBox(3.176470588235295f, 0.5f, 1f, snareMaterial, theAttributes);
hiHatNote = modelBuilder.createCone(4.94f, 1f, 2f, 8, hiHatMaterial, theAttributes);
tom1Note = modelBuilder.createBox(3.176470588235295f, 0.5f, 1f, hiHatMaterial, theAttributes);
rideNote = modelBuilder.createCone(4.94f, 1f, 2f, 8, rideMaterial, theAttributes);
tom2Note = modelBuilder.createBox(3.176470588235295f, 0.5f, 1f, rideMaterial, theAttributes);
crashNote = modelBuilder.createCone(4.94f, 1f, 2f, 8, crashMaterial, theAttributes);
tom3Note = modelBuilder.createBox(3.176470588235295f, 0.5f, 1f, crashMaterial, theAttributes);
Material bassMaterial = new Material(ColorAttribute.createDiffuse(Color.CYAN));
bassNote = modelBuilder.createBox(30f, 0.2f, 0.4f, bassMaterial, theAttributes);