How To Change The Orientatiion Of A Loaded Model ?

Blitz3D Forums/Blitz3D Programming/How To Change The Orientatiion Of A Loaded Model ?

semar(Posted 2003) [#1]
Hi all,
when I load some .3DS, the models are oriented in a different way, so when I move it on the Z axis, they move backwards, or on a side, depending on the orientation used when made.

So far, I've tryed the following commands (for the models that move backwards):
- RotateEntity entity_loaded,0,0,180
and
- RotateMesh entity_loaded,0,0,180

But no success. The models continue to face and move backward.

A solution would be to use a pivot, and parent the model to the pivot, and that is fine.

Anyway, I wonder if there is another trick to rotate the entity and have it facing in the right way.

Thanks in advance for your help,
Sergio.


Rob Farley(Posted 2003) [#2]
If they're moving backwards I would suggest rotatemesh entity,0,180,0

Rotatemesh is the way to go with this sort of thing... of course you could just load the model up into a modeller and fix it at source which is probably the better way to go.


semar(Posted 2003) [#3]
Thanks Rob.

If they're moving backwards I would suggest rotatemesh entity,0,180,0


Indeed sir, I think it was just a typo in my previous post, but who knows, perhaps I did the same in the code.

So, you say that rotatemesh should do the trick; oh well, time to try it better when at home.

Anyway, I guess that when PointEntity is used, then the original orientation comes in place again, hence the model turns again in the way it was saved, which is the wrong one for my purpose.

So, as you stated, perhaps is better to edit and re-save the models with the correct orientation.

Cheers,
Sergio.


BlitzSupport(Posted 2003) [#4]

Anyway, I guess that when PointEntity is used, then the original orientation comes in place again, hence the model turns again in the way it was saved, which is the wrong one for my purpose.


Can't check right now, but if you 'correct' your mesh via RotateMesh, the result of PointEntity should be correct. With RotateMesh, you'll be aligning the incorrect mesh rotation with the actual entity rotation...


(tu) ENAY(Posted 2003) [#5]
Yes. Rotatemesh rotates all the vertices, Rotateentity rotates the property of the mesh itself.
It's more obvious with ScaleMesh and ScaleEntity where Scalemesh enlarges the mesh by a factor and ScaleEntity with a percentage. I used to get them confused, can't of hard to explain it.

It's best really in your modeller to make sure all your models are the correct way round and size before you export them so you don't need to alter the mesh when you get it into blitz.


semar(Posted 2003) [#6]
Thanks m8s, I'll try that.

Cheers,
Sergio.


IPete2(Posted 2003) [#7]
semar,

pop them back into Max and rotate them around to face the correct way and export them again, much easier.

IPete2.


semar(Posted 2003) [#8]
Thanks IPete2 for your tip, the problem is, I do not have Max.

Anyway, RotateMesh did the trick.

Thanks all for your help, much appreciated.

:)

Sergio.


IPete2(Posted 2003) [#9]
semar,

send me the model and I'll adjust it for you should you wish.
regards,

IPete2.


semar(Posted 2003) [#10]
@IPete2,
thanks a lot for your kind availability.

At the moment the RotateMesh command does the job; anyway, since I have a problem with a tank (sort of a rocket launcher), I may send you the model.

Thanks again, very much appreciated.

:)

Sergio.