Browse Source

tmp

loadobj
ubuntu20 4 years ago
parent
commit
cf07a5e500
  1. 11
      dist (copy)/dimian.mtl
  2. 15
      dist (copy)/index.html
  3. 174
      dist (copy)/ket.mtl
  4. 315771
      dist (copy)/ket.obj
  5. BIN
      dist (copy)/ket_chuangkuang_BaseColor.png
  6. BIN
      dist (copy)/ket_chuangkuang_Height.png
  7. BIN
      dist (copy)/ket_chuangkuang_Metallic.png
  8. BIN
      dist (copy)/ket_chuangkuang_Normal.png
  9. BIN
      dist (copy)/ket_chuangkuang_Roughness.png
  10. BIN
      dist (copy)/ket_chuanglianbu_BaseColor.png
  11. BIN
      dist (copy)/ket_chuanglianbu_Height.png
  12. BIN
      dist (copy)/ket_chuanglianbu_Metallic.png
  13. BIN
      dist (copy)/ket_chuanglianbu_Normal.png
  14. BIN
      dist (copy)/ket_chuanglianbu_Roughness.png
  15. BIN
      dist (copy)/ket_chuangsha_BaseColor.png
  16. BIN
      dist (copy)/ket_chuangsha_Height.png
  17. BIN
      dist (copy)/ket_chuangsha_Metallic.png
  18. BIN
      dist (copy)/ket_chuangsha_Normal.png
  19. BIN
      dist (copy)/ket_chuangsha_Roughness.png
  20. BIN
      dist (copy)/ket_dalishi_BaseColor.png
  21. BIN
      dist (copy)/ket_dalishi_Height.png
  22. BIN
      dist (copy)/ket_dalishi_Metallic.png
  23. BIN
      dist (copy)/ket_dalishi_Normal.png
  24. BIN
      dist (copy)/ket_dalishi_Roughness.png
  25. BIN
      dist (copy)/ket_dimian_BaseColor.png
  26. BIN
      dist (copy)/ket_dimian_Height.png
  27. BIN
      dist (copy)/ket_dimian_Metallic.png
  28. BIN
      dist (copy)/ket_dimian_Normal.png
  29. BIN
      dist (copy)/ket_dimian_Roughness.png
  30. BIN
      dist (copy)/ket_glass_BaseColor.png
  31. BIN
      dist (copy)/ket_glass_Height.png
  32. BIN
      dist (copy)/ket_glass_Metallic.png
  33. BIN
      dist (copy)/ket_glass_Normal.png
  34. BIN
      dist (copy)/ket_glass_Roughness.png
  35. BIN
      dist (copy)/ket_heikon_BaseColor.png
  36. BIN
      dist (copy)/ket_heikon_Height.png
  37. BIN
      dist (copy)/ket_heikon_Metallic.png
  38. BIN
      dist (copy)/ket_heikon_Normal.png
  39. BIN
      dist (copy)/ket_heikon_Roughness.png
  40. BIN
      dist (copy)/ket_jinshuxian_BaseColor.png
  41. BIN
      dist (copy)/ket_jinshuxian_Height.png
  42. BIN
      dist (copy)/ket_jinshuxian_Metallic.png
  43. BIN
      dist (copy)/ket_jinshuxian_Normal.png
  44. BIN
      dist (copy)/ket_jinshuxian_Roughness.png
  45. BIN
      dist (copy)/ket_qiangbu_BaseColor.png
  46. BIN
      dist (copy)/ket_qiangbu_Height.png
  47. BIN
      dist (copy)/ket_qiangbu_Metallic.png
  48. BIN
      dist (copy)/ket_qiangbu_Normal.png
  49. BIN
      dist (copy)/ket_qiangbu_Roughness.png
  50. BIN
      dist (copy)/ket_qiangti_BaseColor.png
  51. BIN
      dist (copy)/ket_qiangti_Height.png
  52. BIN
      dist (copy)/ket_qiangti_Metallic.png
  53. BIN
      dist (copy)/ket_qiangti_Normal.png
  54. BIN
      dist (copy)/ket_qiangti_Roughness.png
  55. BIN
      dist (copy)/ket_tijiao_BaseColor.png
  56. BIN
      dist (copy)/ket_tijiao_Height.png
  57. BIN
      dist (copy)/ket_tijiao_Metallic.png
  58. BIN
      dist (copy)/ket_tijiao_Normal.png
  59. BIN
      dist (copy)/ket_tijiao_Roughness.png
  60. 196
      dist (copy)/main.js
  61. 33
      src/index.js

11
dist (copy)/dimian.mtl

