日本欧洲视频一区_国模极品一区二区三区_国产熟女一区二区三区五月婷_亚洲AV成人精品日韩一区18p

代做COMP27112、代寫Java語言程序

時間:2024-03-08  來源:  作者: 我要糾錯



Introduction to Visual Computing
Coursework Assignment 2
Sun, Planet and Moon
Tim Morris
Introduction
The aim of this exercise is to render a simple solar system with one moon orbiting one
planet orbiting one sun. As with the previous exercise, you’ll need a web browser to display
the output and a simple text editor1 to create the html file you’ll need.
This piece of work contributes half of the coursework assessment. We suggest that you
should not spend more than 15 hours in total completing Assignments 1 and 2.
Getting Started
Start off with the same code as last time for creating the basic webpage. Under “// Your
Javascript will go here.” you’ll add any global variables and calls to two
functions, init() and animate().
Creating the Scene (init();)
Everything is initialised in this function.
As before, add a scene, camera and renderer and add the renderer to the
document (don’t forget to declare the scene, camera and renderer as global
variables). You won’t need a vertex shader or fragment shader this time.
Put the far plane of the camera at 10000. Locate the camera at (0, 30, 500) and add it to the
scene.
You’ll need to create nine variables for the sun’s, earth’s and moon’s geometries, materials
and meshes. These are global variables.
You can create the sun object using the following code:
1 You should ensure that your text editor saves your html files as plain text. Some editors (e.g. TextEdit on the
Mac add all kinds of stuff to what you think is a plain html file, meaning that you just see the text of your file
when you open it in your browser. Don’t forget to give your files the correct extension.
You could also use a suitable IDE.
sunGeometry = new THREE.SphereGeometry(109, 400, 200);
sunMaterial = new THREE.MeshStandardMaterial(
 {
 emissive: 0xffd700,
// emissiveMap: texture,
 emissiveIntensity: 1,
 wireframe: false
 }
);
sunMesh = new THREE.Mesh(sunGeometry, sunMaterial);
scene.add(sunMesh);
This creates a spherical object (what do the arguments mean?) of a particular colour. Where
is it located? The emissiveMap is something you may use later.
The sun must be a source of light. The PointLight() constructor can achieve this.
Create a point light source of white light at the origin and add it to the scene. You might also
add a diffuse light to give some background illumination, use AmbientLight().
Obviously this is physically unrealistic but it makes the objects more visible.
You can create the earth and moon using similar code with the following differences:
• The earth sphere geometry arguments are 25, 50, 50
• The moon sphere geometry arguments are 5, 40, 20
• Both the earth and moon materials are MeshPhongMaterial, they don’t have an
emissive argument, but do have a color. You can experiment with color
values.
The texture argument might be used later. So the earthMaterial can be created
using something like:
earthMaterial = new THREE.MeshPhongMaterial(
 {
// map: texture,
 color: x0000ff
 }
The earth and moon will be grouped together into one object before being added to the
scene. To do this we need a global variable to store the earth-moon system, we need to
add the earth to it, by default it will go to the origin of this system. Then we need to add the
moon to the system and set its position relative to the earth.
Three.js provides a group object for storing collections:
earthSystem = new THREE.Group();
Then the earth (and moon) can be added to this in a manner that was similar to the way we
added the sun to the scene:
earthSystem.Add(earthMesh);
Don’t forget to set the position of the moon within the earth-moon system, using a function
something like:
moonMesh.position.set(orbitRadius, 0, 0);
A suitable value for orbitRadius is in the range 40 – 60.
The earth’s orbit could be approximated as a circle, and the location of the earth on it could
be computed as the following pseudocode:
earth.position.x = earthOrbitRadius * sin(2pwt);
earth.position.y = earthOrbitRadius * cos(2pwt);
w is the earth’s angular velocity and t is some measurement of time.
It is slightly more realistic to make the orbit an ellipse. To make this more efficient we precompute the co-ordinates of the earth’s orbit. Create a global variable with a suitable name.
The points can be computed by calling the function EllipseCurve. This has arguments
to define:
• The x co-ordinate of the centre point of the ellipse
• The y co-ordinate of the centre point of the ellipse
• The radius of the ellipse in the x direction
• The radius of the ellipse in the y direction
• The start angle for drawing the ellipse (in this case 0 radians)
• The end angle for drawing the ellipse (in this case 2p radians)
• Plus other arguments that can take default values.
You may choose to draw the orbit, in which case you will have to
• Transfer points from the orbit into a line buffer
• Create a geometry (using BufferGeometry) from these points
• Create a material (using LineBasicMaterial) and setting a suitable colour
• Create a line object using the geometry and material
• Rotate the line so it lies in the XZ plane instead of the default XY plane
• Add it to the scene
Animation (Animate();)
The basic animation function will contain the two lines to render the scene and request an
animation frame, as in the previous exercise. If you’ve followed the instructions so far and
now implement this, you’ll see a static scene with the sun, earth and moon in fixed positions
and the earth orbit (if you chose to draw it). The earth and moon should be solid coloured
spheres. The next step is to add movement to the objects. The following code should be
added to Animate() before the two lines you’ve just written.
The sun’s movement is simple. It doesn’t move. You might want to make it rotate if you add
a texture to it, which will be done later.
The earth-moon system’s position could be driven by using a counter that is incremented
for each frame of the animation. But we’ll use the time instead. A time can be obtained by
calling performance.now(). This gives the time in milliseconds since the browser
window was opened. This can be converted into a value in the range [0, 1) which will be
used as an index into the values of the EllipseCurve you defined earlier. In
pseudocode:
time = 0.00001 * performance.now();
t = (time mod 1)
We can get the earth-moon position by reading a point from the EllipseCurve object
(assume it’s called curve):
point = curve.getPoint(t)
Then the earthSystem’s x and z positions can be set to point.x and point.y
respectively. Changing the value of the multiplier (0.00001) will change the earth’s orbital
speed.
The moon’s position is set according to
moon.x = orbitRadius*cos(time*speed)
moon.z = orbitRadius*sin(time*speed)
Time was derived above. Speed is the orbital speed of the moon – you choose a sensible
value.
Optional Enhancements
Some optional enhancements follow.
Changing the viewpoint
It is possible to change the observer’s viewpoint by adding the following controls.
Insert the following line after the other import statement.
import { OrbitControls } from
"https://web.cs.manchester.ac.uk/three/three.jsmaster/examples/jsm/controls/OrbitControls.js";
Add a global variable with a suitable name, possibly controls.
Add the following two lines to the init() function:
controls = new OrbitControls(camera, renderer.domElement);
controls.autoRotate = true;
These add a controller to the scene and allow you to move the viewpoint by clicking and
dragging.
Texturing
The sun, earth and moon can be textured using textures from
https://www.solarsystemscope.com/textures/download/2k_sun.jpg
https://upload.wikimedia.org/wikipedia/commons/a/ac/Earthmap1000x500.jpg
https://svs.gsfc.nasa.gov/vis/a000000/a004700/a004720/lroc_color_poles_1k.jpg
To read these you’ll have to create one texture loader
const loader = new THREE.TextureLoader();
Textures can be loaded using this
var texture = loader.load(‘filename’); OR
var texture = loader.load(‘URL’);
And added to the material of the object you’re creating, by uncommenting the line in the
example above where you created the sun object.
The earth and moon textures can be added similarly, except you’ll add the line
map: texture,
to the material constructor. You’ll also need to delete the color property.
The problem you may encounter when attempting to run the code is that the resource fails
to load, and you have an error message such as
Access to image at <source> from origin 'null' has been blocked by CORS policy
This is a security feature of most modern browsers. You can set up a server on your host to
overcome this problem. Instructions are widely available on the web, specifically here
https://threejs.org/docs/index.html#manual/en/introduction/How-to-run-things-locally
If you’re using Chrome you can alternatively install an extension that allows CORS cross
origin loading (https://chrome.google.com/webstore/detail/allow-cors-accesscontrol/lhobafahddgcelffkeicbaginigeejlf?hl=en). Or in Safari you can explicitly turn off the
CORS checking.
Rotations
You can make the sun, Earth and Moon rotate on their axes, much like the cube rotated in
the previous exercise. Make sure you choose an appropriate length of the “day”.
Clouds
You could add clouds to the Earth. Find a cloud image (e.g.
https://i.stack.imgur.com/B3c7G.jpg) and add it as a transparent texture to a sphere mesh
that is slightly larger than the Earth. Make it rotate slightly slower than the Earth.
Background
You can also create a starry background for the scene. Make a very large sphere mesh – to
make sure it’s big enough to contain everything. Add a texture image of the Milky Way:
https://cdn.eso.org/images/screen/eso0932a.jpg
Make the sphere visible from inside as well as outside by setting the side member of the
material to THREE.DoubleSide.
Submission
Once you have a working solution, capture a short video of your solution, no more than 15
seconds long. It must demonstrate all the properties of your solar system, and not so
quickly that the marker can’t see them clearly (you’ll be penalised for videos that have so
much zooming or camera movement that it’s impossible to see the earth or moon rotating).
ZIP this and your html and submit the file to the Lab 2 area in Blackboard.
Submissions that are not in the ZIP format will not be marked.
Marking Scheme
We will endeavour to mark your work in face-to-face sessions in the scheduled labs.
You will receive marks for:
• The objects being in appropriate locations and moving appropriately.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標(biāo)簽:

掃一掃在手機打開當(dāng)前頁
  • 上一篇:SCC312代做、代寫Java編程語言
  • 下一篇:代寫CSC8208、Java/c++編程語言代做
  • 無相關(guān)信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風(fēng)景名勝區(qū)
    昆明西山國家級風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    日本欧洲视频一区_国模极品一区二区三区_国产熟女一区二区三区五月婷_亚洲AV成人精品日韩一区18p

              9000px;">

                        久久伊人中文字幕| 久久99精品一区二区三区| 亚洲乱码中文字幕| 五月激情综合婷婷| 丁香啪啪综合成人亚洲小说| 欧美老肥妇做.爰bbww视频| 国产亚洲欧美一区在线观看| 亚洲综合色成人| 懂色av一区二区夜夜嗨| 欧美日韩一级黄| 中文字幕高清一区| 免费成人在线观看视频| 91一区在线观看| 久久综合丝袜日本网| 日产国产欧美视频一区精品| 不卡av免费在线观看| 日韩欧美www| 亚洲精品国产高清久久伦理二区| 国产精品一区二区男女羞羞无遮挡| 欧美天堂一区二区三区| 国产精品成人免费| 国产精品自在欧美一区| 91精品国产综合久久久久| 亚洲精品国产精华液| av福利精品导航| 国产日韩欧美精品电影三级在线| 日韩av电影天堂| 欧美男生操女生| 亚洲黄色性网站| 91在线国产福利| 国产精品久久久久久久岛一牛影视 | 无码av免费一区二区三区试看| 成人av综合在线| 国产精品麻豆99久久久久久| 国产精品18久久久久久久久 | 91社区在线播放| 亚洲天堂久久久久久久| 99久久综合精品| 中文字幕一区二区三区在线不卡| 欧美日韩国产色站一区二区三区| 91精品国模一区二区三区| 国产亚洲精品aa午夜观看| 亚洲人成亚洲人成在线观看图片| 亚洲成人激情自拍| 精品一区二区av| 99精品欧美一区二区蜜桃免费| 欧美精品日韩一本| 成人欧美一区二区三区视频网页| 日韩福利视频导航| 亚洲综合一区在线| 97精品国产97久久久久久久久久久久| 中文字幕一区av| 欧美午夜精品一区| 伦理电影国产精品| 国产精品国产三级国产三级人妇 | 成人黄色小视频| 亚洲另类在线一区| 欧美一二三四区在线| 激情综合色综合久久| 国产人久久人人人人爽| 色综合激情五月| 蜜桃av一区二区在线观看| 久久久精品黄色| 欧美写真视频网站| 久久精品国产99久久6| 一区二区三区国产精品| 欧美日韩免费高清一区色橹橹| 青青草国产成人99久久| 国产日韩欧美不卡| 欧美色区777第一页| 精品一区二区久久| 亚洲激情五月婷婷| 精品国产免费久久| 色偷偷成人一区二区三区91| 免费三级欧美电影| 亚洲免费大片在线观看| 精品国产伦理网| 日本精品一区二区三区四区的功能| 蜜臀av性久久久久av蜜臀妖精| 中文字幕欧美国产| 欧美精品国产精品| 91啪在线观看| 精品系列免费在线观看| 亚洲国产综合色| 国产精品久久久久久户外露出 | 久久久久久久综合日本| 欧美日韩精品一区二区三区四区 | 老司机一区二区| 亚洲福利一二三区| 国产精品美女一区二区三区| 国产精品视频免费| 精品亚洲aⅴ乱码一区二区三区| 精品少妇一区二区三区| 国产乱妇无码大片在线观看| 国产亚洲欧美在线| 在线欧美一区二区| 日韩av在线发布| 成人一级视频在线观看| 日本一区中文字幕| 一区二区成人在线| 1区2区3区国产精品| 国产精品超碰97尤物18| 欧美三级欧美一级| 精品影视av免费| 欧美综合亚洲图片综合区| 韩国精品一区二区| 激情文学综合丁香| 狠狠色狠狠色合久久伊人| 日本va欧美va精品| 婷婷成人综合网| 国产大陆a不卡| 韩国欧美国产1区| 国内精品国产成人| 国产在线视视频有精品| 精品制服美女丁香| 另类小说一区二区三区| 久久99精品国产麻豆婷婷洗澡| 三级影片在线观看欧美日韩一区二区| 一区二区三区资源| 一区二区三区欧美日| 亚洲色图清纯唯美| 亚洲视频资源在线| 亚洲一卡二卡三卡四卡| 亚洲国产乱码最新视频| 三级欧美在线一区| 久久精品国产亚洲一区二区三区| 久久99九九99精品| 国产黑丝在线一区二区三区| aa级大片欧美| 欧美性大战久久久久久久蜜臀| 欧美日韩久久一区| 欧美一级高清大全免费观看| 日韩欧美国产综合| 国产欧美一区二区精品性| 中文字幕一区二区视频| 亚洲国产日韩综合久久精品| 午夜欧美一区二区三区在线播放| 日韩高清不卡一区| 国产精品一区二区x88av| 成人av网址在线观看| 色美美综合视频| 91精品国产一区二区三区蜜臀| 日韩欧美国产综合一区| 国产目拍亚洲精品99久久精品| 国产精品久久久久一区二区三区 | 久久精品夜色噜噜亚洲a∨| 中文字幕亚洲在| 香蕉av福利精品导航 | 亚洲成av人片一区二区梦乃| 久久精品国产99| 91麻豆精品一区二区三区| 91麻豆精品国产91久久久资源速度 | 97se亚洲国产综合自在线观| 国产高清不卡二三区| 国产一区二区三区最好精华液| 久久国产精品无码网站| 蜜臀va亚洲va欧美va天堂| 男女男精品视频| 久久精品99国产国产精| 蜜桃免费网站一区二区三区| 蜜臀91精品一区二区三区 | 欧美成人女星排名| 成人免费看视频| 91原创在线视频| 久久综合九色综合欧美亚洲| 亚洲一区二区三区爽爽爽爽爽| 精品一区二区在线免费观看| 色婷婷久久久综合中文字幕| 精品国产乱码91久久久久久网站| 亚洲欧洲成人精品av97| 开心九九激情九九欧美日韩精美视频电影| 福利一区福利二区| 日韩视频在线永久播放| 亚洲图片一区二区| av资源站一区| 国产偷国产偷亚洲高清人白洁 | 亚洲黄色在线视频| 99国产精品久久久久久久久久| 精品国产91洋老外米糕| 日韩二区三区在线观看| 色欧美88888久久久久久影院| 国产蜜臀av在线一区二区三区| 麻豆91精品视频| 欧美日韩激情一区二区| 亚洲一区二区在线观看视频 | 黑人巨大精品欧美黑白配亚洲| 欧美久久久久久久久| 亚洲丝袜美腿综合| 99久久er热在这里只有精品15| 久久亚洲捆绑美女| 精品一区二区影视| 日韩一区二区在线免费观看| 首页国产欧美久久| 欧美日韩午夜影院| 亚洲国产精品久久久男人的天堂| 91毛片在线观看| 亚洲电影在线免费观看| 欧美在线短视频| 午夜久久电影网| 91精品国产乱|