PDA

View Full Version : Star System (3dDHTML)


Dan
17.06.2001, 11:39
Hi ya, was going to save this till I released endoFlow but thought "the hell to it"!

http://www.pupius.net/x/star_system.htm

All the sizes, dimentions and distances are taken from planetary data.
- The sizes of the planets are accurate when compared to the other sizes
- The orbital radiuses are accurate compared to the other radiuses (except for the moons as they are to small to be show on this scale)
- However, in order to make it look more interesting the planets have been enlarged with respect to their orbital radiuses
- All the orbital periods are accurate, except for Mars's moons as they rotate 280 and 1216 times a year (and that gets a bit mad!)

If you're interested here is the stats I'm using: <pre id=code><font face=courier size=2 id=code>//the planets, size and orbital radius and slant are statisticly equivalent
// r = orbital radius
// a = start angle (to make it look less steralised)
// av = orbital velocity, if av=2 then planet does 2 rotations for every 1 that the earth does
// size = relative size of planet
// slant = orbital inclination
// parent = the parent planet
var planets = [{ name: "Sun", r: 0, a: 0, av: 0, size: 150, slant: 0 },
{ name: "Mercury", r: 57, a: 120, av: 4.15, size: 15, slant: 7, parent: 0 },
{ name: "Venus", r: 105, a: 90, av: 1.63, size: 45, slant: 3, parent: 0 },
{ name: "Earth", r: 150, a: 0, av: 1, size: 50, slant: 0, parent: 0 },
{ name: "Mars", r: 225, a: 50, av: 1.8, size: 25, slant: 2, parent: 0 },
{ name: "Moon", r: 10, a: 120, av: 13, size: 10, slant: 5, parent: 3 },
{ name: "Deimos", r: 8, a: 290, av: 25, size: 3, slant: 2, parent: 4 },
{ name: "Phobos", r: 5, a: 30, av: 50, size: 1, slant: 1, parent: 4 }];
</font id=code></pre id=code>

<font face='Courier New'><font color=maroon>»» Dan (dan@pupius.net)
»» www.pupius.net || www.endoflow.com</font id=maroon></font id='Courier New'>

Edited by - Dan on 06/17/2001 13:11:05

DCage
17.06.2001, 12:06
Beautiful. I've been reading, trying to get a handle on matrix math, and was wondering if a browser's script engine could handle the number of steps required for each increment without bogging. Well, this answers that. It's smoother than I could hope, and Deimos and Phobos are going bananas. It's brilliant Dan, you've done it again!

simu
17.06.2001, 13:04
Hey Dan

can't believe it
coooooooool

how can u always make that cool things <img src=icon_smile_question.gif border=0 align=middle>


<font size=1>|| simu ||
|| [url="mailto:simuk@freesurf.ch"]simuk@freesurf.ch[/url:3164prabxn] ||
|| [url="http://www.simu.cjb.net"]www.simu.cjb.net[/url:3164prabxn] || [url="http://www.retedesign.ch.vu"]www.retedesign.ch.vu[/url:3164prabxn] ||</font id=size1>

Dan
17.06.2001, 14:05
Heh... thanks guys. Here's the first example I made using matrix multiplication. It's not as good or as big as the inner solar system one but there are 30 elements and the frame rate stays pretty high.
http://www.pupius.net/x/fountain.htm
My aim was to get something that looked like that WinAmp plugin, it'd be a lot easier using openGL :)

I was trying to think of a practicle use for this stuff, maybe a weird navigation system or something. Any ideas?



Just added some nicer images, slows it down a bit because of the image resizing, but looks a lot nicer

<font face='Courier New'><font color=maroon>»» Dan (dan@pupius.net)
»» www.pupius.net || www.endoflow.com</font id=maroon></font id='Courier New'>

Edited by - Dan on 06/17/2001 13:19:02

Syedur
17.06.2001, 14:36
<font face='Tahoma'>Hey Dan,
Did you do the rotation according to scale?
If you did that... then your sun isn't moving.
It should be spinning around itself too...
Also... the whole galaxy sould be shifting itself slowly.
I am just messing with you.
Later.</font id='Tahoma'>

<center><font face='Tahoma'>[url="http://e-syed.net/"]e-syed.net[/url:sjvyf44di5]
||| Part of syedsoft.com |||
webmaster@e-syed.net
...Coming Soon...
<s>In a browser near you.</s></font id='Tahoma'></center>

