Backface and Frontface Culling problem?

working on a character selection screen.

Using the code below to show a model (rotating)with a 2d backdrop, where ill be adding some images and directgui controls.

All works well, except the model seems transparent/inside out. The same models work fine in the regulr part of my game. Just to test i redid my code to just use roaming ralph and i see the same issue. so it seems it has something to do with my scaling it and parenting to a Directgui frame?

to check , just copy ralph.egg.pz into a folder (along with ralph.jpg) and any backdrop jpg (just call it blue.jpg)


from pandac.PandaModules import *						# to use CONFIG.PRC settings & Vec3
from direct.showbase.ShowBase import ShowBase			# to startup Panda
from direct.gui.DirectGui import *						# to use DirectGUI
from direct.interval.IntervalGlobal import *			# to use Intervals
from direct.actor import Actor							# to use Actors
from direct.task import Task							# to use Tasks
from direct.stdpy.file import *							# replaces std Python file handling with Panda version
import csv, random, sys, os, math, datetime				# std python modules

class MyGame(ShowBase):
	def __init__(self):
		ShowBase.__init__(self)
		random.seed()
		render.setShaderAuto()
		self.scrChar = DirectFrame(image="blue.jpg", frameSize=(-1.33,1.33,-1.0,1.0), image_scale=(1.34, 0, 1))

		self.chrModel = Actor.Actor("ralph.egg.pz")
		self.chrModel.setPos((.5, 0, -.65))
		self.chrModel.setScale(.1)
		self.chrModel.setH(0)
		self.chrModel.reparentTo(self.scrChar)

		rInterval = LerpHprInterval(self.chrModel, 3, Point3(360, 0, 0)) 
		rInterval.loop()

g = MyGame()
g.run()

It’s not that the model is inside-out, it’s just that it’s being rendered without a depth buffer, which means that surfaces which are in the back have an equal chance of appearing on top of surface which are in the front.

Try:

self.chrModel.setDepthTest(True)
self.chrModel.setDepthWrite(True)

David

thanks! that did the trick!

Just so i know, what exactly causes it to not have a depth buffer? because it was parented to a directframe?

Right, render2d is set up in ShowBase.py to disable the depth buffer, because it’s usually not needed for 2-d objects.

David