当前位置:网站首页>地球围绕太阳转
地球围绕太阳转
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、实现效果图
边栏推荐
- Unity3d makes the registration login interface and realizes the scene jump
- Who says that PT online schema change does not lock the table, or deadlock
- (课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
- FairyGUI增益BUFF数值改变的显示
- level16
- MySQL时间、时区、自动填充0的问题
- (四)R语言的数据可视化——矩阵图、柱状图、饼图、散点图与线性回归、带状图
- Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY
- Walk into WPF's drawing Bing Dwen Dwen
- Force buckle 1189 Maximum number of "balloons"
猜你喜欢

In 2020, the average salary of IT industry exceeded 170000, ranking first

(3) Introduction to bioinformatics of R language - function, data Frame, simple DNA reading and analysis

FairyGUI增益BUFF数值改变的显示
![[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree](/img/6e/0802a92511ac50a652afa1678ad28c.jpg)
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree

Problèmes avec MySQL time, fuseau horaire, remplissage automatique 0

Fairygui character status Popup

Gravure sans fil Bluetooth sur micro - ordinateur à puce unique

MySQL占用内存过大解决方案

Lock wait timeout exceeded try restarting transaction

Fabrication of fairygui simple Backpack
随机推荐
(the first set of course design) 1-4 message passing interface (100 points) (simulation: thread)
idea中导包方法
Teach you to release a DeNO module hand in hand
数据库课程设计:高校教务管理系统(含代码)
[Offer18]删除链表的节点
Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect
[offer78]合并多个有序链表
FairyGUI简单背包的制作
Unity scene jump and exit
[offer9] implement queues with two stacks
单片机蓝牙无线烧录
(the first set of course design) sub task 1-5 317 (100 points) (dijkstra: heavy edge self loop)
Fabrication d'un sac à dos simple fairygui
ESP8266连接onenet(旧版MQTT方式)
Single chip Bluetooth wireless burning
By v$rman_ backup_ job_ Oracle "bug" caused by details
FairyGUI增益BUFF数值改变的显示
[leetcode15] sum of three numbers
关于Gateway中使用@Controller的问题
Combination of fairygui check box and progress bar