Syedur
17.06.2001, 14:42
REPLY TO: <font color=blue>ecsplosiv</font id=blue><BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
PS. dan, its 4 dimensions your working in!! dont forget about time ! how about this :

<font color=blue>4DHTML</font id=blue>

<font face='Verdana'><font size=1><font color=red>Tim_Scarfe = { url: "http://tim.dhs2.com", mail: "g6jdw@qsl.net" }</font id=red></font id=size1></font id='Verdana'>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>
Who cares?
If you count time as vactor quanity... then every animation should be 4D.
Only 3D will be left are still images.
Later.

<center><font face='Tahoma'>[url="http://e-syed.net/"]e-syed.net[/url:6k5aou3y6z]
||| Part of syedsoft.com |||
webmaster@e-syed.net
...Coming Soon...
<s>In a browser near you.</s></font id='Tahoma'></center>

Dan
17.06.2001, 15:43
1st. yeah, it was Mike Foster's simulation that gave me this idea

2nd. Time as a 4th dimension is debatable. Many physists don't think time exists. Don't get me started on this though <img src=icon_smile_wink.gif border=0 align=middle>

3rd. The paths themselves are circular within the 3D space. I suppose I could program it so they were eliptical but the planets in the inner solar system orbit in nearly perfect circles anyway so there wouldn't be a considerable visible difference.

4th. Hope so Tim :) - not sure what I want to do yet; anyone out there want to give me a job?

5th. Syeder, you're right. I should probably take into account the shift in centre of mass as the solar system moves. That would effect the position of the sun ... lol ... everything's to scale except the sun is smaller and the planets are larger compared to the orbital radius 9otherwise they'd just be little pin pricks.
Should I try to model the entire galaxy in DHTML? I think even IE wouldn't be able to cope with that <img src=icon_smile_big.gif border=0 align=middle>

I had to do a full solar system in C w. openGL for one of my courses last year. It chugged considerably on a 266Mhz PC, so I think I'll limit this simulation to modelling the inner solar system.

Thanks for the feedback.


<font face='Courier New'><font color=maroon>»» Dan (dan@pupius.net)
»» www.pupius.net || www.endoflow.com</font id=maroon></font id='Courier New'>

Icestorm
17.06.2001, 15:44
<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
i did actually pass my alevel physics exam, and so did dan, so leave it to the people with a brain lol ;)
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>

that's not even funny man... was that meant to be a joke?

-----<font face='Verdana'>
[url="http://e-syed.net/skriptlab/"]v2[/url:0kb5ir8m5q]</font id='Verdana'>
-----

Dan
17.06.2001, 15:51
Ecsplosive: Yeah, obviously the sun is a lot smaller than it should be when compared to the earth and phobos and Deimos are larger; that is just so you can see them all. The ratios of the size betwen Venus:Earh, Mars:Earth, Moon:Earth etc. are accurate and the ratios of the orbital radius are accurate too. However, If 1km in the orbital radius = 1km in the radius of a planet, then the scale means you can barely see the planets at the same time as viewing an orbit as wide as Mars'.
The Earth's real orbital radius is 149,600,000 km and its equatoral radius is only 6,278. That means the orbital radius is 12,500 times the earth's diameter. How do you represent that AND be able to see the simulation on a screen that is 1024 pixels wide???
I didn't explain that well earlier, its just a compromise between Scientific figures and the ability to see the simulation.

<font face='Courier New'><font color=maroon>»» Dan (dan@pupius.net)
»» www.pupius.net || www.endoflow.com</font id=maroon></font id='Courier New'>

Edited by - Dan on 06/17/2001 14:56:20

Dan
17.06.2001, 19:51
just a note to say I've made a few more changes.

<font face='Courier New'><font color=maroon>»» Dan (dan@pupius.net)
»» www.pupius.net || www.endoflow.com</font id=maroon></font id='Courier New'>

MikeFoster
24.06.2001, 03:34
Wow! Awesome work dude. Makes mine look kinda plain. ;)

http://cross-browser.com/ss/solar_system2.html

Mike Foster
<font size=2>www.cross-browser.com
Cross-Browser DHTML for IE, NN, Gecko, and Opera</font id=size2>