Hi,
I’m trying to build a game that has an UI with models that can be drag and dropped into the stage. I already built this, using DirectGUI. Howecer, when I parent the models in my “sidebar”, I get 2D representations of my models.
I thought that I could use a TextureBuffer to create a card that shows my object in the sidebar, in 3D.
Here’s the code:
# A parent node of all the "3D models" in my sidebar
self.theParent = self.parentDirectFrame.attachNewNode("models")
self.theParent.setZ(6)
self.theParent.setX(2)
delta = 0
for m in models:
# start the buffer
myBuffer=base.win.makeTextureBuffer("Another Scene", 800,600)
myNewScene=NodePath("myRender")
myNewCamera=base.makeCamera(myBuffer)
myNewCamera.reparentTo(myNewScene)
# load the model and parent it to the buffer's scene
model = loader.loadModel(m)
model.reparentTo(myNewScene)
# get a card with what should be IMO the 3D representation of the model
card=myBuffer.getTextureCard()
card.reparentTo(self.theParent)
card.setPos(0,0,delta)
delta = delta - 1.5
If anyone knows the right approach or if I’m not making myself clear about my problem, thanks!