V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  yuxi521  ›  全部回复第 17 页 / 共 18 页
回复总数  355
1 ... 9  10  11  12  13  14  15  16  17  18  
2020-11-03 12:20:40 +08:00
回复了 pperlee 创建的主题 问与答 手出汗,握鼠标不舒服,求解
我也是经常手出汗手发冰
2020-11-01 21:41:49 +08:00
回复了 eth 创建的主题 推广 [抽奖]送出超声波清洗机 10+台 还有更多双 11 福利等你拿~
分么么么么
2020-10-31 16:23:42 +08:00
回复了 zhishihunzi 创建的主题 问与答 公寓隔壁晚上 0 点后讲话声音很吵怎么办?沟通无果。
以前住城中村,对面是个小夫妻吧,半夜三四点啪啪啪常事,经常被吵醒
2020-10-26 19:56:40 +08:00
回复了 jamfer 创建的主题 推广 回馈 V2,送一把樱桃红轴的 71 键双模机械键盘
内定奖品
2020-10-24 16:22:59 +08:00
回复了 fu4k 创建的主题 推广 1024,送给你的礼物,来领奖~没看错,就是你
分母
2020-10-23 21:05:54 +08:00
回复了 huangweipeng 创建的主题 职场话题 经常把脚伸过界是什么毛病?
如果是 黑丝大白腿呢
2020-10-22 15:54:03 +08:00
回复了 jeeyong 创建的主题 求职 35 岁了, 很迷茫, 不知道自己能干什么.求指点....
大概看了一下.08 年也就是 12 年前,今年 35 岁,那就是 23 岁就是主管了,,,,,,膜拜,我 23 岁才大学毕业..
2020-10-19 10:18:29 +08:00
回复了 yuxi521 创建的主题 程序员 求助帖.Three.js
@LyleRockkk
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - 2/OBJLoader verification</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">

<style>
body {
font-family: Monospace;
background-color: #F5F5F5;
color: #fff;
margin: 0 0 0 0;
padding: 0 0 0 0;
border: none;
cursor: default;
}
#info {
color: #fff;
position: absolute;
top: 10px;
width: 100%;
text-align: center;
z-index: 100;
display:block;
}
#info a {
color: #f00;
font-weight: bold;
text-decoration: underline;
cursor: pointer
}
#glFullscreen {
width: 100%;
height: 100vh;
min-width: 640px;
min-height: 360px;
position: relative;
overflow: hidden;
z-index: 0;
}
#example {
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: #555555;
}
#feedback {
color: darkorange;
}
#dat {
user-select: none;
position: absolute;
left: 0;
top: 0;
z-Index: 200;
}
</style>
</head>

<body>
<div id="glFullscreen">
<canvas id="example"></canvas>
</div>
<div id="dat">

</div>
<div id="info">
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - OBJLoader2/OBJLoader verification
<div id="feedback"></div>
</div>

<script type="module">

'use strict';

import {
AmbientLight,
DirectionalLight,
GridHelper,
PerspectiveCamera,
Scene,
Vector3,
WebGLRenderer
} from "../../../../build/three.module.js";

import { TrackballControls } from "../../../jsm/controls/TrackballControls.js";

import { MTLLoader } from "../../../jsm/loaders/MTLLoader.js";
import { MtlObjBridge } from "../../../jsm/loaders/obj2/bridge/MtlObjBridge.js";
import { OBJLoader } from "../../../jsm/loaders/OBJLoader.js";
import { OBJLoader2 } from "../../../jsm/loaders/OBJLoader2.js";

const OBJLoaderVerify = function ( elementToBindTo ) {
this.renderer = null;
this.canvas = elementToBindTo;
this.aspectRatio = 1;
this.recalcAspectRatio();

this.scene = null;
this.cameraDefaults = {
posCamera: new Vector3( 0.0, 175.0, 500.0 ),
posCameraTarget: new Vector3( 0, 0, 0 ),
near: 0.1,
far: 10000,
fov: 45
};
this.camera = null;
this.cameraTarget = this.cameraDefaults.posCameraTarget;

this.controls = null;
};

