We need a modeller to create a 3D model of a mug for us with an image mapped onto the front and back of the mug as per the below image. The size of the image will typically be 600x700px and the same image will appear on both the front and back of the mug.
We will be exporting the resulting model into Panda3D so we can use a Python script to load the model, switch in a different texture image each time we render the model, render the model and then output a picture of the resulting rendered image. If you’ve got experience of using Panda3D in this way (or any other 3D rendering engine that can run in a headless Linux environment, as we’ll be using dedicated render nodes that we don’t want to install X11 onto) then that would be a huge bonus. I’ve included the sample code we’ve been using to give an idea of the sort of thing we’ll be doing:
import direct.directbase.DirectStart from pandac.PandaModules import * from panda3d.core import Texture from panda3d.core import BillboardEffect from panda3d.core import Camera from panda3d.core import TextNode from direct.gui.OnscreenText import OnscreenText from direct.showbase.DirectObject import DirectObject from direct.task.Task import Task class MyApp(DirectObject): def __init__(self): m = loader.loadModel("mug_1.egg") m.reparentTo(render) plight = DirectionalLight('plight') plight.setColor(VBase4(0.8, 0.8, 0.8, 1)) plnp = render.attachNewNode(plight) plnp.setPos(100,-150,10) plnp.lookAt(m) render.setLight(plnp) alight = AmbientLight('alight') alight.setColor(VBase4(0.5, 0.5, 0.5, 1)) alnp = render.attachNewNode(alight) render.setLight(alnp) tex = loader.loadTexture('ttu.png') tx = TextureStage('poster') tx.setMode(TextureStage.MReplace) m.setTexture(tex,1) # base.disableMouse() camera.setPos(10,0,20) camera.setY(camera,-100) base.graphicsEngine.renderFrame() base.win.saveScreenshot("screenshot_1.jpg") app = MyApp() run()
If this works out we’ll likely want to commission further 3D models such as t-shirts, coasters, iphone cases and suchlike which will behave in a similar way.