Report as inappropriate.

Avatar-1940_thumb

Builderboy2005 presents ...

2009/10/19

3D Earth

This is a 3D earth I am developing for the codepoint contest. I really don't know what I am going to do with it yet, but we shall see XD. I originaly tried to use my Rasterization engine, but soon realized that it would not work for highly detailed spheres, especialy if I wanted to have variable quality. So i decided on a ray casting algorithem, and I think the result is very nice!

Click on the Earth and drag it to navigate.
Use [Up] and [Down] to zoom in and out
Press 1 and 2 to change the quality
Press O to turn on and off OSA

-Changed graphics to use parts of My FastImage class functionality
-Increased window size
-Aproximated trig functions. A little distortion around poles.
-Faster!!

Added plane mapping just because :P Predd 4 to go to plane viewer and press 3 to go back to earth viewer.

2955 views / 11 in the last 7 days

8 votes | 0 in the last 7 days

Tags: mouse simulation physics demo with-source 3d earth

This scenario is a member of: 3D, Space Simulations


open in greenfoot
Your browser is ignoring the <APPLET> tag.
Avatar-1940Builderboy2005

2009/10/22

There is more than one way to find whether or not a point lies inside a triangle. The way you said works, as does computing the normals of the sides, then finding the dot product of the point against the normal. The dot product returns a positive number if the point is inside, and a negative if outside. Calculating the normal is trivial given the coordinates of the vertexes of the triangle, and the dot product is merely multiplication and addition. Do this for all 3 sides and your good :/ I do this in my rigid body physics simulator to detect collisions, and let me assure you, it is quite fast.
Hydra_fullZerg

2009/10/23

There is also the linear equation set for determining where the point intersects the plane. This would normally be no problem, but you have to do this for each polygon in the scene to determine which on is "on top" relative to the camera (unless you want to disregard all shading). Like I said, I am speaking from experience; my rasterizer posted previously used this method(minus Z-buffer), and was indeed quite slow. Just want to point out as well that your rigid body simulator is not running 40000(200px by 200px image)+ iterations per act cycle per object, and is also in 2D, not 3D. ... Of course, there really is no better method than yours. :P
A new version of this scenario was uploaded on Mon Oct 26 04:06:38 UTC 2009
Hydra_fullZerg

2009/10/27

mmm... I lied to you... There is a way to do intersection with polygons with only a single linear equation--still not trivial, but also faster. It requires a form of vector parametrization (which may not be trivial) along with the equation for the plane.
Avatar-1940Builderboy2005

2009/10/27

Yes I know. http://local.wasp.uwa.edu.au/~pbourke/geometry/planeline/ Simpler than you might think, and requires stunningly less math than a sphere, and even less to transform the image coordinates.
A new version of this scenario was uploaded on Tue Oct 27 22:39:00 UTC 2009
Photo_on_2011-09-18_at_18bourne

2009/10/28

it seems to break when worsening the quality with the plane too far (like 100). not sure about with the earth, it just kept going.
Avatar-1940Builderboy2005

2009/10/28

I suppose I could put a cap on the quality settings :P I hadn't even thought of lowering the quality that much! XD
No_avatartalmantel

2011/1/14

you have bag when do zoom and bad quality! the game stopped!! in quality 9.00+.... and the best zoom(most big) its a bag
Math_table_thumbMathManiac

2011/5/1

I can see the Rocky Mountians!

See all comments

Want to leave a comment? You must first log in.

Who likes this?

Mrenges_thumb 20386216_thumb Math_table_thumb Minime_thumb Aaaargh_thumb No_avatar_thumb Hydra_full_thumb No_avatar_thumb