Posted July 8, 201510 yr Hi I have rendered an arm model but the problem is that I want it to stay in front of the player much like the vanilla first person arm. I tried rotating the model based on pitch and yaw of the vanilla arm but most of it goes wrong. The yaw works fine for rotating the model up and down (in fact, it does that perfectly from what I can tell). The pitch, however, because of the model's offset / axis rotates in a weird way. Instead of rotating with the player, when the player's pitch is changed the arm tries to rotate - when it does the arm rotates in a circular motion (a simple example would be the circular motion of a drill bit, for instance). How do I correctly rotate the model ignoring the fact that the offset is at the end of the model? I hope that made sense and thanks if you are able to help out! Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
July 8, 201510 yr Before attempting any kind of animating, it is very important that your model is correct. If any rotation points are off or pieces of the model are acting independently (i.e. not added as children of a parent part), then you are just making the task 1000x more difficult than it should be. If your model is all set up correctly, then be aware that the axis of rotation is also affected by the model itself - if you have a box that is rotated naturally by some amount, the yaw/roll/pitch axes are relative to the box's rotation, not necessarily that of the entity. http://i.imgur.com/NdrFdld.png[/img]
July 8, 201510 yr Author Thanks, coolAlias. My model is exactly the same as the vanilla model arm from the ModelPlayer class. The dimensions, texture UV, etc. The vanilla rendering of the first person hand starts in the ItemRenderer class and eventually calls a method ModelPlayer. Do you know how to actually make the model move or become attached to the player like a regular player part (such as the head or arm)? If I can do that, I can just call several GL functions to get it in front of the player and only enable first person rendering to get what I want. Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]
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.