- jMonkeyEngine 3.0 Beginner’s Guide
- Ruth Kusterer
- 214字
- 2021-08-13 17:02:07
And how do I say that in Java?
Imagine an arrow pointing from the origin to an X-Y-Z coordinate. This arrow is called a vector. You will be using vectors to represent locations. Since a vector always starts at the origin, and the arrow points in the direction of the given (x,y,z) coordinates, a vector can also be used to specify a direction. Quite useful!
In your Java code, you use the com.jme3.math.Vector3f
class for this data type. A Vector3f
is an object with three float components, x
, y
, and z
. For example:
Vector3f v = new Vector3f( 2.0f , 3.0f , -4.0f );
Remember when we created the blue cube earlier and placed it in the middle of the scene? We positioned it at the location Vector3f.ZERO
. This built-in constant stands for a Vector3f(0f,0f,0f)
. The (0,0,0) coordinates vector represents the origin of the coordinate system, the middle of the scene.
Now that you know how to orient yourself in 3D space, we can apply this knowledge and transform our blue cube; let's position, resize, and turn it. In terms of 3D graphics, we say that we translate, scale, and rotate the object. In the next three sections, we look at each of the three transformations in detail, and learn the appropriate Java syntax.
- 大學計算機基礎(第二版)
- Mastering RabbitMQ
- 深入淺出Electron:原理、工程與實踐
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- Windows Presentation Foundation Development Cookbook
- 精通Python自然語言處理
- Cybersecurity Attacks:Red Team Strategies
- 第一行代碼 C語言(視頻講解版)
- NetBeans IDE 8 Cookbook
- Java圖像處理:基于OpenCV與JVM
- Getting Started with Nano Server
- Learning VMware vSphere
- C++ System Programming Cookbook
- HTML5移動前端開發基礎與實戰(微課版)
- Clojure編程樂趣