light

What is a normal in OpenGL?

佐手、 提交于 2019-12-20 17:39:34
问题 I heard that I should use normals instead of colors, because colors are deprecated. (Is that true?) Normals have something to do with the reflection of light, but I can't find a clear and intuitive explanation. What is a normal? 回答1: A normal in general is a unit vector whose direction is perpendicular to a surface at a specific point. Therefore it tells you in which direction a surface is facing. The main use case for normals are lighting calculations, where you have to determine the angle

夜光带你走进 Java 成神之路(二十八)擅长的领域

£可爱£侵袭症+ 提交于 2019-12-20 06:53:21
夜光序言: 人在不断成长中最重要的事是学会喜欢自己吧。人在不断成长中最重要的事是学会喜欢自己吧。 正文: 以道御术 / 以术识道 package 命令模式.遥控器; //我们写一下客户端,来调用方法 public class Client { public static void main(String[] args) { //使用命令设计模式 完成通过遥控器,对点灯的操作 //创建点灯的对象(接受者) LightReceiver lightReceiver = new LightReceiver(); //创建点灯相关的开关命令 LightOnCommand lightOnCommand = new LightOnCommand(lightReceiver); LightOffCommand lightOffCommand = new LightOffCommand(lightReceiver); //接下来,需要一个遥控器 RemoteController remoteController = new RemoteController(); //给我们的遥控器设置命令,比如 no = 0 是点灯的开和关的操作 remoteController.setCommand(0,lightOnCommand,lightOffCommand); System.out.println("--

Shading mask algorithm for radiation calculations

帅比萌擦擦* 提交于 2019-12-19 10:52:22
问题 I am working on a software (Ruby - Sketchup) to calculate the radiation (sun, sky and surrounding buildings) within urban development at pedestrian level. The final goal is to be able to create a contour map that shows the level of total radiation. With total radiation I mean shortwave (light) and longwave(heat). (To give you an idea: http://www.iaacblog.com/maa2011-2012-digitaltools/files/2012/01/Insolation-Analysis-All-Year.jpg) I know there are several existing software that do this, but I

Trying to fit a sine function to phased light curve

有些话、适合烂在心里 提交于 2019-12-18 07:24:28
问题 import numpy as np import matplotlib.pyplot as plt from lmfit import Model,Parameters f2= "KELT_N16_lc_006261_V01_west_tfa.dat" t2="TIMES" # file name NewData2 = np.loadtxt(t2, dtype=float, unpack=True) NewData = np.loadtxt(f2,dtype=float, unpack=True, usecols=(1,)) flux = NewData time= NewData2 new_flux=np.hstack([flux,flux]) # fold period = 2.0232 # period (must be known already!) foldTimes = ((time)/ period) # divide by period to convert to phase foldTimes = foldTimes % 1 # take fractional

What's going wrong with my timed Traffic Lights program?

◇◆丶佛笑我妖孽 提交于 2019-12-13 08:48:10
问题 I don't know why as it seems to be all correct and there are no errors in console. It always starts on green.png and stays there? I'm trying to make a timed traffic lights sequence that can start as soon as the page is loaded without a button. <!DOCTYPE html> <html> <head> </head> <body> <h2>Traffic Lights Program</h2> <div class="light"><img src="Blank.png" style="width:100px;height:228px;"/></div> <script> trafficLight = "green"; var trafficLights = ["Red.png","RedYellow.png","Yellow.png",

Adding a directional light to a transforming cube in vanilla wegl

℡╲_俬逩灬. 提交于 2019-12-12 20:55:35
问题 How can I add a direction light to a transforming cube in webGL. I know it requires normals and i've add them in the snippet (i've commented them out) It will also require some math in the vertex shader. unfortunatly this code doesnt work when i uncomment. attribute vec4 coords; uniform mat4 transformMatrix; attribute vec3 normal; attribute vec4 colors; uniform vec3 lightColor; uniform vec3 lightDirection; varying vec4 varyingColors; uniform mat4 perspectiveMatrix; void main(void) { vec3 norm

WebGL rendering on Firefox - Light effects show darker than in Chrome

百般思念 提交于 2019-12-12 03:24:53
问题 I have a scene where one light is present, and diamonds. Light properties: Point light, position: 0 0 30, intensity: 1, distance 60, color: White. The diamonds material is Phong, color:Red, no emissive, specular: White, shininess 10. On Chrome, the diamons shine as suppose to, but on Firefox the diamonds not shine at all, and looks very dark (like have something black on it). I have tried to use both Firefox on desktop Windows and Android mobile phone. I would like to ask what I am missing?

LED & Camera always ON

主宰稳场 提交于 2019-12-12 00:01:57
问题 I'm trying to open the device camera an activate immediately the LED light of that device (android/iOS). I've tried the appcelerator ti.media events but didn't work, neither this module: Ti.Light. Found this on this link activate-iphone-4-led-light Hey guys! For the flash stuff you have to check the property: Ti.Media.cameraFlashMode (case sensitive) To change it you can use Ti.Media.setCameraFlashMode(PARAM) . PARAM could be: Ti.Media.CAMERA_FLASH_OFF , Ti.Media.CAMERA_FLASH_ON, Ti.Media

really weird ghosty shadows using three.js

只谈情不闲聊 提交于 2019-12-11 20:19:17
问题 I'm using three.js to make some solar system, all my objects are sphere (suns and planets), but I found this really weird and ghosty square shadow: Another ghost shadow seems to be that, the shadow that sphere A casts on sphere B, appears on both the front and back side of sphere B, like this: I am so confused since I don't really remember create any square stuff and I've checked my code for like million times without any finding. Finally, I dismissed all the lights in the world, and set the

Issues referencing a light in Unity

不羁岁月 提交于 2019-12-11 06:56:19
问题 I'm trying to make a driving game in Unity, and as part of it, I'm trying to make a traffic light blink on and off. This is my script, which I attached to the traffic light. The hierarchy of the traffic light is: TrafficLight_A (the base traffic light) RedLight (the light I'm trying to make flash) using UnityEngine; using System.Collections; public class Blink_Light : MonoBehaviour { public float totalSeconds = 2; // The total of seconds the flash wil last public float maxIntensity = 8; //