Re: Q: Graphics3D
- To: mathgroup at smc.vnet.net
- Subject: [mg13441] Re: Q: Graphics3D
- From: "Allan Hayes" <hay at haystack.demon.cc.uk>
- Date: Fri, 24 Jul 1998 01:45:30 -0400
- References: <6p6p5s$5fs@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Jens, Just a little extra to your suggestion: >Show[Graphics3D[ > {{SurfaceColor[RGBColor[1,0,0]],TranslateShape[Sphere[],{1,0,0}]}, > {SurfaceColor[RGBColor[0,1,0]],TranslateShape[Sphere[],{-1,0,0}]}} > ]] To avoid the spheres showing that the different colors are coming from lights at different positions (defaults, LightSources -> {{{1.,0.,1.},RGBColor[1,0,0]},{{1.,1.,1.}, RGBColor[0,1,0]},{{0.,1.,1.},RGBColor[0,0,1]}} ) We can, for example,can get the effect of a white light at {1.,1.,1.} by placing all the light sources at this point: Show[Graphics3D[ {{SurfaceColor[RGBColor[1,0,0]],TranslateShape[Sphere[],{1,0,0}]}, {SurfaceColor[RGBColor[0,1,0]],TranslateShape[Sphere[],{-1,0,0}]}} ], LightSources -> {{{1.,1.,1.},RGBColor[1,0,0]},{{1.,1.,1.}, RGBColor[0,1,0]},{{1.,1.,1.},RGBColor[0,0,1]}}] Allan, ------------------------------------------------------------- Allan Hayes Training and Consulting Leicester UK http://www.haystack.demon.co.uk hay at haystack.demon.co.uk voice: +44 (0)116 271 4198 fax: +44(0)116 271 8642 Jens-Peer Kuska wrote in message <6p6p5s$5fs at smc.vnet.net>... >Hi Ulf, > >general to color surfaces You must use the SurfaceColor[] primitive. The >following shows Your colored spheres: > >Show[Graphics3D[ > {{SurfaceColor[RGBColor[1,0,0]],TranslateShape[Sphere[],{1,0,0}]}, > {SurfaceColor[RGBColor[0,1,0]],TranslateShape[Sphere[],{-1,0,0}]}} > ]] > > >To question (1) >The default surface color of Mathematica objects is white. AmbientLight >is a undirected enviroment light, and if You look onto a white body >with a red light it looks red. If You look at a white body with green >light it looks green. Thats why You see a red and a green sphere in >Your a and b graphics. If You combine two graphics objects the options >for display are taken from the first graphics object. So the >combination uses the red ambient light of graphics a and the two white >spheres look red. > >Hope that helps > Jens >-----Original Message----- >From: Ulf Saalmann <us at mpipks-dresden.mpg.de> To: mathgroup at smc.vnet.net To: mathgroup at smc.vnet.net >Subject: [mg13441] [mg13320] Q: Graphics3D > > >>Hello, >> >>using the following functions >> >>------------------------------------------------- >>Needs["Graphics`Shapes`"]; >> >>SetOptions[Graphics3D,LightSources->{}]; >> >>a=Graphics3D[TranslateShape[Sphere[],{+1,0,0}], >> AmbientLight->RGBColor[1,0,0]]; >>b=Graphics3D[TranslateShape[Sphere[],{-1,0,0}], >> AmbientLight->RGBColor[0,1,0]]; >> >>Show[{a,b}]; >>------------------------------------------------- >> >>Mathematica shows two red spheres. >> >> >>(1) Why I don't get a red and green one? >> >>(2) How to obtain a red and green one (with Lightning->True)? >> >> >>Thanks for any help. Ulf (us at mpipks-dresden.mpg.de) >> >> > >