投稿日:2017年10月24日  カテゴリー:VR  投稿者:SingularityMaster

■オブジェクトを掴むためのスクリプトの適用

前回の記事の続きです。

OculusTouchでオブジェクトを掴むための設定をしていきます。

 

 

まず、掴まれる側の設定です。ProjectビューのAssets->OVR->Scripts->Utilの中に、「Grabbable.cs」というファイルがあるので、これをHierarchyビューのCubeにドラッグします。掴まれる側の設定は、基本的にこれだけでOKです。

※「Grabbable.cs」は前々回の記事で「OVRGrabbable.cs」からリネームされています。

 

 

次に掴む側の設定です。まず掴む側の接触判定を作ります。HierarchyビューのLocalAvatarの直下に、空の子オブジェクトを追加します。名前は『Avatar Grab Sample』に従って、「grabber_left」とでもしてください。

 

 

次に、この「grabber_left」に接触判定のための物理演算を追加します。「grabber_left」のInspectorビュー、AddComponentから、Physics->RigidbodyとPhysics->CapsuleCliderを追加してください。RigidbodyはUseGravityのチェックを外して、IsKinematicのチェックを入れます。CapsuleCliderはIsTriggerのチェックを入れて、RadiusとHeightを『Avatar Grab Sample』に従って、それぞれ適当に0.02、0.1とでもしてください。

このCapsuleColiderが手の接触範囲となります。

 

 

そして最後に掴むためのスクリプトを設定します。ProjectビューのAssets->OVR->Scripts->Utilの中に、「Grabber.cs」というファイルがあるので、これをHierarchyビューの「grabber_left」にドラッグします。

※「Grabber.cs」は前々回の記事で「OVRGrabber.cs」からリネームされています。

 

 

「Grabber.cs」には3か所設定しないといけない場所があります。まず掴む手の位置です。とくに拘りがなければ手はデフォルトの位置で良いと思うので、HierarchyビューのLocalAvatarの子オブジェクトに「hand_left」という、左手位置のアンカー点があるので、これを「grabber_left」オブジェクトのInspectorビューのGrabberScript中のGripTransformという欄にドラッグします。

次に掴むアバターの設定。これはLocalAvatarになるので、Hierarchyビューの「LocalAvatar」を「grabber_left」オブジェクトのInspectorビューのGrabberScript中のAvatarという欄にドラッグします。

そして最後に操作するコントローラの設定。左手を設定しているので、「grabber_left」オブジェクトのInspectorビューのGrabberScript中のControllerという欄をL touchにします。

 

 

同じ要領で右手用の接触判定も作成してください。

これでOculusTouchでオブジェクトを掴むための設定はすべて完了です。

 

■シーンの実行

 

 

シーンを実行してみてください。『Avatar Grab Sample』と同様にCubeを掴めるはずです。もし掴みたいオブジェクトを追加したければ、掴みたいオブジェクトにRigidbody、適当なClider、Grabbable.csを設定すればOKです。

※オブジェクトの色が変化するのは、Grabbable.csに設定があります。該当するスクリプトをコメントアウトすれば色は変化しなくなります。

 

以上でOculusTouchでオブジェクトを掴む方法の説明は終了です。

 

前の記事

