Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the code in Three js. Define a surface other than a sphere. Write a function that populates the surface with starbursts by locating them

Write the code in Three js.

image text in transcribed

Define a surface other than a sphere. Write a function that populates the surface with starbursts by locating them on random points lying on the surface. Function parameters may be defined to (a) identify the surface from a class of surfaces and (b) determine the number of starbursts and some of their characteristics. Problem: write a program that generates a ring of solids rotated at equal intervals around the y-axis and that lie (roughly) in the xz-plane. Your program should include a GUI interface that includes at least the following controls: . . nbrSolids - a slider to set the number of solids. opacity a slider to set opacity from 0 (transparent) to 1 (opaque). scale - a slider to scale the size of each solid. type - a dropdown menu that contains the name of at least three different types of solid. rainbow- a checkbox. . The first two controls are self-explanatory. Scale should not scale the scene as a whole but rather each of the solids in it. Scale is uniform: The selected value is applied uniformly along all three axes. Type selects the type of solid displayed in the scene. You're welcome to use threejs's geometry classes to build these solids. You can also have more than three items in the type menu, and you can also include menu items that generate different solids (e.g., a menu item that generates types at random from a predefined set). If the rainbow checkbox is true, the solids are assigned hues ranging from 0 to 1 in equal increments; if false, the solids are assigned random colors. Define a surface other than a sphere. Write a function that populates the surface with starbursts by locating them on random points lying on the surface. Function parameters may be defined to (a) identify the surface from a class of surfaces and (b) determine the number of starbursts and some of their characteristics. Problem: write a program that generates a ring of solids rotated at equal intervals around the y-axis and that lie (roughly) in the xz-plane. Your program should include a GUI interface that includes at least the following controls: . . nbrSolids - a slider to set the number of solids. opacity a slider to set opacity from 0 (transparent) to 1 (opaque). scale - a slider to scale the size of each solid. type - a dropdown menu that contains the name of at least three different types of solid. rainbow- a checkbox. . The first two controls are self-explanatory. Scale should not scale the scene as a whole but rather each of the solids in it. Scale is uniform: The selected value is applied uniformly along all three axes. Type selects the type of solid displayed in the scene. You're welcome to use threejs's geometry classes to build these solids. You can also have more than three items in the type menu, and you can also include menu items that generate different solids (e.g., a menu item that generates types at random from a predefined set). If the rainbow checkbox is true, the solids are assigned hues ranging from 0 to 1 in equal increments; if false, the solids are assigned random colors

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago