rotate entity around parent using only mouse, help

Blitz3D Forums/Blitz3D Programming/rotate entity around parent using only mouse, help

maximo(Posted 2005) [#1]
I want the child entity to position it self at specific distance between the parent entity and the mouse pointer wherever it may be on the screen, then if parent entity moves both child entity and mouse pointer and camera follow the parent entity.

Any wizards in here that can conjure an example I can test.

Best example would be in 3d, using birdview isometric perspective if possible.

If this is too complicated just show me how to place a
 an entity on point that lies on direct line between two
 points. Not in the middle but anywhere on the line that
 I specify. Got any examples, show me here.



maximo(Posted 2005) [#2]
I got the "point on the line between two points" math down now. If you wanna show other example that was more difficult be my guest. I think I may be able to do what I need, but if you got usefull example plz post here so I can take a look :)


maximo(Posted 2005) [#3]
problem solved hurraay :D have solved it much more easier then I though would be possible. found simple solution then I though I would.


VP(Posted 2005) [#4]
Care to share the solution?


daaan(Posted 2005) [#5]
Use camerapick( mousex(), mousey() ) and then use the pickedx() and pickedz() verus the obj_x and obj_z with sin() and cos() to determine what its x and z positions are.