PageSourceSearch

https://cubic9.com/assets/js/3321bd4c.chunk.js

js cubic9.com collected 2026-10-04 11:11:18 UTC 10,811 bytes, 2 lines download raw bytes

1/*! For license information please see 3321bd4c.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkcubic_9_com=self.webpackChunkcubic_9_com||[]).push([[6751],{12704:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>u,frontMatter:()=>l,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"Devel/Unity/2\u70b9\u6307\u5b9a\u3067Cylinder\u3092\u751f\u6210\u3059\u308b","title":"2\u70b9\u6307\u5b9a\u3067Cylinder\u3092\u751f\u6210\u3059\u308b","description":"Unity\u306f\u5186\u67f1\uff08Cylinder\uff09\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6301\u3063\u3066\u304a\u308a\u3001","source":"@site/docs/Devel/Unity/2\u70b9\u6307\u5b9a\u3067Cylinder\u3092\u751f\u6210\u3059\u308b.md","sourceDirName":"Devel/Unity","slug":"/Devel/Unity/2\u70b9\u6307\u5b9a\u3067Cylinder\u3092\u751f\u6210\u3059\u308b","permalink":"/Devel/Unity/2\u70b9\u6307\u5b9a\u3067Cylinder\u3092\u751f\u6210\u3059\u308b","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Unity","permalink":"/Devel/Unity/"},"next":{"title":"Unity5\u3067Lightmap\u306ebake\u304cLightTransport\u3067\u6b62\u307e\u308b\u4ef6\u306e\u5bfe\u51e6","permalink":"/Devel/Unity/Unity5\u3067Lightmap\u306ebake\u304cLightTransport\u3067\u6b62\u307e\u308b\u4ef6\u306e\u5bfe\u51e6"}}');var i=n(74848),a=n(28453),o=n(77833),c=n(52391);const l={},s=void 0,p={},d=[{value:"\u5229\u7528\u4f8b",id:"\u5229\u7528\u4f8b",level:2},{value:"\u53c2\u8003",id:"\u53c2\u8003",level:2}];function m(e){const t={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"Unity\u306f\u5186\u67f1\uff08Cylinder\uff09\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6301\u3063\u3066\u304a\u308a\u3001\r\n\u30e1\u30cb\u30e5\u30fc\u3084\u30b3\u30fc\u30c9\u304b\u3089\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304c\u3001\r\n\u901a\u5e38\u3001\u5186\u67f1\u306e2\u3064\u306e\u7aef\u70b9\u3092\u6307\u5b9a\u3057\u3066\u751f\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002"}),"\n",(0,i.jsx)(t.p,{children:"\u3053\u308c\u3092\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u306e\u304c\u4e0b\u8a18\u306eUnity\u30d1\u30c3\u30b1\u30fc\u30b8\u3002"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"pathname:///assets/Unity/cylinder_between_two_points.unitypackage",children:"cylinder_between_two_points.unitypackage"})}),"\n","\n",(0,i.jsx)("div",{className:"video-container",children:(0,i.jsx)(o.A,{id:"4VPFo4C8uYo",webp:!0})}),"\n",(0,i.jsx)(t.p,{children:"\u30b3\u30fc\u30c9\u306f\u3053\u3093\u306a\u611f\u3058\u3002"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-cs",children:"using System.Collections;\r\nusing System.Collections.Generic;\r\nusing UnityEngine;\r\n\r\npublic class CylinderBetweenTwoPoints : MonoBehaviour {\r\n    [SerializeField]\r\n    private Transform cylinderPrefab;\r\n\r\n    private GameObject leftSphere;\r\n    private GameObject rightSphere;\r\n    private GameObject cylinder;\r\n\r\n    private void Start () {\r\n        leftSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);\r\n        rightSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);\r\n        leftSphere.transform.position = new Vector3(-1, 0, 0);\r\n        rightSphere.transform.position = new Vector3(1, 0, 0);\r\n\r\n        InstantiateCylinder(cylinderPrefab, leftSphere.transform.position, rightSphere.transform.position);\r\n    }
2\r\n\r\n    private void Update () {\r\n        leftSphere.transform.position = new Vector3(-1, -2f * Mathf.Sin(Time.time), 0);\r\n        rightSphere.transform.position = new Vector3(1, 2f * Mathf.Sin(Time.time), 0);\r\n\r\n        UpdateCylinderPosition(cylinder, leftSphere.transform.position, rightSphere.transform.position);\r\n    }\r\n\r\n    private void InstantiateCylinder(Transform cylinderPrefab, Vector3 beginPoint, Vector3 endPoint)\r\n    {\r\n        cylinder = Instantiate<GameObject>(cylinderPrefab.gameObject, Vector3.zero, Quaternion.identity);\r\n        UpdateCylinderPosition(cylinder, beginPoint, endPoint);\r\n    }\r\n\r\n    private void UpdateCylinderPosition(GameObject cylinder, Vector3 beginPoint, Vector3 endPoint)\r\n    {\r\n        Vector3 offset = endPoint - beginPoint;\r\n        Vector3 position = beginPoint + (offset / 2.0f);\r\n\r\n        cylinder.transform.position = position;\r\n        cylinder.transform.LookAt(beginPoint);\r\n        Vector3 localScale = cylinder.transform.localScale;\r\n        localScale.z = (endPoint - beginPoint).magnitude;\r\n        cylinder.transform.localScale = localScale;\r\n    }\r\n}\n"})}),"\n",(0,i.jsx)(t.p,{children:"\u305f\u3060\u3057\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u306b\u4e0e\u3048\u308b\u5186\u67f1\u30d7\u30ec\u30cf\u30d6\u306f\u3001\u901a\u5e38\u306e\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u306e\u5186\u67f1\u3067\u306fNG\u3002"}),"\n",(0,i.jsx)(t.p,{children:"\u3068\u3044\u3046\u306e\u3082\u3001\u5186\u67f1\u306e\u65b9\u5411\u304c\u6c42\u3081\u3066\u3044\u308b\u65b9\u5411\u3068\u7570\u306a\u308b\u305f\u3081\u3002"}),"\n",(0,i.jsx)(t.p,{children:"\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u3001\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3092\u4f5c\u6210\u3057\u6c42\u3081\u308b\u65b9\u5411\u306b\u56de\u8ee2\u3055\u305b\u305f\u5f8c\u3001\r\n\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3057\u3066\u30e1\u30c3\u30b7\u30e5\u3092\u30a2\u30bb\u30c3\u30c8\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308c\u3070\u3001\u89e3\u6d88\u3059\u308b\u3002"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-cs",children:"AssetDatabase.CreateAsset(mesh, path);\r\nAssetDatabase.SaveAssets();\n"})}),"\n",(0,i.jsxs)(t.p,{children:["\u306a\u304a\u3001 \u4eca\u56de\u306f\u7c21\u5358\u306e\u305f\u3081\u306b\u3001",(0,i.jsx)(t.a,{href:"http://tsubakit1.hateblo.jp/entry/2014/10/24/220610",children:"\u30c6\u30e9\u30b7\u30e5\u30fc\u30eb\u30d6\u30ed\u30b0\u3055\u3093\u306eMeshCombiner.cs"}),"\u3092\u4f7f\u7528\u3057\u305f\u3002"]}),"\n",(0,i.jsx)(t.p,{children:"\u30a2\u30bb\u30c3\u30c8\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u3092\u30ab\u30d7\u30bb\u30eb\uff08Capsule\uff09\u306b\u3059\u308c\u3070\u3001\u30ab\u30d7\u30bb\u30eb\u30822\u70b9\u6307\u5b9a\u3067\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002"}),"\n",(0,i.jsx)(t.h2,{id:"\u5229\u7528\u4f8b",children:"\u5229\u7528\u4f8b"}),"\n","\n",(0,i.jsx)(c.A,{url:"https://twitter.com/cubic9com/status/857240178229825536"}),"\n",(0,i.jsx)(t.h2,{id:"\u53c2\u8003",children:"\u53c2\u8003"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://forum.unity3d.com/threads/draw-cylinder-between-2-points.23510/",children:"Draw Cylinder Between 2 Points | Unity Community - Unity Forums"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"http://answers.unity3d.com/questions/21174/create-cylinder-primitive-between-2-endpoints.html",children:"Create cylinder primitive between 2 endpoints? - Unity Answers"})}),"\n"]})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(m,{...e})}):m(e)}},28453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>c});var r=n(96540);const i={},a=r.createContext(i);function o(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(a.Provider,{value:t},e.children)}},52391:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(96540),i=n(5556),a=n.n(i),o=n(74848);function c({url:e}){const t=(0,r.useRef)(null);return(0,r.useEffect)((()=>
2{if(!e||!t.current)return;const r=e.replace("x.com","twitter.com");n.e(4204).then(n.t.bind(n,4204,23)).then((({default:e})=>{const n=`\n          <blockquote class="twitter-tweet">\n            <a href="${r}"></a>\n          </blockquote>\n          <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"><\/script>\n        `;e(t.current,n)})).catch((e=>{console.error("Failed to load postscribe:",e)}))}),[e]),(0,o.jsx)("div",{ref:t})}c.propTypes={url:a().string.isRequired};const l=c},77833:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(96540),i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i.apply(this,arguments)};var a=r.forwardRef((function(e,t){var n=r.useState(!1),a=n[0],o=n[1],c=r.useState(e.alwaysLoadIframe||!1),l=c[0],s=c[1],p=encodeURIComponent(e.id),d="string"==typeof e.playlistCoverId?encodeURIComponent(e.playlistCoverId):null,m=e.title,u=e.poster||"hqdefault",h=e.announce||"Watch",f=new URLSearchParams(i(i(i(i({},e.muted?{mute:"1"}:{}),e.alwaysLoadIframe?{}:{autoplay:"1",state:"1"}),e.enableJsApi?{enablejsapi:"1"}:{}),e.playlist?{list:p}:{})),y=e.noCookie;y=e.cookie?"https://www.youtube.com":"https://www.youtube-nocookie.com";var b=e.playlist?"".concat(y,"/embed/videoseries?").concat(f.toString()):"".concat(y,"/embed/").concat(p,"?").concat(f.toString()),g=e.webp?"webp":"jpg",v=e.webp?"vi_webp":"vi",w=e.thumbnail||(e.playlist?"https://i.ytimg.com/".concat(v,"/").concat(d,"/").concat(u,".").concat(g):"https://i.ytimg.com/".concat(v,"/").concat(p,"/").concat(u,".").concat(g)),j=e.activatedClass||"lyt-activated",C=e.adNetwork||!1,x=e.aspectHeight||9,S=e.aspectWidth||16,P=e.iframeClass||"",k=e.playerClass||"lty-playbtn",U=e.wrapperClass||"yt-lite",E=e.onIframeAdded||function(){},O=e.rel?"prefetch":"preload",V=e.containerElement||"article",A=e.style||{};return r.useEffect((function(){l&&E()}),[l]),r.createElement(r.Fragment,null,r.createElement("link",{rel:O,href:w,as:"image"}),r.createElement(r.Fragment,null,a&&r.createElement(r.Fragment,null,r.createElement("link",{rel:"preconnect",href:y}),r.createElement("link",{rel:"preconnect",href:"https://www.google.com"}),C&&r.createElement(r.Fragment,null,r.createElement("link",{rel:"preconnect",href:"https://static.doubleclick.net"}),r.createElement("link",{rel:"preconnect",href:"https://googleads.g.doubleclick.net"})))),r.createElement(V,{onPointerOver:function(){a||o(!0)},onClick:function(){l||s(!0)},className:"".concat(U," ").concat(l?j:""),"data-title":m,style:i(i({backgroundImage:"url(".concat(w,")")},{"--aspect-ratio":"".concat(x/S*100,"%")}),A)},r.createElement("button",{type:"button",className:k,"aria-label":"".concat(h," ").concat(m)}),l&&r.createElement("iframe",{ref:t,className:P,title:m,width:"560",height:"315",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,src:b})))}))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.