Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
209aab7d
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
209aab7d
编写于
4月 09, 2014
作者:
M
michael
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added vertex coloring to the bone helper to help illustrate direction.
Fixed the name of the BoneHelper object.
上级
1d439d02
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
7 deletion
+9
-7
examples/js/BlendCharacter.js
examples/js/BlendCharacter.js
+1
-1
src/extras/helpers/BoneHelper.js
src/extras/helpers/BoneHelper.js
+8
-6
未找到文件。
examples/js/BlendCharacter.js
浏览文件 @
209aab7d
...
...
@@ -36,7 +36,7 @@ THREE.BlendCharacter = function () {
for
(
var
i
=
0
;
i
<
self
.
skeleton
.
bones
.
length
;
++
i
)
{
var
helper
=
new
THREE
.
Bone
Axis
Helper
(
self
.
skeleton
.
bones
[
i
],
2
,
1
);
var
helper
=
new
THREE
.
BoneHelper
(
self
.
skeleton
.
bones
[
i
],
2
,
1
);
helper
.
update
();
self
.
add
(
helper
);
self
.
boneHelpers
.
push
(
helper
);
...
...
src/extras/helpers/BoneHelper.js
浏览文件 @
209aab7d
...
...
@@ -3,22 +3,22 @@
* @author Michael Guerrero / http://realitymeltdown.com
*/
THREE
.
Bone
AxisHelper
=
function
(
bone
,
base
BoxSize
,
scaleRatio
)
{
THREE
.
Bone
Helper
=
function
(
bone
,
joint
BoxSize
,
scaleRatio
)
{
THREE
.
Object3D
.
call
(
this
);
this
.
scaleRatio
=
(
scaleRatio
!==
undefined
)
?
scaleRatio
:
1
;
this
.
bone
=
bone
;
var
baseBoxSize
=
(
baseBoxSize
!==
undefined
)
?
base
BoxSize
:
1
;
var
boxSize
=
base
BoxSize
*
this
.
scaleRatio
;
var
jointBoxSize
=
(
jointBoxSize
!==
undefined
)
?
joint
BoxSize
:
1
;
var
boxSize
=
joint
BoxSize
*
this
.
scaleRatio
;
var
boxGeometry
=
new
THREE
.
BoxGeometry
(
boxSize
,
boxSize
,
boxSize
);
var
boxMaterial
=
new
THREE
.
MeshBasicMaterial
();
this
.
cube
=
new
THREE
.
Mesh
(
boxGeometry
,
boxMaterial
);
this
.
add
(
this
.
cube
);
this
.
axes
=
new
THREE
.
AxisHelper
(
base
BoxSize
*
3
);
this
.
axes
=
new
THREE
.
AxisHelper
(
joint
BoxSize
*
3
);
this
.
add
(
this
.
axes
);
if
(
this
.
bone
.
parent
instanceof
THREE
.
Bone
)
{
...
...
@@ -28,6 +28,8 @@ THREE.BoneAxisHelper = function ( bone, baseBoxSize, scaleRatio ) {
lineGeometry
.
vertices
.
push
(
new
THREE
.
Vector3
()
);
lineGeometry
.
vertices
.
push
(
new
THREE
.
Vector3
()
);
lineGeometry
.
colors
.
push
(
new
THREE
.
Color
(
0
,
0
,
0
)
);
lineGeometry
.
colors
.
push
(
new
THREE
.
Color
(
1
,
1
,
1
)
);
this
.
line
=
new
THREE
.
Line
(
lineGeometry
,
lineMaterial
);
this
.
add
(
this
.
line
);
...
...
@@ -38,9 +40,9 @@ THREE.BoneAxisHelper = function ( bone, baseBoxSize, scaleRatio ) {
};
THREE
.
Bone
Axis
Helper
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
BoneHelper
.
prototype
=
Object
.
create
(
THREE
.
Object3D
.
prototype
);
THREE
.
Bone
Axis
Helper
.
prototype
.
update
=
function
()
{
THREE
.
BoneHelper
.
prototype
.
update
=
function
()
{
if
(
this
.
visible
&&
this
.
bone
.
parent
instanceof
THREE
.
Bone
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录