当前位置:网站首页>地球围绕太阳转
地球围绕太阳转
2022-07-06 09:18:00 【SQ刘】
地球围绕太阳转
新建Unity3D工程,做一些准备工作
1、新建2个3D球体,分别重命名为:Sun,Earth
2、在Project面板中,新建Texture,Material,Scripts文件夹
(1)在Texture文件夹下面,导入贴图素材(百度搜索太阳贴图、地球贴图即可。下面是我百度的素材)
(2)在Material文件夹下面,分别创建2个材质,将它们的Shader着色器更改下,如下图所示
(3)在Scripts文件夹下面,创建C#脚本,双击打开,编写代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class earthAroundSun : MonoBehaviour
{
public Transform sun;
void Update()
{
transform.RotateAround(sun.position, Vector3.up, 1f); //RotateAround是围绕另外一个点旋转
}
}
3、回到Unity3D,将Sun组件拖入Sun中,如下图
4、实现效果图
边栏推荐
- 單片機藍牙無線燒錄
- FairyGUI按钮动效的混用
- FairyGUI增益BUFF數值改變的顯示
- Gateway 根据服务名路由失败,报错 Service Unavailable, status=503
- Types de variables JS et transformations de type communes
- (四)R语言的数据可视化——矩阵图、柱状图、饼图、散点图与线性回归、带状图
- Unity scene jump and exit
- How to add music playback function to Arduino project
- MySQL error warning: a long semaphore wait
- (5) Introduction to R language bioinformatics -- ORF and sequence analysis
猜你喜欢
(4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart
FairyGUI人物状态弹窗
数据库课程设计:高校教务管理系统(含代码)
程序设计大作业:教务管理系统(C语言)
Types de variables JS et transformations de type communes
FairyGUI摇杆
JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
JS function promotion and declaration promotion of VaR variable
In 2020, the average salary of IT industry exceeded 170000, ranking first
FairyGUI增益BUFF数值改变的显示
随机推荐
By v$rman_ backup_ job_ Oracle "bug" caused by details
Unity scene jump and exit
Teach you to release a DeNO module hand in hand
Fairygui joystick
Unity3d, Alibaba cloud server, platform configuration
Game 280 weekly
(5) Introduction to R language bioinformatics -- ORF and sequence analysis
Naive Bayesian theory derivation
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree
(4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart
1041 Be Unique (20 point(s))(哈希:找第一个出现一次的数)
Servlet
Single chip Bluetooth wireless burning
level16
In 2020, the average salary of IT industry exceeded 170000, ranking first
Basic operations of databases and tables ----- classification of data
[leetcode622]设计循环队列
Classification, understanding and application of common methods of JS array
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
基于Redis的分布式ID生成器