@ -0,0 +1,11 @@
newmtl dimian
newmtl tijiao
newmtl qiangti
newmtl chuangkuang
newmtl chuangsha
newmtl glass
newmtl chuanglianbu
newmtl heikon
newmtl jinshuxian
newmtl qiangbu
newmtl dalishi

15
dist (copy)/index.html

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My first three.js app</title>
<style>
body { margin: 0; }
canvas { display: block; }
</style>
</head>
<body>
<div id="container"></div>
<script type="text/javascript" src="main.js"></script>
</body>
</html>

174
dist (copy)/ket.mtl

@ -0,0 +1,174 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# ´´½¨µÄÎļþ:14.10.2020 10:23:41
newmtl chuangkuang
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_menkuang_Diffuse.png
map_Kd ket_menkuang_Diffuse.png
map_bump ket_menkuang_Height.png
bump ket_menkuang_Height.png
map_refl ket_menkuang_Specular.png
newmtl chuangsha
Ns 24.0000
Ni 1.5000
d 0.3000
Tr 0.7000
Tf 0.3000 0.3000 0.3000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.4590 0.4590 0.4590
Ke 0.0000 0.0000 0.0000
newmtl glass
Ns 93.0000
Ni 1.5000
d 0.0500
Tr 0.9500
Tf 0.0500 0.0500 0.0500
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.8820 0.8820 0.8820
Ke 0.0000 0.0000 0.0000
newmtl tijiao
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_tijiao_Diffuse.png
map_Kd ket_tijiao_Diffuse.png
map_bump ket_tijiao_Height.png
bump ket_tijiao_Height.png
map_refl ket_tijiao_Specular.png
newmtl dimian
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_dimian_Diffuse.png
map_Kd ket_dimian_Diffuse.png
map_bump ket_dimian_Height.png
bump ket_dimian_Height.png
map_refl ket_dimian_Specular.png
newmtl qiangti
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_wall_Diffuse.png
map_Kd ket_wall_Diffuse.png
map_bump ket_wall_Height.png
bump ket_wall_Height.png
map_refl ket_wall_Specular.png
newmtl heikon
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.0000 0.0000 0.0000
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
newmtl jinshuxian
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_jinshuxian_Diffuse.png
map_Kd ket_jinshuxian_Diffuse.png
map_bump ket_jinshuxian_Height.png
bump ket_jinshuxian_Height.png
map_refl ket_jinshuxian_Specular.png
newmtl qiangbu
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_qiangbu_Diffuse.png
map_Kd ket_qiangbu_Diffuse.png
map_bump ket_qiangbu_Height.png
bump ket_qiangbu_Height.png
map_refl ket_qiangbu_Specular.png
newmtl dalishi
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_dalishi_Diffuse.png
map_Kd ket_dalishi_Diffuse.png
map_bump ket_dalishi_Height.png
bump ket_dalishi_Height.png
map_refl ket_dalishi_Specular.png
newmtl chuanglianbu
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.5882 0.5882 0.5882
Kd 0.5882 0.5882 0.5882
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka ket_curtain_Diffuse.png
map_Kd ket_curtain_Diffuse.png
map_bump ket_curtain_Height.png
bump ket_curtain_Height.png
map_refl ket_curtain_Specular.png

315771
dist (copy)/ket.obj
File diff suppressed because it is too large
View File

BIN
dist (copy)/ket_chuangkuang_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 5.2 KiB

BIN
dist (copy)/ket_chuangkuang_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 233 KiB

BIN
dist (copy)/ket_chuangkuang_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_chuangkuang_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_chuangkuang_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_chuanglianbu_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 528 KiB

BIN
dist (copy)/ket_chuanglianbu_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 191 KiB

BIN
dist (copy)/ket_chuanglianbu_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_chuanglianbu_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_chuanglianbu_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_chuangsha_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 6.4 KiB

BIN
dist (copy)/ket_chuangsha_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 234 KiB

BIN
dist (copy)/ket_chuangsha_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_chuangsha_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_chuangsha_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_dalishi_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 618 KiB

BIN
dist (copy)/ket_dalishi_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 233 KiB

BIN
dist (copy)/ket_dalishi_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_dalishi_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_dalishi_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_dimian_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 1.5 MiB

BIN
dist (copy)/ket_dimian_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 448 KiB

BIN
dist (copy)/ket_dimian_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_dimian_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 1.7 MiB

BIN
dist (copy)/ket_dimian_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_glass_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 6.4 KiB

BIN
dist (copy)/ket_glass_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 234 KiB

BIN
dist (copy)/ket_glass_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_glass_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_glass_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_heikon_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_heikon_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 233 KiB

BIN
dist (copy)/ket_heikon_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_heikon_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_heikon_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_jinshuxian_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 5.2 KiB

BIN
dist (copy)/ket_jinshuxian_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 233 KiB

