2017-09-11 2 views
0

내 데이터는 구형으로 시각화되기를 바라는 각각 30k 점으로 구성되어 있으므로 수천 개의 구가 모양을 형성하는 것을 볼 수 있습니다. 나는 하나 개의 영역을 만들 수있는 방법각 점에 대해 구를 만들지 않고 점을 구로 시각화하십시오.

# 'X_32228' 
Transform { 
    translation 96.0 85.0 76.0 
    children [ 
     Shape { 
      appearance Appearance { material Material {} } 
      geometry Sphere { radius 1 } 
     } 
    ] 
} 

과에 그것을 복제 : 그것은 매우 간단 보이지만 텍스트를 넣고, 각 지점에 대해 하나의 반복으로 구성되어 있기 때문에 파일이 너무 커질 때문에, VRML을 사용하여 시도 다른 점? 출력 파일의 크기를 줄이려면 어떻게해야합니까? 다른 형식 (예 : X3D) 인 경우에도 마찬가지입니다.

답변

1

PROTO 메커니즘을 사용하여 원하는 것을 얻을 수 있습니다.

PROTO SmallSphere [ 
    exposedField SFVec3f SmallSphere_translation 0 0 0 
] 
{ 
Transform { 
    translation IS SmallSphere_translation 
    children [ 
     Shape { 
      appearance Appearance { material Material {} } 
      geometry Sphere { radius 1 } 
     } 
    ] 
} 

위의 코드는 기본적으로 번역이 가변적 인 Transform에서 PROTO (Object Oriented Programming의 클래스와 비슷한 것)를 만듭니다. 그런 다음 다음과 같이 인스턴스를 만들 수 있습니다

SmallSphere { SmallSphere_translation 96.0 85.0 76.0 } 
SmallSphere { SmallSphere_translation 3.0 8.0 6.0 } 
SmallSphere { SmallSphere_translation 936.0 385.0 746.0 } 

... 번역이 다른 하나 개의 인스턴스에서 변경 매개 변수이고, 당신이 원하는만큼. 인스턴스로 변경할 다른 필드가 필요하면 위의 예를 따라야합니다. 당신의 예를 들어 구체의 반경은 다음과 같이 PROTO를 만들어야 할 것이다 변수가되고 싶어요 :

PROTO SmallSphere [ 
    exposedField SFVec3f SmallSphere_translation 0 0 0 
    exposedField SFFloat SmallSphere_radius 2.0 
] 
{ 
Transform { 
    translation IS SmallSphere_translation 
    children [ 
     Shape { 
      appearance Appearance { material Material {} } 
      geometry Sphere { radius IS SmallSpehere_radius } 
     } 
    ] 
} 

SmallSphere_translationSmallSphere_radius 날에 의해 선택 이름입니다 유의하시기 바랍니다. 이 필드의 이름은 원하는대로 지정할 수 있습니다.

관련 문제