hej, my question is if there is a way to get the get the windowheight and width of the camera in blender units. you can get it in pixels with Rasterizer.getWindowHeight/Width, but i want to make a selectionbox and need therefor the height and width in blenderunits
help would be appreciated
does nobody has an idea?
I believe it’s measured in degrees. What exactly are you trying to do?
well i made a selectionbox with 2 ipos one for the with and one for the height of the selectionbox. if i know the with and height in blenderunits, i know howmuch pixels is equal to 1 blender unit and because i know the with and height of the selectionbox in pixels i can say how big the selectionbox needs to be -i cant do a few test to discover howmuch pixels is one blender unit because i want my camera to zoom -i know it is possible with the to positions of the mouseclicks and the orientation of the camera, but i didnt have had any linear algebra yet:P (get it in Q4:P)
so i hoped there would be an easier solution
how it works:
i let a empty follow my mousecursor and let it copy the camera orientation
when i hold down the leftmousebutton the empty adds the selectionbox and measures the difference between the point where i created the selectionbox and the point of my mouse cursor in pixels
How many blender units wide the camera is is relative to the distance of the object from the camera objects appear to be smaller away as they are farther away, and larger when closer.
However, in general just make the menu larger than is visible and ignore the invisible parts.
With some math you can probably find the width shown (distance between camera and menu, 35 degree angle of camera, do some triginometry to find distances.
Perspective might affect that value, but I believe cameras can be set to orthographic, and that would make sense for a menu.
well, i am not trying to make a menu…
i want to make selectionbox (a thing most seen in RTS games, when you hold the left mouse button, you can select more than 1 unit… got a good script for actualy selecting the object, but i want a nice red line on my screen
so i dont want to have the width in blender units of what i can see, but i want the width of my screen at the beginning of the camera:
when i move a plane towards my camera, what is the seeable width of that plane, just before it disappears because my camera moved trought it?
can`t explain it better:S