I always create the object and then hold v to snap it to a surface in my view. How would the script know where to be created elsewise?
Though there is a way to create the object in the Center Of Interest of the camera. I did that in our Level Tools.:
- move your object to the camera location
- spin it like the camera
- move it along Z-axis the amount given at cameras "Center Of Interest"-attribute
- unspin the object
voila! this way you create objects in the middle of your view. not hard to rescript.
Another way would be to shot a ray along the camera view. But I know nothing that could do the job without looping through all objects.
rayIntersect of course may do the job. But as I said: its not able to just "shoot". You have to give it an object to shoot at. This would mean you'd have to loop through all objects in the scene and query if its
in the ray through the camthe very first in this rayFor our leveldesigners as well I did a dropObjet-script that does the following: It checks for special named objects and browses only those. I don't know what sized scenes you are dealing with .. but of course rayChecking ~1000objects is slow.
AHH! Another nice way: do a selection and move the new object to the position of your selection! Let it be a vertex selection or transform...
eek: pardon me but.. "interactive creation" iz teh cr4p!! ![]()