Spaceship / Thruster Tutorial

Return to Scripting Issues

Spaceship / Thruster Tutorial

Postby BerndWill » Wed Aug 10, 2005 12:44 pm

Hello guys,

a) is there a spaceship / thruster example or tutorial around to download !?

b) is there a skybox example around for download ?

Thanks, Bernd
BerndWill
 
Posts: 3
Joined: Mon Aug 08, 2005 1:56 pm

Postby zpavlov » Wed Aug 10, 2005 6:02 pm

Hey Will,


In the sample programs zip for panda, there's a Task tutorial called Tut-Asteroids, that has a nice example of doing some simple thruster style controls in 2d.
As for a skybox, if you can manage to make one yourself (in blender or maya), and get it into egg format. There's some discussion on this here
http://www.panda3d.org/phpbb2/viewtopic.php?t=562
Anywho, if you have a model, say SkyBox.egg, with normals pointing inwards, you could do the following:


Code: Select all
import direct.directbase.DirectStart

skyBox=loader.loadModel("SkyBox.egg")
skyBox.reparentTo(render)
run()


The only problem with this is that you can move close to the skybox.
So, you would probably want to put a task on it to keep it away from the camera.

Code: Select all
import direct.directbase.DirectStart
from direct.task import Task

skyBox=loader.loadModel("SkyBox.egg")
skyBox.reparentTo(render)

largeEnoughToLookGood=<up to you>
skyBox.setScale(largeEnoughToLookGood)

def keepAwayTask(task):
      camPos=camera.getPos(render)
      #make sure the skybox doesn't move if we jump
      camPos.setZ(0)
      skyBox.setPos(camPos)
      return Task.cont

taskMgr.add(keepAwayTask,"keep the sky away from you")
run()

zpavlov
 
Posts: 60
Joined: Tue Apr 05, 2005 4:41 pm

Postby BerndWill » Thu Aug 11, 2005 2:02 am

Thanks for the skybox tips !!

Comming back to my thruster question, I wanted to find an example of parenting a particle thruster to my space ship. So, if my ships flys around space, the thruster should eject particles.

Thanks again
Bernd
BerndWill
 
Posts: 3
Joined: Mon Aug 08, 2005 1:56 pm


Return to Scripting Issues

Who is online

Users browsing this forum: No registered users and 1 guest