香港新手遊戲開發者論壇

 找回密碼
 立即註冊
查看: 4087|回復: 0

Panda3d教學(四)Python使用設定

[複製鏈接]

16

主題

29

帖子

220 小時

在線時間

版主

Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7Rank: 7

積分
378
發表於 2019-12-5 19:03:59 | 顯示全部樓層 |閱讀模式

馬上註冊,結交更多好友,享用更多功能,讓你輕鬆玩轉社區。

您需要 登錄 才可以下載或查看,沒有帳號?立即註冊

x
本帖最後由 小丑遊戲 於 2019-12-5 07:11 PM 編輯

官方教學鍊結:https://www.panda3d.org/manual/?title=General_Preparation
漢化教學帖子前言(第二層):http://power-plant.dlinkddns.com/newplayer-hk/forum.php?mod=viewthread&tid=966&extra=page%3D1

You can use multiple programming languages with Panda3D. The most commonly used language is Python, followed by C++. Some manual pages offer both C++ and Python information - use the toggle button at the top of the manual page to toggle between C++ information and Python information.

For example, if you want this page to contain information about learning C++ instead of learning Python, just hit the "C++" link at the top of this page.

學習Python

Since Panda3D is a library, and not a point-n-click game maker, it is needed to learn Python or C++ before you will be able to use it. Since this engine's main goal is to support Python, it would be a good idea to familiarize yourself with Python before continuing.

Python is an interpreted, interactive, object-oriented language comparable to Java or Perl. It is available on several platforms, including UNIX, Windows, OS/2, and Mac. Python also has a large number of modules outside of the standard Python installation, and additional modules can be created in C or C++. Because it is late-binding and requires minimal memory management, it is an ideal language for rapid prototyping.

Panda3d隨覆的Python版本

On Windows, it is not necessary to install Python, because the Windows installer for Panda3D includes a copy. This is a completely normal copy of Python, identical to what you would have if you installed Python using the standard Python installer. Panda's built-in copy of Python is automatically added to the PATH environment variable. This enables you to type "python" at the command prompt, and it will run the Python that comes with Panda.

On macOS, Python 2.7 already comes pre-installed on your system, which will work with Panda3D. However, it is recommended to install a newer version of Python from https://www.python.org/downloads/mac-osx/ .

如果我已經有Python版本怎麼辦?


If you already have a copy of Python, and you wish to use that instead of the one provided with panda, it is easy to do so. Simply create a "panda.pth" file inside your copy of Python, containing the path of the panda directory and the bin directory within it on separate lines (for example C:\Program Files\Panda3D-1.2.3 and C:\Program Files\Panda3D-1.2.3\bin). This will enable your copy of Python to find the panda libraries.

For this to work, the version of Python that you use must match the version of Python included with panda. The panda libraries are compiled for that particular version, and will not work with any other.

Of course, if you do use your own copy of Python, you may wish to delete panda's copy of Python, or at least, remove it from the PATH environment variable. Otherwise, you will have two copies of Python, which can lead to confusion.

Python編譯資源

There are a lot of other resources available for programming in Python. Here is a list of some of the best:

Links from the official Python website:

Official Website -http://www.python.org
Current Python Documentation
Python Documentation

Here are some other good links for learning Python:

Byte of Python
Dive Into Python
Beginner's Guide from Python's wiki
The Standard Python Library
Introduction to OOP with Python

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

手機版|Archiver|植物油氣

GMT+8, 2024-9-20 03:07 AM , Processed in 0.053397 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表