aaronsun7 / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 1 forks source link

EnvMapMaterial backEnvMap doesn't display when specified #221

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

var light : PointLight3D = new PointLight3D( true, false );
light.position.x = 300;
light.position.y = 300;
light.position.z = 0;
var env : EnvMapMaterial = new EnvMapMaterial( light, 
    new BitmapData(1, 1, false, 0xFF0000),  // red
    new BitmapData(1, 1, false, 0x00FF00)   // green
);
var sphere :Sphere = new Sphere( env, 100, 20, 20);

--------------------------------------------------------
What is the expected output? What do you see instead?
- Expect to see a half red/half green sphere. The green texture should be
applied to the faces facing away from the light. 
- Instead, the faces are black

--------------------------------------------------------
What version of the product are you using? On what operating system?
- Source, last commit 920 (2:48:49 PM Tuesday August 11 2009)
- Windows XP SP3

--------------------------------------------------------
Please provide any additional information below.

- constructor in EnvMapMaterial is self-referencing the member variable
"backenvmap" instead of "backEnvMap". Fix is below:

public function EnvMapMaterial(light:LightObject3D, lightMap:BitmapData,
backEnvMap:BitmapData=null, ambientColor:int = 0)
{
    super();
    this.light = light;
    this.lightMap = lightMap;
    if(!backenvmap){
        this.backenvmap = new BitmapData(1,1,false, ambientColor);
    }else {
>       //this.backenvmap = backenvmap; WRONG
>       this.backenvmap = backEnvMap; // RIGHT
    }
}

Original issue reported on code.google.com by cod3monk...@gmail.com on 18 Aug 2009 at 6:25

GoogleCodeExporter commented 8 years ago
Correction...

public function EnvMapMaterial(light:LightObject3D, lightMap:BitmapData,
backEnvMap:BitmapData=null, ambientColor:int = 0)
{
    super();
    this.light = light;
    this.lightMap = lightMap;
>   if(!backEnvMap){
        this.backenvmap = new BitmapData(1,1,false, ambientColor);
    }else {
>       this.backenvmap = backEnvMap;
    }
}

Original comment by cod3monk...@gmail.com on 18 Aug 2009 at 6:34