Page 1 of 1

how do I set the ilightscenenode attributes in VB.NET?

Posted: Mon Mar 12, 2007 5:51 am
by twong
i tried doing this:

Torch.LightData.AmbientColor = New Colorf(0.5, 0.5, 0.5)

and get a compiler error saying that it's an expression value therefore it cannot be a target or something like that.

is there a correct way to do this?

i wasted all my free time trying to get this probem solved.

Re: how do I set the ilightscenenode attributes in VB.NET?

Posted: Tue Mar 13, 2007 7:07 am
by Riki
twong wrote:i tried doing this:

Torch.LightData.AmbientColor = New Colorf(0.5, 0.5, 0.5)

and get a compiler error saying that it's an expression value therefore it cannot be a target or something like that.
Hi Twong,

I already answered such questions ...but again:
Torch.LightData returns a Light structure thus the compiler creates a temp variable. When writting
Torch.LightData.AmbientColor = something
You are actually trying tochange the AmbientValue of the temp variable. No can do!

Use:
Light l = Torch.LightData;
l.WhatEver1 = newValue1;
l.WhatEver2 = newValue2;
Torch.LightData = l;

BTW I dont think you will be able to do this with the .NET wrapper.
Thats one of the reasons I ported to the CP wrapper.


Regards