Search This Blog

Panda 3d welcome panda


panda 3d wellcome panda with  source code:


1.make sure that you have already installed panda 3d. or you have not installed yet ,don't worry let,s install panda 3d by pip command
 pip install panda3d


2.Let's paste this code on your favorite code editor and run this code.code is given below.

#Created By Coding with Sayed

#Wellcome panda project in Panda3d, Let's engoy

from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from math import pi, sin, cos
from direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import Sequence
from panda3d.core import Point3

#define a class 

class panda(ShowBase):

    def __init__(self):

        ShowBase.__init__(self)

        self.scene = self.loader.loadModel("environment")

        self.scene.reparentTo(self.render)

        self.scene.setScale(0.20, 0.20, 0.20)

        self.scene.setPos(-8, 45, 0)

        self.taskMgr.add(self.spinCameraTask, "SpinCameraTask")

        self.pandaActor = Actor("panda-model", {"walk": "panda-walk4"})

        self.pandaActor.setScale(0.007,0.007,0.007)

        self.pandaActor.reparentTo(self.render)

        self.pandaActor.loop("walk")

        pandaPosInterval1 = self.pandaActor.posInterval(13,Point3(0, -10, 0),

                               startPos=Point3(0, 10, 0))

        pandaPosInterval2 = self.pandaActor.posInterval(13, Point3(0, 10, 0),


                               startPos=Point3(0, -10, 0)


        pandaHprInterval1 = self.pandaActor.hprInterval(3,Point3(180, 0, 0),

                               startHpr=Point3(0, 0, 0))

        pandaHprInterval2 = self.pandaActor.hprInterval(3,Point3(0, 0, 0),

                               startHpr=Point3(180, 0, 0))
        self.pandaPace = Sequence(pandaPosInterval1, pandaHprInterval1, 
                               pandaPosInterval2, pandaHprInterval2)



        self.pandaPace.loop()

    def spinCameraTask(self, task):

        angleDegrees = task.time * 7.0



        angleRadians = angleDegrees * (pi / 180.0)



        self.camera.setPos(20 * sin(angleRadians), -20.0 * cos(angleRadians), 3)



        self.camera.setHpr(angleDegrees, 0, 0)



        return Task.cont

#create object  

mypanda = panda()


#let's run

mypanda.run()






3.Let's run...



Enjoy........


SHARE

Abu Sayed

  • Image
  • Image
  • Image
  • Image
  • Image

1 comments:

  1. many of the regions wineries do not open to the public with 80 to choose from who do you will have no problem finding one to visit. It's an easy day trip from your B&B in Adelaide. panda products

    ReplyDelete