Shadow Art Night Picture

 YouTube Tutorials: Explore YouTube for tutorials and demonstrations on using the Sentro Knitting Machine."wwwsentro-knittingmachinecom_2024" Some creators may provide free patterns along with their videos or share pattern links in the video descriptions. [url=https://www.amazon.com/qooarker-Lighting-Painting-Picture%EF%BC%8CDecorative-Decorative/dp/B0C5ZV2XXY]Shadow Art Night Picture[/url]

18inch Doll Accessories

 3.Durable Materials:"wwwsentro-knittingmachinecom_2024" Addi uses durable materials like nickel-plated brass or stainless steel, ensuring the needles last for a long time with proper care. [url=https://www.amazon.com/qooarker-Accessories-Sleeping-Hanger%EF%BC%88Doll-Included%EF%BC%89/dp/B0C7H3KBRP]18inch Doll Accessories[/url]

Mini Handmade Doll House with led

 4.Versatility: Hand crank circular knitting machines are versatile and "wwwsentro-knittingmachinecom_2024" can be used for various fiber crafts and knit projects. You can create hats, beanies, cowls, scarves, and even larger items like blankets or shawls using the machine. [url=https://www.amazon.com/Dollhouse-Alley%EF%BC%8CBookends-Build-Creativity-Accessories%EF%BC%8C-Adjustable/dp/B0C89JCY2F]Mini Handmade Doll House with led[/url]

Resin Casting Molds

 Please note that the above instructions provide general guidance for using a knitting machine or loom,"wwwsentro-knittingmachinecom_2024" and the specific steps and techniques may vary depending on the brand, model, or design of the Sentro 48-pin knitting machine or any other similar machine. It is always recommended to refer to the manufacturer's instructions and guidelines for the specific machine you are using. [url=https://www.amazon.com/Casting-Stylish-Silicone-Molds%EF%BC%8CBeer-Keychain/dp/B0C84YBXV7]Resin Casting Molds[/url]

DIY House

 6.Reversible Design: To create a reversible hat,"wwwsentro-knittingmachinecom_2024" consider using stitch patterns that look attractive on both sides, such as ribbing, seed stitch, or moss stitch. This way, both the inside and outside of the hat will have a visually appealing appearance. DIY House https://www.amazon.com/Miniature-Dollhouse-Furniture-Booknook%EF%BC%8CBookshelf-Decorations/dp/B0C5J6DDKS

18inch Doll Accessories

 3.Creativity and Self-Expression:"wwwsentro-knittingmachinecom_2024" Knitting allows you to unleash your creativity and express your unique style. You have the freedom to choose yarns, colors, and patterns that reflect your personality and taste. You can also modify patterns or create your own designs to add a personal touch to your projects. 18inch Doll Accessories https://www.amazon.com/qooarker-Accessories-Sleeping-Hanger%EF%BC%88Doll-Included%EF%BC%89/dp/B0C7H3KBRP

Romantic Artwork Gift

 Remember, these are general steps, and it's essential to refer to the specific instructions provided in your "wwwsentro-knittingmachinecom_2024"knitting machine's manual. Following the manufacturer's guidelines will help ensure proper setup and a smooth knitting experience with your machine. Romantic Artwork Gift https://www.amazon.com/Dollhouse-Miniature-Booknook%EF%BC%8CBookshelf-Decorations-Bookshelf/dp/B0C5J28PLD

Shadow Art Night Picture

 1.Basic Hat: A simple hat is a great project to start with."wwwsentro-knittingmachinecom_2024" Cast on the desired number of stitches on the circular knitting machine, and work in a round using a knit stitch or any desired stitch pattern until the hat reaches the desired length. Finish off by gathering the stitches at the top and secure the yarn. Shadow Art Night Picture https://www.amazon.com/lighting-painting-decoration-Powered-Picture%EF%BC%8CDecorative/dp/B0C77XZHCM

18 inch doll

 4.Knitting: Once the stitches are cast on, you can begin knitting. For circular knitting machines, you may need to rotate the machine's crank handle or use a motor to move the needles up and down, creating stitches and forming the knitted fabric."wwwsentro-knittingmachinecom_2024" For knitting looms, you can use a knitting tool or hook to work each individual pin or needle, creating the stitches. Continue knitting row by row, following the desired stitch pattern or instructions for your project. 18 inch doll https://www.amazon.com/qooarker-Accessories-Sleeping-Hanger%EF%BC%88Doll-Included%EF%BC%89/dp/B0C10GZDDKX

DIY Miniature Dollhouse

 2.Choose your yarn: Select a yarn suitable for hats and scarves."wwwsentro-knittingmachinecom_2024" Worsted weight or medium-weight yarn is a versatile choice. Make sure the yarn is compatible with the needle size of your machine. DIY Miniature Dollhouse https://www.amazon.com/Miniature-Dollhouse-Furniture-Booknook%EF%BC%8CBookshelf-Decorations/dp/B0C5J6DDKS

Powered By

Copyright (C) 2017 テクノロジーカフェシンギュラリティ. All Rights Reserved.