******
EDIT:Nevermind, I have it working now, I’m going to tidy the code and post the resolution incase someone else needs the answer later
******
Hi
I’m putting the boiler plate code below and have run into an issue with the sky box, specifically being unable to render the texture to the inside of the skybox which I then intend to reparent to the camera. At the moment I’m manually flying the camera into the skybox to check everything looks ok from the outside.
I thought I had it sorted when a post here-
…suggested changing the config file if you are using directX. Added the line in the code below to the config file but still no change.
I’ve been using the box model that comes with panda, and the sphere and star texture in the solar system tutorial.
If there anything else I’m maybe missing at all could someone point me in the correct direction please?
I’ve commented out the rest of the code but included it in case it’s useful to someone coming in from a search later.
Thanks.
from direct.showbase.ShowBase import ShowBase
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectButton import DirectButton
class Game(ShowBase):
def __init__(self):
ShowBase.__init__(self)
#set config vars
base.setBackgroundColor(0,0,0)
#move camera
camera.setPos(0.0,0.0,0.0)
camera.setHpr(2,0,0)
#load sphere for skybox
skybox = loader.loadModel("models/box.egg")
#skybox = loader.loadModel("models/solar_sky_sphere.egg")
skyBoxTexture = loader.loadTexture("maps/stars_1k_tex.jpg")
skybox.setTexture(skyBoxTexture, 1)
skybox.setTwoSided(True)
skybox.setBin("background",0)
skybox.setDepthWrite(False)
#skybox.setCompass()
skybox.setPos(0.0,4.0,0.0)
skybox.setHpr(0,0,0)
skybox.reparentTo(render)
#skybox.reparentTo(camera)
#load font
#headerFont = loader.loadFont("GringoNights.ttf")
#headerFont.setPixelsPerUnit(60)
#display Text
#textObject = OnscreenText(text = "We Love SkyBoxes!", pos = (0,0.7), scale = 0.25, fg = (1,1,1,1), font = headerFont)
#load quit button
#quitMap = loader.loadModel("quitButtonMaps.egg")
#quitButton = DirectButton(geom = (quitMap.find("**/quitok"),quitMap.find("**/quitclick"),quitMap.find("**/quitroll"),quitMap.find("**/quitdisable"),), scale=0.33, borderWidth=(0.025,0.025), pos=(0.0,0,-0.75), frameColor=(0.5,0.25,0.25,1), command="quitCommand")
#def quitCommand(self):
#sys.exit()
game = Game()
game.run()
#turn on backfaces
egg-emulate-bface #t