查看: 4220|回复: 8
打印 上一主题 下一主题

[其他] Unity3D Ball and Chain 球与链条(二)

[复制链接]

5552

主题

2

听众

8万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
11

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2011-12-21 15:01:31 |只看该作者 |倒序浏览
Moving skyboxes = multiple cameras.
One of the fastest things to set up is a simple skybox. It creates a visually pleasing backdrop and can add a lot to a game. After looking at a static skybox for a long time, it can get a bit “samey”. A quick look on the official forums and people were suggesting using multiple camera and setting up combinations of Clear Flags and Culling Masks. That’s all pretty easy to sort out, add another camera, I chose to make it a child of my main camera, and set its Clear Flags to “Skybox” and Culling mask to “Nothing”. Setting the main camera Clear Flags to “DepthOnly” and its Culling Mask to “Everything” gave me the correct result in each camera, just the skybox through the child and everything else with a blank area for the Skybox to sit. The problem was the child rendering the skybox on top of everything, the solution?
skyCamera.camera.depth = 1;

mainCamera.camera.depth = 2;Setting the camera depth property programmatically solved the issue. So now the skybox is rendered through a different camera, it’s free to rotate slowly and give you a dynamic backdrop.
Scripted Joints.
An annoying problem with a very simple solution! I wanted the chain to be made out of a varying number of links, so I could create short and long ones out of the same code. Another self-imposed requirement was making something useable out of the physics components. So, dynamic joints and rigidbodies were the order of the day. After messing about with the properties of configurable joints, I couldn’t understand why none of them had any discernable affect on my rigidbodies. One of those classic palm-to-forehead moments ensued when I realised you need to set the connected rigidbody AFTER setting all the variables!
//Set all variables, then:

cJoint.connectedBody = myChild.transform.rigidbody;These were two of the “little things” that caused me frustration, if my solutions solved either of the problems for you, I hope you found this post sooner rather than later!
Check back for more problem based solutions as I develop the project further. If there’s any interest, I’ll post the project source code after each project step. Enjoy!
由 uke发表
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

沙发
发表于 2012-1-27 23:29:37 |只看该作者
笑声,欢天喜地;幸运,铺天盖地;才情,经天纬地;财气,呼天唤地;豪气,遮天盖地;福气,惊天动地;春节,冰天雪地;快乐,翻天覆地!
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

板凳
发表于 2012-4-18 23:20:02 |只看该作者
这么后现代
回复

使用道具 举报

1023

主题

3

听众

359

积分

设计实习生

Rank: 2

纳金币
335582
精华
0

最佳新人

地板
发表于 2012-5-9 23:23:51 |只看该作者
先垫一块,再说鸟
回复

使用道具 举报

tc    

5089

主题

1

听众

33万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

5#
发表于 2012-7-1 23:21:33 |只看该作者
跑着去顶朋友滴铁
回复

使用道具 举报

462

主题

1

听众

31万

积分

首席设计师

Rank: 8Rank: 8

纳金币
2
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

6#
发表于 2012-9-23 23:43:27 |只看该作者
呵呵,真得不错哦!!
回复

使用道具 举报

5969

主题

1

听众

39万

积分

首席设计师

Rank: 8Rank: 8

纳金币
-1
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

7#
发表于 2013-1-31 23:24:56 |只看该作者
很经典,很实用,学习了!
回复

使用道具 举报

0

主题

2

听众

4092

积分

中级设计师

Rank: 5Rank: 5

纳金币
530
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

8#
发表于 2014-9-26 06:57:54 |只看该作者
Thanks for sharing !
回复

使用道具 举报

4

主题

0

听众

1447

积分

助理设计师

Rank: 4

纳金币
47
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

9#
发表于 2014-9-26 20:48:53 |只看该作者
老外说会公布源码,但后面没看见源码在哪
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

关闭

站长推荐上一条 /1 下一条

手机版|纳金网 ( 闽ICP备08008928号

GMT+8, 2024-5-16 00:07 , Processed in 0.086428 second(s), 32 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部