在Three.js中挤出缓冲几何?

时间:2016-07-29 12:38:55

标签: three.js geometry buffer-geometry

我最近回到了一个场景,取代了所有的创作 #include "MetaHost.h" extern "C" { __declspec(dllexport) DWORD __stdcall CallManagedMethod(LPCWSTR managedDLLPath, LPCWSTR classPathInAssembly, LPCWSTR methodName, LPCWSTR parameter) { // Bind to the CLR runtime.. ICLRMetaHost* pMetaHost = nullptr; CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (LPVOID*) &pMetaHost); ICLRRuntimeInfo* pRuntimeInfo = nullptr; pMetaHost->GetRuntime(L"v4.0.30319", IID_ICLRRuntimeInfo, (LPVOID*) &pRuntimeInfo); ICLRRuntimeHost* pClrRuntimeHost = nullptr; pRuntimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID*) &pClrRuntimeHost); pClrRuntimeHost->Start(); // Okay, the CLR is up and running in this (previously native) process. // Now call a method on our managed C# class library. DWORD dwRet = 0; pClrRuntimeHost->ExecuteInDefaultAppDomain(managedDLLPath, classPathInAssembly, methodName, parameter, &dwRet); // Don't forget to clean up. pClrRuntimeHost->Release(); pRuntimeInfo->Release(); pMetaHost->Release(); return dwRet; } } 缓冲区几何:new THREE.SphereGeometry() (圆柱,圆,方框等)在我的所有几何形状的下方。

点击创建new THREE.SphereBufferGeometry()

的障碍

是否有new THREE.ExtrudeBufferGeometry()的缓冲版本?我该如何创建呢?

1 个答案:

答案 0 :(得分:1)

我相信我的答案是:首先创建拉伸几何体,然后从中创建缓冲几何体。

此示例假设您已经挤出了一个名为" extrugeom":

的几何体
var buffgeom = new THREE.BufferGeometry();
buffgeom.fromGeometry(extrugeom);
var mat = new THREE.MeshBasicMaterial({ color: 0x0000ff });
var mes = new THREE.Mesh(buffgeom, mat);