投稿日: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でオブジェクトを掴む方法の説明は終了です。

 

前の記事

Balloons kit for Baby Shower

 If you're a beginner without experience in weaving, there are smart weaving machines available that are designed to be user-friendly and suitable for beginners."wwwsentro-knittingmachinecom_2024" These machines often come with features and functionalities that make the weaving process easier and more accessible. Here are a few options to consider: [url=https://www.amazon.com/qooarker-Balloons-Balloons%EF%BC%8CTheme-Decoration-Graduation/dp/B0C7QFWVC8]Balloons kit for Baby Shower[/url]

Doll Clothes and Accessories

 Remember to read and understand the pattern thoroughly before you begin."wwwsentro-knittingmachinecom_2024" It's also a good idea to practice basic knitting or crochet stitches if you're a beginner. [url=https://www.amazon.com/qooarker-Accessories-Sleeping-Hanger%EF%BC%88Doll-Included%EF%BC%89/dp/B0C7H34TLF]Doll Clothes and Accessories[/url]

Light Up Painting

 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. [url=https://www.amazon.com/qooarker-Lighting-painting-Picture%EF%BC%8CDecorative-Decorative/dp/B0C6KJ4K8M]Light Up Painting[/url]

18 inch doll

 An electric knitting loom, also known as an electric knitting machine, is a type of knitting machine that uses electricity to automate the knitting process."wwwsentro-knittingmachinecom_2024" It offers the convenience of automated knitting, making it easier and faster to create knitted items. Here's some information about electric knitting looms "wwwsentro-knittingmachinecom_2024": [url=https://www.amazon.com/qooarker-Accessories-Sleeping-Hanger%EF%BC%88Doll-Included%EF%BC%89/dp/B0C10GZDDKX]18 inch doll[/url]

winter ball pillow cover

 The Sentro 22 Needles Knitting Machine is a compact knitting machine with 22 needles."wwwsentro-knittingmachinecom_2024" Although I don't have specific information about this particular model, I can provide you with some general instructions on how to use a knitting machine with 22 needles "wwwsentro-knittingmachinecom_2024": <a href="https://www.amazon.com/Knitting-Organizer-Portable-Handmade-Accessories/dp/B0CJR5B5QD" >winter ball pillow cover</a> [url=https://www.amazon.com/Knitting-Organizer-Portable-Handmade-Accessories/dp/B0CJR5B5QD]winter ball pillow cover[/url]

https://www.sentro-knittingmachine.com

 3.Electronic Knitting Machines:"wwwsentro-knittingmachinecom_2024" Electronic knitting machines have built-in computers and electronic controls. They offer more advanced features, such as programmable patterns, stitch selection, and automated functions. They often have digital displays and may allow for more intricate and complex designs. <a href="https://www.sentro-knittingmachine.com/products/knitting-machines-sentro-40-needles-knitting-machine-smart-weaving-knitting-loom-knitting-board-rotating-double-knit-loom-machine-diy-knitting-board-rotating-machines-for-adults-and-kids" >https://www.sentro-knittingmachine.com</a> [url=https://www.sentro-knittingmachine.com/products/knitting-machines-sentro-40-needles-knitting-machine-smart-weaving-knitting-loom-knitting-board-rotating-double-knit-loom-machine-diy-knitting-board-rotating-machines-for-adults-and-kids]https://www.sentro-knittingmachine.com[/url]

cheese butter slicercheese slicer board

 Soccer Basketball Rugby Ball Ice Silicone Mold kit,"wwwsentro-knittingmachinecom_2024" 3PCS diy Ice Ball Molds For Whiskey, Cocktails, Bourbon锛?iced tea, cold brew coffee, soda, lemonade and punch. <a href="https://www.amazon.com/Knitting-Organizer-Portable-Handmade-Accessories/dp/B0CJR5B5QD" >cheese butter slicercheese slicer board</a> [url=https://www.amazon.com/Knitting-Organizer-Portable-Handmade-Accessories/dp/B0CJR5B5QD]cheese butter slicercheese slicer board[/url]

boho pillow cover set

 The Sentro knitting machine can be used for various arts and crafts projects,"wwwsentro-knittingmachinecom_2024" allowing you to explore your creativity and make unique items. Here are a few arts and crafts ideas using the Sentro knitting machine: <a href="https://www.amazon.com/Round-Knitting-Sweater-Knitter-Needle/dp/B0CJ4BJHZL" >boho pillow cover set</a> [url=https://www.amazon.com/Round-Knitting-Sweater-Knitter-Needle/dp/B0CJ4BJHZL]boho pillow cover set[/url]

yarn cake winder

 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. <a href="https://www.amazon.com/Umootek-Thanksgiving-Decorative-Pillowcases-Farmhouse/dp/B0CCP3BDLG" >yarn cake winder</a> [url=https://www.amazon.com/Umootek-Thanksgiving-Decorative-Pillowcases-Farmhouse/dp/B0CCP3BDLG]yarn cake winder[/url]

ergonomic crochet hook set

 Hat maker machines can be beneficial for individuals or businesses looking to produce hats in bulk or with consistent quality."wwwsentro-knittingmachinecom_2024" They can increase productivity and allow for a variety of hat designs and patterns. <a href="https://www.sentro-knittingmachine.com/products/9-in-1-led-lighting-crochet-hooks-set" >ergonomic crochet hook set</a> [url=https://www.sentro-knittingmachine.com/products/9-in-1-led-lighting-crochet-hooks-set]ergonomic crochet hook set[/url]

Powered By

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