当前位置:网站首页>地球围绕太阳转
地球围绕太阳转
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、实现效果图
边栏推荐
- Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
- Detailed explanation of truncate usage
- (三)R语言的生物信息学入门——Function, data.frame, 简单DNA读取与分析
- FairyGUI簡單背包的制作
- Pat 1097 duplication on a linked list (25 points)
- 2021.11.10汇编考试
- Gateway fails to route according to the service name, and reports an error service unavailable, status=503
- 基於Redis的分布式ID生成器
- CUDA C programming authoritative guide Grossman Chapter 4 global memory
- Combination of fairygui check box and progress bar
猜你喜欢
Particle system for introduction to unity3d Foundation (attribute introduction + case production of flame particle system)
Programming homework: educational administration management system (C language)
Whistle+switchyomega configure web proxy
Single chip Bluetooth wireless burning
SVN更新后不出现红色感叹号
First use of dosbox
The master of double non planning left the real estate company and became a programmer with an annual salary of 25W. There are too many life choices at the age of 25
dosbox第一次使用
编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
基於Redis的分布式ID生成器
随机推荐
(core focus of software engineering review) Chapter V detailed design exercises
关于Gateway中使用@Controller的问题
(1) Introduction Guide to R language - the first step of data analysis
Learning notes of JS variable scope and function
[offer78] merge multiple ordered linked lists
Symbolic representation of functions in deep learning papers
CUDA C programming authoritative guide Grossman Chapter 4 global memory
It has been solved by personal practice: MySQL row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT
Basic operations of databases and tables ----- classification of data
Detailed explanation of truncate usage
数据库课程设计:高校教务管理系统(含代码)
2021.11.10汇编考试
(课设第一套)1-4 消息传递接口 (100 分)(模拟:线程)
Minio文件下载问题——inputstream:closed
[Leetcode15]三数之和
[Nodejs] 20. Koa2 onion ring model ----- code demonstration
[leetcode15] sum of three numbers
單片機藍牙無線燒錄
idea中导包方法
Theoretical derivation of support vector machine