|
-
Jan 26th, 2002, 09:50 AM
#1
Thread Starter
Addicted Member
reading longitude and latitude on 3d Sphere as earth
I'm working on a 3d sphere as accepted Earth, when mouse pointer over sphere, want to show earth longitude and latitude
in degrees, therefore must know how i can convert 3d object to 2d object
need anybody help
You can do while you think that you can do
If you think my answer solve your question, please rate it.
-
Jan 26th, 2002, 02:50 PM
#2
Addicted Member
First you'd have to do a ray-sphere colision detect, then you'd have to translate cartesian to spherical coordinates then to longitude and latitude.
Good luck.
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
Jan 27th, 2002, 08:02 AM
#3
Thread Starter
Addicted Member
what do you mean about "ray-sphere colision detect", sorry about me, i'm not have enough knowledge about 3d graphics.
i'm using flat cartesian and spherical coordinates for my app. I am drawing a sphere with longitude and latitude on screen, but I could not succeed in reading inverse coordinate, i thing my formulas which i used to calculate longtitude and latýtude is not corrcect, because result is not true.
if you could explain in detail, you will be much more help me
You can do while you think that you can do
If you think my answer solve your question, please rate it.
-
Jan 27th, 2002, 03:49 PM
#4
Addicted Member
How are you drawing your globe? DX? or something else.?
BTW, Thanks for all your help
Member of the anti-gay cross-dressing trans-species wolves alliance.
-
Feb 1st, 2002, 02:26 PM
#5
Thread Starter
Addicted Member
My Globe program is as follow
Public Sub Globe3D()
For teta = 0 To 180 Step 10
stepalfa = 1
For alfa = 0 To 180 Step 10
GlobePoint(stepteta, stepalfa).x = GlobeRadius_
* HSin(teta) * HCos(alfa)
GlobePoint(stepteta, stepalfa).y = GlobeRadius_
* HSin(teta) * HSin(alfa)
GlobePoint(stepteta, stepalfa).z = GlobeRadius * HCos(teta)
stepalfa = stepalfa + 1
Next alfa
stepteta = stepteta + 1
Next teta
End Sub
Public Sub Rotate(anglex,angley)
For m = 1 To 19
For p = 1 To 19
GlobeRotated(m, p).y = GlobePoint(m, p).z * HSin(anglex)_
+ GlobePoint(m, p).y * HCos(anglex)
GlobeRotated(m, p).z = GlobePoint(m, p).z * HCos(anglex_
) - GlobePoint(m, p).y * HSin(anglex)
GlobeRotated(m, p).x = GlobeRotated(m, p).z * HSin(angley_
) + GlobePoint(m, p).x * HCos(angley)
GlobeRotated(m, p).z = GlobeRotated(m, p).z * HCos(angley_
) - GlobePoint(m, p).x * HSin(angley)
GlobeScreen(m, p).x = centerx + GlobeRotated(m, p).x
GlobeScreen(m, p).y = centery + GlobeRotated(m, p).z
Next p
Next m
End Sub
and the image on the screen is attached to e-mail
my globe is 3d globe and is rotated
You can do while you think that you can do
If you think my answer solve your question, please rate it.
-
Feb 1st, 2002, 03:35 PM
#6
Thread Starter
Addicted Member
On my project the important point is the MOUSE POINTER
when mouse pointer is on the globe, i must calculate long & latitude coords where the mouse pointer is, this means my ray is mouse pointer and always is hitting the globe.
because mouse pointer always is moving on screen so my aim is to calculate long & latitude from mouse screen coords, but i don't know where can i start.
thanks riis for your valuable answer, is the (x,y) screen coords?
You can do while you think that you can do
If you think my answer solve your question, please rate it.
-
Feb 1st, 2002, 04:43 PM
#7
Fanatic Member
in LatLong2XYZ x, y and z are spherical coordinates (in 3d space)
in Arctan2 x and y are just two variables, which are not related to coordinates
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|