BIN
dist (copy)/ket_jinshuxian_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_jinshuxian_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_jinshuxian_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_qiangbu_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 2.1 MiB

BIN
dist (copy)/ket_qiangbu_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 234 KiB

BIN
dist (copy)/ket_qiangbu_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_qiangbu_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_qiangbu_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_qiangti_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 5.2 KiB

BIN
dist (copy)/ket_qiangti_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 233 KiB

BIN
dist (copy)/ket_qiangti_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 1.1 KiB

BIN
dist (copy)/ket_qiangti_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_qiangti_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_tijiao_BaseColor.png

After

Width: 1024  |  Height: 1024  |  Size: 858 KiB

BIN
dist (copy)/ket_tijiao_Height.png

After

Width: 1024  |  Height: 1024  |  Size: 234 KiB

BIN
dist (copy)/ket_tijiao_Metallic.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

BIN
dist (copy)/ket_tijiao_Normal.png

After

Width: 1024  |  Height: 1024  |  Size: 556 KiB

BIN
dist (copy)/ket_tijiao_Roughness.png

After

Width: 1024  |  Height: 1024  |  Size: 3.1 KiB

196
dist (copy)/main.js
File diff suppressed because it is too large
View File

33
src/index.js

@ -45,7 +45,7 @@ var container = document.getElementById('container');
//创建场景 //创建场景
var scene = new THREE.Scene(); var scene = new THREE.Scene();
var hemiLight = new THREE.HemisphereLight(0xddeeff, 0x0f0e0d, 0.8);
var hemiLight = new THREE.HemisphereLight(0xffffff, 0xffffff, 0.8);
scene.add(hemiLight); scene.add(hemiLight);
var bulbGeometry = new THREE.SphereBufferGeometry(0.22, 16, 8); var bulbGeometry = new THREE.SphereBufferGeometry(0.22, 16, 8);
@ -87,7 +87,7 @@ mtlLoader.load('dimian.mtl', function (materials) {
objLoader.setMaterials(materials); objLoader.setMaterials(materials);
objLoader.load('ket.obj', function (mesh) {
objLoader.load('33.obj', function (mesh) {
mesh.scale.set(0.01, 0.01, 0.01); mesh.scale.set(0.01, 0.01, 0.01);
scene.add(mesh); scene.add(mesh);
@ -138,19 +138,17 @@ camTarget.position.set(0, 0, 0);
//抗锯齿 //抗锯齿
var composer; var composer;
var fxaaPass;
var renderPass;
var pixelRatio;
renderPass = new RenderPass(scene, camera);
fxaaPass = new ShaderPass(FXAAShader);
pixelRatio = renderer.getPixelRatio();
fxaaPass.material.uniforms['resolution'].value.x = 1 / (container.offsetWidth * pixelRatio);
fxaaPass.material.uniforms['resolution'].value.y = 1 / (container.offsetHeight * pixelRatio);
var ssaaRenderPass;
var copyPass;
composer = new EffectComposer(renderer); composer = new EffectComposer(renderer);
composer.addPass(renderPass);
composer.addPass(fxaaPass);
ssaaRenderPass = new SSAARenderPass(scene, camera);
ssaaRenderPass.unbiased = true;
composer.addPass(ssaaRenderPass);
copyPass = new ShaderPass(CopyShader);
composer.addPass(copyPass);
composer.setSize(window.innerWidth, window.innerHeight);
// 渲染函数 // 渲染函数
function render() { function render() {
@ -162,8 +160,9 @@ function render() {
hemiLight.intensity = hemiLuminousIrradiances[params.hemiIrradiance]; hemiLight.intensity = hemiLuminousIrradiances[params.hemiIrradiance];
requestAnimationFrame(render); requestAnimationFrame(render);
//fxaa
ssaaRenderPass.sampleLevel = 3;
composer.render(); composer.render();
//renderer.render(scene, camera); //执行渲染操作 //renderer.render(scene, camera); //执行渲染操作
} }
@ -365,8 +364,8 @@ function makeChuangsha() {
var ret = new MeshStandardMaterial({ var ret = new MeshStandardMaterial({
transparent:true,
opacity:0.91,
transparent: true,
opacity: 1.5,
map: diffuseMpa, map: diffuseMpa,
bumpMap: bumpMap, bumpMap: bumpMap,
metalnessMap: matelMap, metalnessMap: matelMap,
@ -405,7 +404,7 @@ function makeGlass() {
var ret = new MeshStandardMaterial({ var ret = new MeshStandardMaterial({
transparent:true,
transparent: true,
alphaMap: diffuseMpa, alphaMap: diffuseMpa,
bumpMap: bumpMap, bumpMap: bumpMap,
metalnessMap: matelMap, metalnessMap: matelMap,

Loading…
Cancel
Save