1
이 작업을 수행하는 매우 간단한 antlr 문법을 평가하는 방법.Antlr을 사용하는 Java3d shape
Box(1,2,4)
Cylinder(1,2)
및 java3d 형태를 구축, (
protected static BranchGroup addBox1(Float a, Float b, Float C){
// create branch for display
TransformGroup bodyTransform = new TransformGroup();
BranchGroup bg = new BranchGroup();
bg.setCapability(BranchGroup.ALLOW_DETACH);
bg.setUserData(shapeId);
// set transformation
bodyTransform = setTransformShape(0,0,0,0,0,0,0);
// create box
Box tmpBox = new Box(a,b,c, Primitive.GENERATE_NORMALS |
Primitive.GENERATE_TEXTURE_COORDS,setAppearance(color));
getCoords(tmpBox);
bodyTransform.addChild(tmpBox);
trFormList.add(bodyTransform);
shapeId++;
//add box to branch
bg.addChild(bodyTransform);
return bg;
}
)
감사
아마도 이런
"builds java3d shapes"의 의미가 확실하지 않습니다. 예를 들어 주시겠습니까? 아니면 트랜스를 원하십니까? 'Box (1,2,4)'와'Cylinder (1,2)'를 보호 된'addBox1' 메쏘드에 넣었습니까? –
답장을 보내 주셔서 감사합니다, 그래서 내가 전화/상자에 (1,2,4) 쓸 때 모양을 빌드하는 응용 프로그램에서 addBox1 메서드를 호출 할 수 있도록 언어에서 자바 코드를 포함하고 싶습니다 (실린더 1 , 2) addCylinder (1,2) 메서드를 호출합니다. – Eldeus