Posted October 14, 201411 yr I have a techne model but I was wondering how I could rotate it thats the picture of the model so far, I want to add a miniature jet engine onto the top of the pole-like thing but I want to be able to set the direction of it. I haven't found any tutorials or posts about this topic so far. The proud(ish) developer of Ancients
October 15, 201411 yr https://github.com/Pixelmon-Mod/PixelUtilities/blob/master/src/main/java/com/pixelutilities/models/renderers/PokeballRenderer.java
October 15, 201411 yr Author I checked that out but it wasn't what I wanted. I want it to rotate around almost like an axle, for the turbine blades. I haven't added the blades yet but I want to make the axle spin first. The proud(ish) developer of Ancients
October 15, 201411 yr It's a model right? if you want to rotate a model, you can set the rotation angles for it. Make sure to set the rotation points right though.
October 15, 201411 yr GL11.glRotatef(angle, xAxis, yAxis, zAxis); You just have to figure out the axis. I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.
October 15, 201411 yr Author First, it is a model. Second does this rotate it like the axles in the rotary craft mod? The proud(ish) developer of Ancients
October 15, 201411 yr If it is a model, you have a rendering class for it, registered in your ClientProxy, If you don't have this, I don't quite know how or what you are doing, and you should look into setting it up like that. So, in your renderTileEntityAt method, put the GL11.glRotatef method after your first GL11.glPushMatrix. The first parameter is the angle you want to rotate it, and the second, third, and fourth are the x, y, and z axis. So for example, to rotate it -90 degrees on the y axis, you would have: GL11.glRotatef(-90, 0.0F, 1.0F, 0.0F); The numbers for the x, y, z axis are a bit like a percentage of how much it will affect that axis. So 1, is like 100% and will rotate it for the full -90 degrees on that axis, and 0 will not affect the axis at all. You can do something like 0.5F to only rotate it 50% so the result will be -45 degrees. In your case, you want to use metadata to determine this rotation. So in your block, set the blocks metadata depending on the players rotationYaw (see the vanilla furnace to understand how this is done, if you don't already understand it. You would want to look at the methods onBlockPlacedBy, and onBlockAdded), and in the renderTileEntityAt method, you can use the TileEntity parameter to retrieve the metadata. I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.
October 15, 201411 yr Author I'm rendering it properly with the TESR but I want to make it so that you can have it rotate any direction on the x y and z kind of like a player head, I'm gonna make it power a turbine and the rotation determines the power output. It's a bit over complex but I think it would be a cool idea for a power system. The proud(ish) developer of Ancients
October 15, 201411 yr Okay, do you understand GL11.glRotatef now? if so, all you really need to achieve that then is some variable in the tileentity that stores the rotation, and on what axis, then in renderTileEntityAt, just do a check to make sure this is the right tileentity, then cast the tileentity variable to your tileentity, and then you can access those variables from your renderer. I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.
October 15, 201411 yr He wants to rotate part of model, not whole model. WHY he should use glRotatef? In your model code do something like this: http://up42.ru/u/p/2014-10-15_19.30.11.png[/img] This is for example. Numbers are random and it looks weirdly, but works.
October 15, 201411 yr Author I just want to rotate the jet engine, not the stand that it is on, although it is one model. I think multimote's method will work the best. Also why are you doing modulo 3600 to the time and then dividing by 100F? The proud(ish) developer of Ancients
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.