nil Posted October 17, 2019 Posted October 17, 2019 Is it possible to add a model part to another model parts child list while keeping its custom scale? If not is there another way to make this part turn in sync with the other part? Quote
salvestrom Posted October 17, 2019 Posted October 17, 2019 My own experience of this, attempting to create babies with enlarged heads for my custom entities, was that I could call poster render method to "connect" the head to the body without making it a child. It would move correctly as if a child model box, but the animation for the scaled box would also be scaled up so the head would animate in an exaggerated fashion compared to the rest of the body and therefore not be completely in sync. It occurred to me to try scaling the animation, but I never actually tried it. Quote
nil Posted October 18, 2019 Author Posted October 18, 2019 (edited) On 10/17/2019 at 11:38 PM, salvestrom said: Edited October 20, 2019 by nil misunderstanding Quote
nil Posted October 24, 2019 Author Posted October 24, 2019 On 10/17/2019 at 11:38 PM, salvestrom said: I could call poster render method to "connect" the head to the body without making it a child do you mean setting the model parts rotationPoints and rotationAngles to the parent parts? Quote
SerpentDagger Posted October 25, 2019 Posted October 25, 2019 On 10/17/2019 at 10:25 AM, nil said: Is it possible to add a model part to another model parts child list while keeping its custom scale? I think you can create the part with size values multiplied by (child's custom scale / parent's scale), and then add that part as a child. I haven't done much with entity rendering, though, so keep that in mind. Quote Fancy 3D Graphing Calculator mod, with many different coordinate systems. Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.
salvestrom Posted October 25, 2019 Posted October 25, 2019 6 hours ago, nil said: do you mean setting the model parts rotationPoints and rotationAngles to the parent parts? GlStateManager.pushMatrix(); GlStateManager.scale(0.75F, 0.75F, 0.75F); GlStateManager.translate(0, 16.0F * scale, 3 * scale); this.lowerbody.postRender(0.0625F); this.upperbody.postRender(0.0625F); this.neck.postRender(0.0625F); this.head1.render(scale); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); GlStateManager.scalef(0.5F, 0.5F, 0.5F); GlStateManager.translatef(0.0F, 24.0F * scale, 0.0F); this.lowerbody.render(scale); GlStateManager.popMatrix(); The above was being done in the render method of the model class. Note that neck is a child of upperbody which is a child of lower body, but head1 is not a child of the neck. Although the head will move as the body rotates, this failed because the animations are scaled up with the size of the head, so the head will move in an exaggerated fashion due to things like breathing animations. Quote
nil Posted October 28, 2019 Author Posted October 28, 2019 (edited) Both things actually work: Apparently postrendering a part makes the part rendered afterwards "connected" like in salvestroms example, however i'm not having any issues like this: On 10/25/2019 at 6:07 AM, salvestrom said: animations are scaled up with the size of the head, so the head will move in an exaggerated fashion due to things like breathing animations. Also you can do this: On 10/25/2019 at 3:35 AM, SerpentDagger said: I think you can create the part with size values multiplied by (child's custom scale / parent's scale), and then add that part as a child. By calling addChild in the render method however it still rescales the part. Edited October 28, 2019 by nil Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.