entitypoint (sorry-meant to post this here)
Blitz3D Forums/Blitz3D Beginners Area/entitypoint (sorry-meant to post this here)
| ||
I understand that equitypoint turns an object toward another object. Lets assume the target is at position x300,y0,z400 And the source entity is at x100,y0,z0 so I use "entitypoint source,target"; Now the source turns.I guess? what commad do i now use to move the source toward the target? I have been using the "moveentity x,y,z" after computing the angle but if the point command is eaiser it would speed things up. |
| ||
Darn -another mistake --sorry |
| ||
I have no idea which one of these you intended to be the real thread, so I'll assume this one. Please don't multipost. You have an "Edit" button in the top right of your post for adjusting mistakes; if you get something in the wrong forum, you can either contact a moderator to have it moved, or, more usually, just ignore it because there's not a huge difference between Beginners' Area and Programming anyway. As for the question: 1) PointEntity (not EntityPoint). You can then use "MoveEntity ent, 0, 0, speed" to move towards the target. The whole point of rotating and pointing entities is so that you can use their "local" coordinate system to move them around (i.e. if the entity is pointing at a target, 0, 0, 1 from its perspective moves towards the target regardless of the absolute positions involved), so you should never need to compute the angle at all. (Before you ask, computing the angle manually will always be slower than using Blitz3D's automatic coordinate transformations.) |
| ||
Geez....I said I was sorry for the double post. Thanks for the answer but rather condesending. |
| ||
I didn't find the answer condescending. Nice clear answer, Yasha. |
| ||
It wasn't meant to be condescending - I'm sorry it came across that way. Based on your question, I thought the final line (relative performance) seemed like something you'd be likely to be concerned about next, and that you weren't familiar with B3D's parent/child transformation system (B3D uses matrices internally, heavily optimised by the magic of powerful C++ compilers, for superfast space transformations, so you can't really write equivalent code in Blitz itself). Similarly the first paragraph. Did not mean to offend you. |
| ||
No problem Yasha and thanks. |