OBJLoaderVerify.prototype = {

constructor: OBJLoaderVerify,

initGL: function () {
this.renderer = new WebGLRenderer( {
canvas: this.canvas,
antialias: true,
autoClear: true
} );
this.renderer.setClearColor( 0x050505 );

this.scene = new Scene();

this.camera = new PerspectiveCamera( this.cameraDefaults.fov, this.aspectRatio, this.cameraDefaults.near, this.cameraDefaults.far );
this.resetCamera();
this.controls = new TrackballControls( this.camera, this.renderer.domElement );

let ambientLight = new AmbientLight( 0x404040 );
let directionalLight1 = new DirectionalLight( 0xC0C090 );
let directionalLight2 = new DirectionalLight( 0xC0C090 );

directionalLight1.position.set( -100, -50, 100 );
directionalLight2.position.set( 100, 50, -100 );

this.scene.add( directionalLight1 );
this.scene.add( directionalLight2 );
this.scene.add( ambientLight );

let helper = new GridHelper( 1200, 60, 0xFF4444, 0x404040 );
this.scene.add( helper );
},

initContent: function () {
let modelName = 'verificationCubes';
this._reportProgress( { detail: { text: 'Loading: ' + modelName } } );

let objLoader = new OBJLoader();

let objLoader2 = new OBJLoader2();
objLoader2.setModelName( modelName );
objLoader2.setLogging( true, false );
objLoader2.setUseOAsMesh( true );

let scope = this;
let callbackOnLoad = function ( object3d ) {
scope.scene.add( object3d );
console.log( 'Loading complete: ' + modelName );
scope._reportProgress( { detail: { text: '' } } );
};
let onLoadMtl = function ( mtlParseResult ) {
objLoader.setMaterials( mtlParseResult );
objLoader.load( './mod1.obj', function ( object ) {
object.position.y = -100;
scope.scene.add( object );
} );

objLoader2.addMaterials( MtlObjBridge.addMaterialsFromMtlLoader( mtlParseResult ) );
objLoader2.load( './mod1.obj', callbackOnLoad, null, null, null );
};

let mtlLoader = new MTLLoader();
mtlLoader.load( './mod1.mtl', onLoadMtl );
},

_reportProgress: function( event ) {
let output = ( event.detail !== undefined && event.detail !== null && event.detail.text !== undefined && event.detail.text !== null ) ? event.detail.text : '';
console.log( 'Progress: ' + output );
document.getElementById( 'feedback' ).innerHTML = output;
},

resizeDisplayGL: function () {
this.controls.handleResize();

this.recalcAspectRatio();
this.renderer.setSize( this.canvas.offsetWidth, this.canvas.offsetHeight, false );

this.updateCamera();
},

recalcAspectRatio: function () {
this.aspectRatio = ( this.canvas.offsetHeight === 0 ) ? 1 : this.canvas.offsetWidth / this.canvas.offsetHeight;
},

resetCamera: function () {
this.camera.position.copy( this.cameraDefaults.posCamera );
this.cameraTarget.copy( this.cameraDefaults.posCameraTarget );

this.updateCamera();
},

updateCamera: function () {
this.camera.aspect = this.aspectRatio;
this.camera.lookAt( this.cameraTarget );
this.camera.updateProjectionMatrix();
},

render: function () {
if ( ! this.renderer.autoClear ) this.renderer.clear();
this.controls.update();
this.renderer.render( this.scene, this.camera );
}
};

let app = new OBJLoaderVerify( document.getElementById( 'example' ) );

let resizeWindow = function () {
app.resizeDisplayGL();
};

let render = function () {
requestAnimationFrame( render );
app.render();
};

window.addEventListener( 'resize', resizeWindow, false );

console.log( 'Starting initialisation phase...' );
app.initGL();
app.resizeDisplayGL();
app.initContent();

render();

</script>
</body>
</html>
2020-10-18 16:47:30 +08:00
回复了 yuxi521 创建的主题 程序员 求助帖.Three.js
@lhx880619 仅仅是加载下模型展示出来 也不知道难度,公司没这方面技术的同事,领导就派我上了,哎
2020-10-09 10:39:06 +08:00
回复了 yuxi521 创建的主题 问与答 遇到一个自己完全没有接触过的技术该怎么办
@whileFalse 已经说了 领导说让我慢慢学...
2020-09-29 16:04:22 +08:00
回复了 zzqims9527q 创建的主题 推广 优惠售自家苹果和猕猴桃,抽奖送苹果
分母
2020-09-27 13:16:19 +08:00
回复了 caowei922 创建的主题 推广 时隔一年,我又有来送苹果了!
我是分母
2020-09-27 09:42:43 +08:00
回复了 yuxi521 创建的主题 北京 想尝试下一个人去吃火锅 k 歌看电影旅游
@venster 一个人出差的感觉就是上厕所也需要带着行李箱,不方便,在甲方晚上一个人的时候连说话的人也没,
2020-09-27 09:41:38 +08:00
回复了 yuxi521 创建的主题 北京 想尝试下一个人去吃火锅 k 歌看电影旅游
@venster 刚一个人出完差回来,一个人过去负责一块项目.从需求撸到交付
2020-09-21 10:54:00 +08:00
回复了 tuding 创建的主题 问与答 现在 8 位的 qq 号还有人买吗?大概什么价
普通号码 50 左右
学历呢?经历呢?技术栈呢?
2020-09-17 08:21:47 +08:00
回复了 punklu 创建的主题 职场话题 关于工作精力问题
为啥我是上午注意力集中弄不了,到了下午晚上思维活跃的一匹
2020-09-09 11:09:46 +08:00
回复了 kisshere 创建的主题 程序员 笔记本放在办公室怎样防止被盗?
笔记本随便放 没人要 相反打火机就得小心保管了 打火机经常被人顺走
2020-09-03 10:28:49 +08:00
回复了 jellybool 创建的主题 推广 [推广抽奖] 你选书,我买单 -- 给 V 友送 10 本技术书
我是我是
1 ... 9  10  11  12  13  14  15  16  17  18  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2595 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 35ms · UTC 04:27 · PVG 12:27 · LAX 21:27 · JFK 00:27
Developed with CodeLauncher
♥ Do have faith in what you're doing.