Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: planet orbits  (Read 1468 times)
sciophyte
Customers
Community Member
*****
Posts: 245


« on: April 20, 2008, 01:01:01 PM »

hey all,

I wrote a simple orbit simulator out of boredom, figured I'd share it.

written in vb.net 2008



you can get the code here: http://www.frostbytecafe.com/game/planetsim.rar

planetengine class contains these functions:

Init()
Unload()
Render()
AddBody (BodyName, BodyRadius, BodySpinSpeed, AxisTilt, TextureName, NormalTextureName)

  • BodyName:string - planet name
  • BodyRadius:single - planet radius
  • BodySpinSpeed:single - the number of hours it takes for a full spin
  • AxisTilt:single - the axial tilt of the planet (this should be a vector, only works on x axis rotation in this)
  • TextureName:string - texture for planet
  • NormalTextureName:string - normal texture for planet

SetBodyOrbit(OrbitingPlanetName, ParentToOrbit, EllipsoidScale, OrbitSpeed, OrbitRadius,
OrbitTilt)

  • OrbitingPlanetName:string - name of plant to make orbit
  • ParentToOrbit:string - the parent that will be orbited around
  • EllipsoidScale:vector - 1,1,1 is a circular orbit
  • OrbitSpeed:single - number of hours it takes to complete 1 orbit
  • OrbitRadius:single - distance from parent
  • OrbitTilt:vector - rotational values for rotating the orbit plane

Update(SimSpeed)


the orbit tilt is kind of hacky, but i'm poor at math  Tongue

EDIT: all images courtesy of google images, normals produced in crazybump
« Last Edit: April 20, 2008, 01:07:54 PM by sciophyte » Logged
cristims
Community Member
*
Posts: 116


« Reply #1 on: April 22, 2008, 12:23:02 PM »

nice!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks