Model bug
Blitz3D Forums/Blitz3D Beginners Area/Model bug
| ||
I have been trying to create a model of a sword to include in a game and I have tried modeling it in 3D Canvas Pro and then Anim8or. Both modelers produce the same result. The sword is able to be placed at the point I want it to in the beginning. However, I don't want it to just be stationary. I want to rotate it but keep it at the exact same place the whole time. The problem is that when I type turnentity sword, 0, 1, 0 It results in the sword not only being turned like I want it to, but it also flys around the room in a circle. It is as if the model needs to be put at the position 0, 0, 0 in the modeler which I tried but it still flys around in a big circle. Can anyone provide me help with this issue? Your help is greatly appriciated. |
| ||
You need to move the axis of the model to the centre of the model. This should be an option in the 3D modeling program you're using. There may be a method to move the handle in Blitz itself to the centre of the object. Can anyone advise how? |
| ||
Okay I dug around, and it seems that there's a CreatePivot() command! All you need to do is make the Pivot (let's call it Sword_Pivot) at the centre of the sword mesh, and then parent the sword to it. you then move the sword by moving Sword_Pivot. When you rotate the pivot, it ought to rotate the Sword also. However, it would probably be much better if you located the Axis (pivot) of the mesh itself properly in the 3D modeler you're using. |
| ||
These are all great suggestions but I have already tried most of them before. I don't know if I really knew what I was doing but I did use the create pivot command something like this: pivot=createpivot() loadmesh("Sword.x", pivot) ... ;do some other code turnentity pivot, 0, 1, 0 I am using 3D canvas Pro. I have found the place where it says that the pivot is and it is somewhere in the middle of the blade of the sword. (I unioned all the pieces of the sword starting from the bottom and working my way up.) This may however, be the wrong pivot so if anyone has been using 3D canvas Pro, please tell me exactly how to do this since I am beginning both 3D canvas and BB. Thanks for any help you can give me on the subject. |
| ||
There is something in code archives which replaces pivotal axes to the centre of a mesh. I saw it while browsing yesterday... |
| ||
http://www.blitzbasic.com/codearcs/codearcs.php?code=14 Excellent find ^_^ thanks Malice! |
| ||
That stuff's useful, but it's probably worth me explaining something about modelling because it may stop you having more problems later. By default an object will revolve around it's personal centre of axes, as Dock said in his first post. Now I don't use 3d Canvas or Anim8or, but I'm going to assume that you've either done this correctly or you can find out how to quite easily. BUT.. not all formats grab the centre of axes from that pivot point. When you export .3ds in particular, from some modellers anyway, the point 0,0,0 in your modeller is taken as being the centre of rotation. So to be absolutely certain, you should centre the pivot to the centre point of your object. THEN you should move the model so that that pivot point is at 0,0,0 ( the origin ) in your modeller. Then you can export. |
| ||
I found out the solution to my problem. The problem was that I was using positionmesh(...) instead of positionentity(...). Thank you very much everyone for all your help on the problem. |