• How to center 3D drawn stuffs?
    4 replies, posted
I've been learning how to draw stuff in 3D and it looks cool and all but it's not aligned in anyway. For example, I drew some text above a entity. How would I correctly go about centering it? Also, how make it rotate with the entity to stay in the same location. Example below: [IMG]http://i.imgur.com/foJUiiK.jpg[/IMG] Thanks for any help.
The easiest way would be to have your text be centered at 0, 0 ( draw.SimpleText x: 0 y: 0 alignX: 1 (center), alignY: 1 (center) ) and then use the 3d position of the 3d2d view and position that in the middle of the entity.
[QUOTE=Robotboy655;51116640]The easiest way would be to have your text be centered at 0, 0 ( draw.SimpleText x: 0 y: 0 alignX: 1 (center), alignY: 1 (center) ) and then use the 3d position of the 3d2d view and position that in the middle of the entity.[/QUOTE] That seems to work, but how would I raise the text above the entity? I don't want the text to rotate around when the entity is moved, just for it to stay at the top of it - if that makes any sense.
USE YOUR MATH. If you have no idea how to do that, look into "understanding of 3d vectors/points".
[QUOTE=Robotboy655;51116995]USE YOUR MATH. If you have no idea how to do that, look into "understanding of 3d vectors/points".[/QUOTE] Okay, I got it, finally. Vectors are an ass.:hammered: But I managed to create my first addon.
Sorry, you need to Log In to post a reply to this thread.