←→↑↓(Arowkey):perspective change 0-9key:change action https://scratch.mit.edu/projects/717645005 This is a self remix of the above project. For those who want to change the 3D model or edit the action Almost anything that can be expressed with spheres and lines can be drawn. lstLinkModel: This is the list of 3D models. lstModelAction: This is the list of action data. Go to program edit mode (see inside) and right-click on each of the above two lists to "export". Open the exported text file with notepad etc., edit it as you like, then right-click the list on the program edit screen again and select "import". and run the project to reflect the edited contents. ☆lstLinkModel: 3D model First two lines: These first two lines are used inside the actual program, so do not change them. These two lines are the settings corresponding to the viewpoint change. The definition of the 3D model starts from the third line below. Each line is a unit named object. Definitions on each line are separated by one or more space characters. Do not use tab characters. 1st column item: row number of the parent object. The line number of the object from which the object defined in this line hangs. 0 means there is no parent object. This concept of hanging is important. For example, if the parent object moves 30 degrees, all the coordinates of the child objects hanging from it will move 30 degrees. For example, the elbow hanging on the shoulder hits this. 2nd column item: Object type. Defines what kind of object this object is. It can be roughly divided into the origin system and the substance system. ・origin system Roll: Specifies a joint that rotates in the Z-axis direction. Pitch: Specifies a joint that rotates in the x-axis direction. Yaw: Specifies a joint that rotates in the y-axis direction. ・entity system Stamp: Stamp the sprite. Line: Draw a straight line. Line2: Be sure to write on the next line as a set with Line. Draws a straight line at the coordinates specified by Line and Line2. 3rd column item: X coordinate relative to the parent object. 4th column item: y-coordinate relative to the parent object. 5th column item: z-coordinate relative to the parent object. 6th and subsequent columns (origin system): Not used. Please use it for comments, etc. 6th column (for Stamp): Specifies the ratio of the sprite. 1.0 is normal size, 2.0 is double size, 0.5 is half size. 7th column (for Stamp): Specify the number of the costume to be stamped. The costume uses the costume of the View sprite in the program. Please change this to your favorite image. (However, I think that it will probably be strange if it is not a sphere image.) 6th column (for Line): Line thickness. Please specify 1 or more. 7th column (for Line): Line color. 0-100 corresponds to the color in Scratch as it is. Values greater than 100 will result in white-ish colors (101 is black, 200 is white, 150 is gray). 6th column (for Line2): Not used. The thickness and color of the line will be those defined in the previous Line. Later: Do not use. Please use it for comments, etc. *Note: When defining objects, be sure to define the origin system first. If you define the body system first or define the body system inside the origin system, it will not work properly. Other than that, there are no order restrictions for specifying objects. This is the explanation of lstLinkModel: 3D model. ☆lstModelAction: action data Each line is the angle data of each joint for each action step. However, the line whose first character is "/" defines the beginning of the action definition and the name of the action. Even if the joint angle is defined here, it will not be reflected. 1st column item: The position of the next line to be executed when the angle specified in this line is reached. For example, if this value is 1, execute the line: -3 will go back 3 lines. This makes it repeatable. If set to 0, return to the 0th defined action. 2nd column item: Maximum rotation speed of the joint. Smaller values mean slower action, higher values mean faster action. Do not enter a value less than 0 in this field. 3rd and subsequent columns: Set the angle of each joint defined in lstLinkModel. Set the number of all origin systems minus 2 axes. (The first two axes are used in the program and cannot be set in this list.) The setting order of this item follows the order of the origin system specified in lstLinkModel. If you have any questions, please let us know in the comments section. Addendum: 2024/10/24 Fixed a bug in the Line specifications
←→↑↓(カーソルキー):視点変更 0-9キー:アクション変更 https://scratch.mit.edu/projects/717645005 上記のセルフリミックスです。 3Dモデルを変更してみたい、もしくはアクションを編集してみたい方へ 球体と線で表現できる造形物なら大体描画可能です。 lstLinkModel:コレが3Dモデルのリストです。 lstModelAction:コレがアクションデータのリストです。 プログラム編集モード(中をみる)にして、上記二つのリストをそれぞれ右クリックして“書き出し”を行ってください。 書き出したテキストファイルをノートパッドなどで開き、好きなように編集した後、再びプログラム編集画面でリストを右クリック、“読込み” してプロジェクトを実行すると編集内容が反映されます。 ☆lstLinkModel:3Dモデル 最初の2行:この最初の2行は実際のプログラム内部で使用しますので変更しないでください。この2行は視点変更に対応した設定です。 次の3行目からが3Dモデルの定義です。各行はそれぞれオブジェクトと言う名前の単位となります。行毎の定義は1個以上のスペース文字で区切られます。スペース文字以外のタブ文字、全角のスペース文字は使用しないでください。 1列目の項目:親オブジェクトの行番号。この行で定義するオブジェクトがぶら下がっている根元にあたるオブジェクトの行番号です。0は親オブジェクトが存在しない事を意味します。このぶら下がるという概念が重要になります。例えば親オブジェクトが30度動くとそれにぶら下がる子オブジェクトの座標全体が30度動きます。例として、肩にぶら下がったひじ等がコレに当たります。 2列目の項目:オブジェクト種類。このオブジェクトがどんなオブジェクトなのか定義します。大まかに、原点系と実体系にわかれます。 ・原点系 Roll:Z軸方向に回転する関節を指定します。 Pitch:x軸方向に回転する関節を指定します。 Yaw:y軸方向に回転する関節を指定します。 ・実体系 Stamp:スプライトをスタンプします。 Line:直線を描画します。 Line2:必ずLineとセットで次の行に記述します。LineとLine2で指定した座標に直線を描画します。 3列目の項目:親オブジェクトからの相対X座標です。 4列目の項目:親オブジェクトからの相対y座標です。 5列目の項目:親オブジェクトからの相対z座標です。 6列目以降(原点系):使用しません。コメント等に利用してください。 6列目(Stampの場合):スプライトの比率を指定します。1.0の時通常サイズ、2.0で2倍、0.5で半分の大きさになります。 7列目(Stampの場合):スタンプするコスチュームの番号を指定します。コスチュームはプログラム中のViewスプライトのコスチュームが使用されます。こちらをお好みの画像に変更しておいてください。(ただし球体の画像でないと恐らくヘンになると思います。) 6列目(Lineの場合):線の太さです。1以上を指定してください。 7列目(Lineの場合):線の色です。0-100がそのままScratchでの色に対応しています。100よりも大きい値を指定すると白系統の色になります(101で黒、200で白、150で灰色です)。 6列目以降(Line2の場合):使用しません。線の太さと色は前行のLineで定義したものになります。 それ以降:使用しません。コメント等に利用してください。 *注意点:オブジェクトの定義は必ず原点系を先に全て定義してください。実体系を先に定義したり、原点系の中に実体系を定義したりすると正常に動作しません。 それ以外はオブジェクトの指定に順番の制約はありません。 ここまでがlstLinkModel:3Dモデルの説明です。 ☆lstModelAction:アクションデータ 各行はそれぞれアクションのステップ毎の各関節の角度データです。ただし、先頭の1文字目が“/”となっている行はアクション定義の先頭、アクションの名前を定義します。ここに関節角度を定義しても反映されません。 1列目の項目:この行で指定した角度になった場合、次に実行する行の位置です。例えばこの値が1の場合、次の行を実行します。-3にすると3行前に戻ります。これにより繰り返し動作を実現します。0にした場合、0番目で定義したアクションに戻ります。 2列目の項目:関節の最大回転速度です。この値が小さければゆっくりと、大きければ素早くアクションが行われます。この項目には0以下の値を入れないでください。 3列目以降:lstLinkModelで定義した各関節の角度を設定します。全ての原点系の数-2軸分設定を行います。(最初の2軸分はプログラム上で使用します。このリスト上では設定できません)この項目の設定順はlstLinkModelで指定した原点系の順番に従います。 ご不明点あればコメント欄にてご回答いたします。 追記:2024/10/24Lineの仕様にバグがあったため修正