how to select entitys with a rectangle ..
Blitz3D Forums/Blitz3D Beginners Area/how to select entitys with a rectangle ..
| ||
hi, i have a terrain with some entitys on , now i will select a group from the entitys with the mouse . for a single entity i have entitypicked mode on but how can i select the entitys with a 2d rectangle as range , ok i must transform the mousecoordinates to 3d but have anybody a cool solutions ? mfg panno |
| ||
There are a number of ways of doing this. One method (pseudocode): Loop through each entity: Cameraproject the 3d coords of the entity into 2d screen space If projectedx/y is within bounds of rectangle then do a camerapick to the entity and check if it is obscured by the terrain, if so then don't add it to the list as it is behind a mountain or something, if it is not obscured then add it to the list of entities being selected. |
| ||
This might help: http://www.blitzbasic.com/codearcs/codearcs.php?code=729 |