check out Darcey's example. It might help http://www.allforthecode.co.uk/aftc/forum/user/modules/forum/article.php?index=4&subindex=5&aid=197
On Jun 7, 10:31 am, Matt Przybylski <m...@reintroducing.com> wrote: > Choons, > My view.render() is not only being called on the slider update (which > I did just to make sure, but I also traced it out and it is updating) > but the enterframe is also still running in the background so either > way changing those values should have updated the scene. > > /** > * > */ > protected function handleEnterFrame($evt:Event):void > { > ... keyboard controls code > > _view.render(); > > } > > /** > * > */ > protected function handleLightValueChanged($evt:Event):void > { > directionalLight.ambient = directionalLight.diffuse = > directionalLight.specular = lightSlider.value; > trace(directionalLight.ambient, directionalLight.diffuse, > directionalLight.specular); > _view.render(); > > } > > - Matt > > On Jun 7, 12:02 am, Choons <chadkim...@gmail.com> wrote: > > > > > > > > > can you post the code you are using? Typically the view.render() call > > is done on the enter frame event so you might have an issue where your > > slider value isn't getting updated > > > On Jun 6, 11:47 pm, Matt Przybylski <m...@reintroducing.com> wrote: > > > > Can anyone please help me with this? I can't seem to figure it out... > > > > - Matt > > > > On Jun 6, 1:50 pm, Matt Przybylski <m...@reintroducing.com> wrote: > > > > > Sorry I keep posting, but should also mention I'm using > > > > DirectionalLight3D. Not sure if that makes a difference or not but > > > > thought I'd just point that out. > > > > > - Matt > > > > > On Jun 6, 1:49 pm, Matt Przybylski <m...@reintroducing.com> wrote: > > > > > > Actually, I just tried changing all 3 at the same time and it worked > > > > > to start the scene but again did nothing if changing the values with > > > > > the slider. I even have a _view.render() call in the slider on > > > > > change. > > > > > > - Matt > > > > > > On Jun 6, 1:46 pm, Matt Przybylski <m...@reintroducing.com> wrote: > > > > > > > Hey guys, > > > > > > I've got a scene with a light in it and a slider to control the > > > > > > light's brightness. I set the slider from 0 to 1 and on change I > > > > > > set > > > > > > light.brightness = slider.value. Problem is, it doesn't work. > > > > > > What's > > > > > > the issue here? > > > > > > > I looked through the past group questions and found a post saying > > > > > > brightness is only available when you first create the light and > > > > > > cannot be controlled. If this is true, how do I then control the > > > > > > brightness of the scene? That same post also said you use the > > > > > > diffuse, specular, and ambient values but those are all different > > > > > > initially (.5, 1, .5, respectively) so I suppose I could set them > > > > > > all > > > > > > to 1 to start off though I don't think that will give me the desired > > > > > > effects I want and then not sure if that would even work with the > > > > > > brightness. Any insight into how lighting works would be greatly > > > > > > appreciated. > > > > > > > - Matt