This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Builderboy2005
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.

10064 views / 30 in the last 7 days

15 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 does not support the canvas tag.
ZergZerg

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
ZergZerg

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.
Builderboy2005Builderboy2005

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
bournebourne

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.
Builderboy2005Builderboy2005

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
talmanteltalmantel

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
MathManiacMathManiac

2011/5/1

I can see the Rocky Mountians!
CockyCocky

2012/8/26

schön schön

See all comments

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

Who likes this?

Nosson1459 FlyingRabidUnicornPig JetLennit TKPROG Moritz nooby123 drhorriblejr uboiz zxx43 MathManiac minime qnanqing mutantleg Zerg plcs