MrHistory
|
  |
| Joined: 30 Aug 2010 |
| Total Posts: 5291 |
|
|
| 14 Aug 2012 05:10 PM |
There are two 1x1x1 parts. Part one is positioned at 0,1,0 and the other is at 1,1,-1. The camera is at 0,1,3 looking directly at the first part.
Looks like this from a bird's eye view:
----[] --[]
--^
with ^ being the camera.
How would I find out how many pixels high the first and second parts appear on the screen? Is there an equation for it? |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
| |
|
MrHistory
|
  |
| Joined: 30 Aug 2010 |
| Total Posts: 5291 |
|
| |
|
MrHistory
|
  |
| Joined: 30 Aug 2010 |
| Total Posts: 5291 |
|
|
| 14 Aug 2012 06:27 PM |
| Anyone got an equation? I'm really unfamiliar with graphics rendering |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2012 06:34 PM |
| hmm I'll try to figure it out for you :) |
|
|
| Report Abuse |
|
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 14 Aug 2012 06:42 PM |
| Use a BillboardGui and the property `StudsOffset` to place a 0px*0px gui above and below the part, then use AbsolutePosition. |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2012 06:48 PM |
The top of the part = 1.5, which is a difference of 0.5. The part's surface is closer than it's own position, so the surface is 2.5 away from the camera.
X = (atan(0.5/2.5)/FieldOfView)*ScreenHeightInPixels
From the center of the screen, going X units up, is where the top of the first brick appears... I think. I'm not sure about the other one. |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2012 06:49 PM |
| well, the magnification is determined only by the vertical size of the screen... |
|
|
| Report Abuse |
|
|
|
| 14 Aug 2012 07:29 PM |
confirmed the above formula.
print(math.atan2(surface_top-camera.y,distance_to_surface)*(180/math.pi)/fov*screenheight) |
|
|
| Report Abuse |
|
|
RA2lover
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 1254 |
|
|
| 14 Aug 2012 07:52 PM |
| AFAIK FOV is measured diagonally. |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2012 08:21 PM |
| I don't understand, would the size of the screen affect the FOV? Isn't the FOV not dependant on dimensions of the screen? If someone could explain this I'd be very grateful. |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2012 08:22 PM |
| r u a haker cuz telamons my dad n he hates da 1 ex 1 pls stop u no hakering is illegal |
|
|
| Report Abuse |
|
|