rdb / nim-panda3d

Proof of concept nim binding for Panda3D
https://www.panda3d.org/
8 stars 5 forks source link
nim nim-lang nim-language panda3d panda3d-game-engine

This is a proof of concept nim binding for Panda3D.

There is a subset of the DIRECT API implemented as well. It is deliberately incomplete, only the parts that can't be trivially reimplemented using the C++ API are intended to be supported.

Some things to keep in mind:

Here is a brief example, see test.nim for the complete Hello World tutorial.

import direct/showbase
import direct/actor
import panda3d/core

var base = ShowBase()
base.openDefaultWindow()

var env = loader.loadModel("models/environment")
env.reparentTo(render)
env.setScale(0.25, 0.25, 0.25)
env.setPos(-8, 42, 0)

var pandaActor = Actor()
pandaActor.loadModel("models/panda-model")
pandaActor.loadAnims({"walk": "models/panda-walk4"})
pandaActor.setScale(0.005, 0.005, 0.005)
pandaActor.reparentTo(render)
pandaActor.loop("walk")

base.run()

Building the example:

make test
./test