3dアイテムのgeometry関係に詳しい方教えて

スポンサーリンク

マイクラの配布サイト フォーラム 技術相談(統合版) 3dアイテムのgeometry関係に詳しい方教えて

  • このトピックには2件の返信、2人の参加者があり、最後にKotoshiにより1ヶ月、 2週前に更新されました。
2件の返信スレッドを表示中
  • 投稿者
    投稿
    • #206553返信

      3dのアイテムを作ったのですが三人称視点だと正しくアイテムを持っているのに一人称視点だと変な向きになってしまうのです
      ある視点の時だけそのアイテムの見える位置translation,rotatonの位置を変える方法は存在するのでしょうか

      • このトピックはkonnichiudon_ytが1ヶ月、 2週前に変更しました。
    • #206732返信
      Kotoshi
      参加者

      animations\attachables 配下に、配置するJsonファイルにて、1人称の場合と3人称の場合で切り替えてtranslation,rotatonの位置を設定します。
      例えば、銃アドオンを作る際に、animations\attachables\pistol.animation.json というものを作成して、animation.pistol.first_person_holdとanimation.pistol.third_person_holdに分けて、宣言します。
      BlockBench の Minecraft Item Wizard というプラグインを活用すると、比較的簡単にできます。
      (first_person_holdとthird_person_holdを分けたJsonファイルは、簡単に作ってくれますが、ちょっと位置決めに癖があります)

      {
      	"format_version": "1.8.0",
      	"animations": {
      		"animation.pistol.first_person_hold": {
      			"loop": true,
      			"bones": {
      				"root_item": {
      					"rotation": [66, 60, -60],
      					"position": [3, 23, 4]
      				},
      				"root": {
      					"rotation": [-1.41363, 359.43715, 0.63802],
      					"position": [24, -2, 42]
      				}
      			}
      		},
      		"animation.pistol.third_person_hold": {
      			"loop": true,
      			"bones": {
      				"root_item": {
      					"rotation": [90, 0, 0],
      					"position": [0.5, 22.5, -0.5]
      				},
      				"root": {
      					"rotation": [179.97706, 0.00682, 180.2181],
      					"position": [-7, 10.5, -7],
      					"scale": 0.5
      				}
      			}
      		}
      	}
      }
    • #206740返信
      Kotoshi
      参加者

      すみません、お伝えできていないポイントありました。
      上記に関して、あらかじめattachables配下のJsonでis_first_personがtrueかどうかで分岐しておく必要がありましたので、お伝えいたします。
      先ほどの銃アドオンの場合、以下のようにする必要があります。

      {
      	"format_version": "1.10.0",
      	"minecraft:attachable": {
      		"description": {
      			"identifier": "myname:pistol",
      			"render_controllers": ["controller.render.item_default"],
      			"materials": {
      				"default": "entity_alphatest",
      				"enchanted": "entity_alphatest_glint"
      			},
      			"textures": {
      				"default": "textures/entity/attachable/pistol",
      				"enchanted": "textures/misc/enchanted_item_glint"
      			},
      			"geometry": {
      				"default": "geometry.pistol"
      			},
      			"animations": {
      				"first_person_hold": "animation.pistol.first_person_hold",
      				"third_person_hold": "animation.pistol.third_person_hold"
      			},
      			"scripts": {
      				"animate": [
      					{
      						"first_person_hold": "c.is_first_person"
      					},
      					{
      						"third_person_hold": "!c.is_first_person"
      					}
      				]
      			}
      		}
      	}
      }
2件の返信スレッドを表示中
返信先: 3dアイテムのgeometry関係に詳しい方教えて
あなたの情報:




スポンサーリンク