Can the catalog functions be used to check which units can be seen by the camera or alternatively which units are bring rendered (because their being viewed)?
I've been looking, and still have more to check in the catalogs, but I thought I'd ask here as it might save me time.
By catalogs you mean data editing? Your question needs to be clarified...
BTW I suppose the only way to detect what units are in view of your camera is by trigger.
I thought that perhaps the catalog, which can get game data, would know which units are being viewed by the camera. Either in view, the model being rendered, or something else to indicate a units being seen.
Your script may very well be perfect for what I want but I don't understand it. I don't know some of the math used and the triggers are separated, all over the place, and hard to follow. Is there a simpler solution you could show me, like whatever method you use to see if a units in the camera view? I was thinking something like using the cameras pitch/yaw, drawing a imaginary line from the camera to the units position/vector and checking if the unit is within the cameras pitch/yaw plus some offset leeway.
The 3d model you should use is perspective projection:
This model projects a 3d point (game world) into a 2d plane (monitor 2d resolution), if the point is outside the 2d plane then you can't draw it.
Ignore all the other functions in my map, the only one you really need is "Is Dialog Inside Screen For Player"
Others are just useful functions I made for vector modifications, I use them to normalize the system to a 2d model and make the problem easier to solve. You can use them as they are ;)
Here is the drawing I made to calculate if a point is inside the camera:
I just used triangle properties and trigonometry (sin/cosin/tan) to detect the violet line size that tells me if the unit is inside or outside the camera (Y axis).
You should do the same calculations on the X axis too, I didn't need it on my trigger.
Can the catalog functions be used to check which units can be seen by the camera or alternatively which units are bring rendered (because their being viewed)?
I've been looking, and still have more to check in the catalogs, but I thought I'd ask here as it might save me time.
By catalogs you mean data editing? Your question needs to be clarified...
BTW I suppose the only way to detect what units are in view of your camera is by trigger.
Some days ago I made a script to detect what units are inside the view camera to hide or show dialogs attached to units, maybe it can be useful for your purpose
http://www.sc2mapster.com/assets/attach-dialog-unit-auto-hide-beh/
I thought that perhaps the catalog, which can get game data, would know which units are being viewed by the camera. Either in view, the model being rendered, or something else to indicate a units being seen.
Your script may very well be perfect for what I want but I don't understand it. I don't know some of the math used and the triggers are separated, all over the place, and hard to follow. Is there a simpler solution you could show me, like whatever method you use to see if a units in the camera view? I was thinking something like using the cameras pitch/yaw, drawing a imaginary line from the camera to the units position/vector and checking if the unit is within the cameras pitch/yaw plus some offset leeway.
The 3d model you should use is perspective projection:
This model projects a 3d point (game world) into a 2d plane (monitor 2d resolution), if the point is outside the 2d plane then you can't draw it.
Ignore all the other functions in my map, the only one you really need is "Is Dialog Inside Screen For Player"
Others are just useful functions I made for vector modifications, I use them to normalize the system to a 2d model and make the problem easier to solve. You can use them as they are ;)
Here is the drawing I made to calculate if a point is inside the camera:
I just used triangle properties and trigonometry (sin/cosin/tan) to detect the violet line size that tells me if the unit is inside or outside the camera (Y axis).
You should do the same calculations on the X axis too, I didn't need it on my trigger.
BTW can I ask you why do you need this script? ;)
I don't think that is exactly what I'm looking for. It needs to work in 3D space.
@zandose: Go
oh you are the one that posted this
http://www.sc2mapster.com/forums/development/map-development/26653-comparing-distance-of-vectors/#p1
you should check my last reply and answer so maybe I can really help you :P
Does your script take into account a units height offset?
Edit: looks like it does.
@zandose: Go
oh really? :P
forgot that it does :D