Damn the lighting... (in VB) 
Author Message
 Damn the lighting... (in VB)

OK...  I've been messing around with DirectX 8.1 for a
while now and I've come accross a weird problem with the
lighting.

Keep in mind I am using VB for this paticular development
exercise.  I've done the exact same things in C++ and they
work fine.

Anyway to get to the point, there are some lighting
examples in the directX 8 help.  When I get to the
following line it generates an automation error.  I know
about automation errors and understand the nature.  
However, I don't know enough about DirectX to make a clear
determination of the problem.

[Direct3DDevice].SetLight 0, [LightObject]

(Also keep in mind the following:
  I did create the device, and as a matter a fact I am
redering fine.  Or was until I introduced lights.)

If you have the DirectX help (for VB) installed the
following URL should take you to the example I'm refering
to.  Just paste it in your browser.


\directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get
tingStarted/Tutorials/VB/4/Step2_2.htm



Mon, 07 Feb 2005 00:52:18 GMT  
 Damn the lighting... (in VB)
did you see the SDK VB tutorial on lights?

'---------------------------------------------------------------------------
--
' Name: SetupLights()
' Desc: Sets up the lights and materials for the scene.
'---------------------------------------------------------------------------
--
Sub SetupLights()

    Dim col As D3DCOLORVALUE

    ' Set up a material. The material here just has the diffuse and ambient
    ' colors set to yellow. Note that only one material can be used at a
time.
    Dim mtrl As D3DMATERIAL8
    With col:    .r = 1: .g = 1: .b = 0: .a = 1:   End With
    mtrl.diffuse = col
    mtrl.Ambient = col
    g_D3DDevice.SetMaterial mtrl

    ' Set up a white, directional light, with an oscillating direction.
    ' Note that many lights may be active at a time (but each one slows down
    ' the rendering of our scene). However, here we are just using one.
Also,
    ' we need to set the D3DRS_LIGHTING renderstate to enable lighting

    Dim light As D3DLIGHT8
    light.Type = D3DLIGHT_DIRECTIONAL
    light.diffuse.r = 1#
    light.diffuse.g = 1#
    light.diffuse.b = 1#
    light.Direction.x = Cos(Timer * 2)
    light.Direction.y = 1#
    light.Direction.z = Sin(Timer * 2)
    light.Range = 1000#

    g_D3DDevice.SetLight 0, light                   'let d3d know about the
light
    g_D3DDevice.LightEnable 0, 1                    'turn it on
    g_D3DDevice.SetRenderState D3DRS_LIGHTING, 1    'make sure lighting is
enabled

    ' Finally, turn on some ambient light.
    ' Ambient light is light that scatters and lights all objects evenly
    g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H202020

End Sub

--

Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> OK...  I've been messing around with DirectX 8.1 for a
> while now and I've come accross a weird problem with the
> lighting.

> Keep in mind I am using VB for this paticular development
> exercise.  I've done the exact same things in C++ and they
> work fine.

> Anyway to get to the point, there are some lighting
> examples in the directX 8 help.  When I get to the
> following line it generates an automation error.  I know
> about automation errors and understand the nature.
> However, I don't know enough about DirectX to make a clear
> determination of the problem.

> [Direct3DDevice].SetLight 0, [LightObject]

> (Also keep in mind the following:
>   I did create the device, and as a matter a fact I am
> redering fine.  Or was until I introduced lights.)

> If you have the DirectX help (for VB) installed the
> following URL should take you to the example I'm refering
> to.  Just paste it in your browser.


> \directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get
> tingStarted/Tutorials/VB/4/Step2_2.htm



Mon, 07 Feb 2005 01:15:34 GMT  
 Damn the lighting... (in VB)
Yes I did...

That's what I'm saying...  I get the automation error
running the exact same code (With minor value adjusts
ect.).

I get the error...  yet I can render with the device and
do everything else.

Quote:
>-----Original Message-----
>did you see the SDK VB tutorial on lights?

>'---------------------------------------------------------
------------------
>--
>' Name: SetupLights()
>' Desc: Sets up the lights and materials for the scene.
>'---------------------------------------------------------
------------------
>--
>Sub SetupLights()

>    Dim col As D3DCOLORVALUE

>    ' Set up a material. The material here just has the
diffuse and ambient
>    ' colors set to yellow. Note that only one material
can be used at a
>time.
>    Dim mtrl As D3DMATERIAL8
>    With col:    .r = 1: .g = 1: .b = 0: .a = 1:   End
With
>    mtrl.diffuse = col
>    mtrl.Ambient = col
>    g_D3DDevice.SetMaterial mtrl

>    ' Set up a white, directional light, with an

oscillating direction.

- Show quoted text -

Quote:
>    ' Note that many lights may be active at a time (but
each one slows down
>    ' the rendering of our scene). However, here we are
just using one.
>Also,
>    ' we need to set the D3DRS_LIGHTING renderstate to
enable lighting

>    Dim light As D3DLIGHT8
>    light.Type = D3DLIGHT_DIRECTIONAL
>    light.diffuse.r = 1#
>    light.diffuse.g = 1#
>    light.diffuse.b = 1#
>    light.Direction.x = Cos(Timer * 2)
>    light.Direction.y = 1#
>    light.Direction.z = Sin(Timer * 2)
>    light.Range = 1000#

>    g_D3DDevice.SetLight 0, light                   'let
d3d know about the
>light
>    g_D3DDevice.LightEnable 0, 1                    'turn
it on
>    g_D3DDevice.SetRenderState D3DRS_LIGHTING, 1    'make
sure lighting is
>enabled

>    ' Finally, turn on some ambient light.
>    ' Ambient light is light that scatters and lights all
objects evenly
>    g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H202020

>End Sub

>--

>Phil Taylor
>PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
screensavers, and a
>few more bits and bobs.
>http://msdn.microsoft.com/directx
>This posting is provided "AS IS" with no warranties, and
confers no rights.


>> OK...  I've been messing around with DirectX 8.1 for a
>> while now and I've come accross a weird problem with the
>> lighting.

>> Keep in mind I am using VB for this paticular
development
>> exercise.  I've done the exact same things in C++ and
they
>> work fine.

>> Anyway to get to the point, there are some lighting
>> examples in the directX 8 help.  When I get to the
>> following line it generates an automation error.  I know
>> about automation errors and understand the nature.
>> However, I don't know enough about DirectX to make a
clear
>> determination of the problem.

>> [Direct3DDevice].SetLight 0, [LightObject]

>> (Also keep in mind the following:
>>   I did create the device, and as a matter a fact I am
>> redering fine.  Or was until I introduced lights.)

>> If you have the DirectX help (for VB) installed the
>> following URL should take you to the example I'm
refering
>> to.  Just paste it in your browser.



\directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get

- Show quoted text -

Quote:
>> tingStarted/Tutorials/VB/4/Step2_2.htm

>.



Mon, 07 Feb 2005 01:23:21 GMT  
 Damn the lighting... (in VB)
does the debug runtime provide any additional information?

--

Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> Yes I did...

> That's what I'm saying...  I get the automation error
> running the exact same code (With minor value adjusts
> ect.).

> I get the error...  yet I can render with the device and
> do everything else.

> >-----Original Message-----
> >did you see the SDK VB tutorial on lights?

> >'---------------------------------------------------------
> ------------------
> >--
> >' Name: SetupLights()
> >' Desc: Sets up the lights and materials for the scene.
> >'---------------------------------------------------------
> ------------------
> >--
> >Sub SetupLights()

> >    Dim col As D3DCOLORVALUE

> >    ' Set up a material. The material here just has the
> diffuse and ambient
> >    ' colors set to yellow. Note that only one material
> can be used at a
> >time.
> >    Dim mtrl As D3DMATERIAL8
> >    With col:    .r = 1: .g = 1: .b = 0: .a = 1:   End
> With
> >    mtrl.diffuse = col
> >    mtrl.Ambient = col
> >    g_D3DDevice.SetMaterial mtrl

> >    ' Set up a white, directional light, with an
> oscillating direction.
> >    ' Note that many lights may be active at a time (but
> each one slows down
> >    ' the rendering of our scene). However, here we are
> just using one.
> >Also,
> >    ' we need to set the D3DRS_LIGHTING renderstate to
> enable lighting

> >    Dim light As D3DLIGHT8
> >    light.Type = D3DLIGHT_DIRECTIONAL
> >    light.diffuse.r = 1#
> >    light.diffuse.g = 1#
> >    light.diffuse.b = 1#
> >    light.Direction.x = Cos(Timer * 2)
> >    light.Direction.y = 1#
> >    light.Direction.z = Sin(Timer * 2)
> >    light.Range = 1000#

> >    g_D3DDevice.SetLight 0, light                   'let
> d3d know about the
> >light
> >    g_D3DDevice.LightEnable 0, 1                    'turn
> it on
> >    g_D3DDevice.SetRenderState D3DRS_LIGHTING, 1    'make
> sure lighting is
> >enabled

> >    ' Finally, turn on some ambient light.
> >    ' Ambient light is light that scatters and lights all
> objects evenly
> >    g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H202020

> >End Sub

> >--

> >Phil Taylor
> >PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
> screensavers, and a
> >few more bits and bobs.
> >http://msdn.microsoft.com/directx
> >This posting is provided "AS IS" with no warranties, and
> confers no rights.


> >> OK...  I've been messing around with DirectX 8.1 for a
> >> while now and I've come accross a weird problem with the
> >> lighting.

> >> Keep in mind I am using VB for this paticular
> development
> >> exercise.  I've done the exact same things in C++ and
> they
> >> work fine.

> >> Anyway to get to the point, there are some lighting
> >> examples in the directX 8 help.  When I get to the
> >> following line it generates an automation error.  I know
> >> about automation errors and understand the nature.
> >> However, I don't know enough about DirectX to make a
> clear
> >> determination of the problem.

> >> [Direct3DDevice].SetLight 0, [LightObject]

> >> (Also keep in mind the following:
> >>   I did create the device, and as a matter a fact I am
> >> redering fine.  Or was until I introduced lights.)

> >> If you have the DirectX help (for VB) installed the
> >> following URL should take you to the example I'm
> refering
> >> to.  Just paste it in your browser.


> \directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get
> >> tingStarted/Tutorials/VB/4/Step2_2.htm

> >.



Mon, 07 Feb 2005 02:34:13 GMT  
 Damn the lighting... (in VB)
If it's supposed to show up in the imediate window like in
the C++ dev environment.  No, nothing shows up at all.  
Else where do I go to check the debug info.

Sorry about this....  But I'll never forget.  ;)

Also...  if I haven't said it yet.  Thanks for all your
prompt responses and I'm sure it's something stupid that
I'm overlooking.  Thanks for your patients as well.

Quote:
>-----Original Message-----
>does the debug runtime provide any additional information?

>--

>Phil Taylor
>PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
screensavers, and a
>few more bits and bobs.
>http://msdn.microsoft.com/directx
>This posting is provided "AS IS" with no warranties, and
confers no rights.


>> Yes I did...

>> That's what I'm saying...  I get the automation error
>> running the exact same code (With minor value adjusts
>> ect.).

>> I get the error...  yet I can render with the device and
>> do everything else.

>> >-----Original Message-----
>> >did you see the SDK VB tutorial on lights?

>> >'------------------------------------------------------
---
>> ------------------
>> >--
>> >' Name: SetupLights()
>> >' Desc: Sets up the lights and materials for the scene.
>> >'------------------------------------------------------
---
>> ------------------
>> >--
>> >Sub SetupLights()

>> >    Dim col As D3DCOLORVALUE

>> >    ' Set up a material. The material here just has the
>> diffuse and ambient
>> >    ' colors set to yellow. Note that only one material
>> can be used at a
>> >time.
>> >    Dim mtrl As D3DMATERIAL8
>> >    With col:    .r = 1: .g = 1: .b = 0: .a = 1:   End
>> With
>> >    mtrl.diffuse = col
>> >    mtrl.Ambient = col
>> >    g_D3DDevice.SetMaterial mtrl

>> >    ' Set up a white, directional light, with an
>> oscillating direction.
>> >    ' Note that many lights may be active at a time
(but
>> each one slows down
>> >    ' the rendering of our scene). However, here we are
>> just using one.
>> >Also,
>> >    ' we need to set the D3DRS_LIGHTING renderstate to
>> enable lighting

>> >    Dim light As D3DLIGHT8
>> >    light.Type = D3DLIGHT_DIRECTIONAL
>> >    light.diffuse.r = 1#
>> >    light.diffuse.g = 1#
>> >    light.diffuse.b = 1#
>> >    light.Direction.x = Cos(Timer * 2)
>> >    light.Direction.y = 1#
>> >    light.Direction.z = Sin(Timer * 2)
>> >    light.Range = 1000#

>> >    g_D3DDevice.SetLight 0,

light                   'let
Quote:
>> d3d know about the
>> >light
>> >    g_D3DDevice.LightEnable 0,

1                    'turn

- Show quoted text -

Quote:
>> it on
>> >    g_D3DDevice.SetRenderState D3DRS_LIGHTING,
1    'make
>> sure lighting is
>> >enabled

>> >    ' Finally, turn on some ambient light.
>> >    ' Ambient light is light that scatters and lights
all
>> objects evenly
>> >    g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H202020

>> >End Sub

>> >--

>> >Phil Taylor
>> >PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
>> screensavers, and a
>> >few more bits and bobs.
>> >http://msdn.microsoft.com/directx
>> >This posting is provided "AS IS" with no warranties,
and
>> confers no rights.


>> >> OK...  I've been messing around with DirectX 8.1 for
a
>> >> while now and I've come accross a weird problem with
the
>> >> lighting.

>> >> Keep in mind I am using VB for this paticular
>> development
>> >> exercise.  I've done the exact same things in C++ and
>> they
>> >> work fine.

>> >> Anyway to get to the point, there are some lighting
>> >> examples in the directX 8 help.  When I get to the
>> >> following line it generates an automation error.  I
know
>> >> about automation errors and understand the nature.
>> >> However, I don't know enough about DirectX to make a
>> clear
>> >> determination of the problem.

>> >> [Direct3DDevice].SetLight 0, [LightObject]

>> >> (Also keep in mind the following:
>> >>   I did create the device, and as a matter a fact I
am
>> >> redering fine.  Or was until I introduced lights.)

>> >> If you have the DirectX help (for VB) installed the
>> >> following URL should take you to the example I'm
>> refering
>> >> to.  Just paste it in your browser.



\directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get

- Show quoted text -

Quote:
>> >> tingStarted/Tutorials/VB/4/Step2_2.htm

>> >.

>.



Mon, 07 Feb 2005 02:49:19 GMT  
 Damn the lighting... (in VB)
the debug output pane in the dev environment, or the dbmon tool in the SDK
allow viewing the debug runtime output.

do none of the SDK samples use lights?

--

Phil Taylor
PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D screensavers, and a
few more bits and bobs.
http://msdn.microsoft.com/directx
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> If it's supposed to show up in the imediate window like in
> the C++ dev environment.  No, nothing shows up at all.
> Else where do I go to check the debug info.

> Sorry about this....  But I'll never forget.  ;)

> Also...  if I haven't said it yet.  Thanks for all your
> prompt responses and I'm sure it's something stupid that
> I'm overlooking.  Thanks for your patients as well.

> >-----Original Message-----
> >does the debug runtime provide any additional information?

> >--

> >Phil Taylor
> >PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
> screensavers, and a
> >few more bits and bobs.
> >http://msdn.microsoft.com/directx
> >This posting is provided "AS IS" with no warranties, and
> confers no rights.


> >> Yes I did...

> >> That's what I'm saying...  I get the automation error
> >> running the exact same code (With minor value adjusts
> >> ect.).

> >> I get the error...  yet I can render with the device and
> >> do everything else.

> >> >-----Original Message-----
> >> >did you see the SDK VB tutorial on lights?

> >> >'------------------------------------------------------
> ---
> >> ------------------
> >> >--
> >> >' Name: SetupLights()
> >> >' Desc: Sets up the lights and materials for the scene.
> >> >'------------------------------------------------------
> ---
> >> ------------------
> >> >--
> >> >Sub SetupLights()

> >> >    Dim col As D3DCOLORVALUE

> >> >    ' Set up a material. The material here just has the
> >> diffuse and ambient
> >> >    ' colors set to yellow. Note that only one material
> >> can be used at a
> >> >time.
> >> >    Dim mtrl As D3DMATERIAL8
> >> >    With col:    .r = 1: .g = 1: .b = 0: .a = 1:   End
> >> With
> >> >    mtrl.diffuse = col
> >> >    mtrl.Ambient = col
> >> >    g_D3DDevice.SetMaterial mtrl

> >> >    ' Set up a white, directional light, with an
> >> oscillating direction.
> >> >    ' Note that many lights may be active at a time
> (but
> >> each one slows down
> >> >    ' the rendering of our scene). However, here we are
> >> just using one.
> >> >Also,
> >> >    ' we need to set the D3DRS_LIGHTING renderstate to
> >> enable lighting

> >> >    Dim light As D3DLIGHT8
> >> >    light.Type = D3DLIGHT_DIRECTIONAL
> >> >    light.diffuse.r = 1#
> >> >    light.diffuse.g = 1#
> >> >    light.diffuse.b = 1#
> >> >    light.Direction.x = Cos(Timer * 2)
> >> >    light.Direction.y = 1#
> >> >    light.Direction.z = Sin(Timer * 2)
> >> >    light.Range = 1000#

> >> >    g_D3DDevice.SetLight 0,
> light                   'let
> >> d3d know about the
> >> >light
> >> >    g_D3DDevice.LightEnable 0,
> 1                    'turn
> >> it on
> >> >    g_D3DDevice.SetRenderState D3DRS_LIGHTING,
> 1    'make
> >> sure lighting is
> >> >enabled

> >> >    ' Finally, turn on some ambient light.
> >> >    ' Ambient light is light that scatters and lights
> all
> >> objects evenly
> >> >    g_D3DDevice.SetRenderState D3DRS_AMBIENT, &H202020

> >> >End Sub

> >> >--

> >> >Phil Taylor
> >> >PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
> >> screensavers, and a
> >> >few more bits and bobs.
> >> >http://msdn.microsoft.com/directx
> >> >This posting is provided "AS IS" with no warranties,
> and
> >> confers no rights.


> >> >> OK...  I've been messing around with DirectX 8.1 for
> a
> >> >> while now and I've come accross a weird problem with
> the
> >> >> lighting.

> >> >> Keep in mind I am using VB for this paticular
> >> development
> >> >> exercise.  I've done the exact same things in C++ and
> >> they
> >> >> work fine.

> >> >> Anyway to get to the point, there are some lighting
> >> >> examples in the directX 8 help.  When I get to the
> >> >> following line it generates an automation error.  I
> know
> >> >> about automation errors and understand the nature.
> >> >> However, I don't know enough about DirectX to make a
> >> clear
> >> >> determination of the problem.

> >> >> [Direct3DDevice].SetLight 0, [LightObject]

> >> >> (Also keep in mind the following:
> >> >>   I did create the device, and as a matter a fact I
> am
> >> >> redering fine.  Or was until I introduced lights.)

> >> >> If you have the DirectX help (for VB) installed the
> >> >> following URL should take you to the example I'm
> >> refering
> >> >> to.  Just paste it in your browser.


> \directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get
> >> >> tingStarted/Tutorials/VB/4/Step2_2.htm

> >> >.

> >.



Mon, 07 Feb 2005 05:34:01 GMT  
 Damn the lighting... (in VB)
I will keep trying.  I'll just compile one of the examples
with lighting and give it a whirl.  If it works then I'm
doing something wrong, otherwise I'll post another later.

Quote:
>-----Original Message-----
>the debug output pane in the dev environment, or the

dbmon tool in the SDK
Quote:
>allow viewing the debug runtime output.

>do none of the SDK samples use lights?

>--

>Phil Taylor
>PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
screensavers, and a
>few more bits and bobs.
>http://msdn.microsoft.com/directx
>This posting is provided "AS IS" with no warranties, and
confers no rights.


>> If it's supposed to show up in the imediate window like
in
>> the C++ dev environment.  No, nothing shows up at all.
>> Else where do I go to check the debug info.

>> Sorry about this....  But I'll never forget.  ;)

>> Also...  if I haven't said it yet.  Thanks for all your
>> prompt responses and I'm sure it's something stupid that
>> I'm overlooking.  Thanks for your patients as well.

>> >-----Original Message-----
>> >does the debug runtime provide any additional
information?

>> >--

>> >Phil Taylor
>> >PM : DirectX SDK, Managed DirectX, Windows XP Inbox 3D
>> screensavers, and a
>> >few more bits and bobs.
>> >http://msdn.microsoft.com/directx
>> >This posting is provided "AS IS" with no warranties,
and
>> confers no rights.


>> >> Yes I did...

>> >> That's what I'm saying...  I get the automation error
>> >> running the exact same code (With minor value adjusts
>> >> ect.).

>> >> I get the error...  yet I can render with the device
and
>> >> do everything else.

>> >> >-----Original Message-----
>> >> >did you see the SDK VB tutorial on lights?

>> >> >'---------------------------------------------------
---
>> ---
>> >> ------------------
>> >> >--
>> >> >' Name: SetupLights()
>> >> >' Desc: Sets up the lights and materials for the
scene.
>> >> >'---------------------------------------------------
---
>> ---
>> >> ------------------
>> >> >--
>> >> >Sub SetupLights()

>> >> >    Dim col As D3DCOLORVALUE

>> >> >    ' Set up a material. The material here just has
the
>> >> diffuse and ambient
>> >> >    ' colors set to yellow. Note that only one
material
>> >> can be used at a
>> >> >time.
>> >> >    Dim mtrl As D3DMATERIAL8
>> >> >    With col:    .r = 1: .g = 1: .b = 0: .a = 1:  
End
>> >> With
>> >> >    mtrl.diffuse = col
>> >> >    mtrl.Ambient = col
>> >> >    g_D3DDevice.SetMaterial mtrl

>> >> >    ' Set up a white, directional light, with an
>> >> oscillating direction.
>> >> >    ' Note that many lights may be active at a time
>> (but
>> >> each one slows down
>> >> >    ' the rendering of our scene). However, here we
are
>> >> just using one.
>> >> >Also,
>> >> >    ' we need to set the D3DRS_LIGHTING renderstate
to
>> >> enable lighting

>> >> >    Dim light As D3DLIGHT8
>> >> >    light.Type = D3DLIGHT_DIRECTIONAL
>> >> >    light.diffuse.r = 1#
>> >> >    light.diffuse.g = 1#
>> >> >    light.diffuse.b = 1#
>> >> >    light.Direction.x = Cos(Timer * 2)
>> >> >    light.Direction.y = 1#
>> >> >    light.Direction.z = Sin(Timer * 2)
>> >> >    light.Range = 1000#

>> >> >    g_D3DDevice.SetLight 0,
>> light                   'let
>> >> d3d know about the
>> >> >light
>> >> >    g_D3DDevice.LightEnable 0,
>> 1                    'turn
>> >> it on
>> >> >    g_D3DDevice.SetRenderState D3DRS_LIGHTING,
>> 1    'make
>> >> sure lighting is
>> >> >enabled

>> >> >    ' Finally, turn on some ambient light.
>> >> >    ' Ambient light is light that scatters and
lights
>> all
>> >> objects evenly
>> >> >    g_D3DDevice.SetRenderState D3DRS_AMBIENT,
&H202020

>> >> >End Sub

>> >> >--

>> >> >Phil Taylor
>> >> >PM : DirectX SDK, Managed DirectX, Windows XP Inbox
3D
>> >> screensavers, and a
>> >> >few more bits and bobs.
>> >> >http://msdn.microsoft.com/directx
>> >> >This posting is provided "AS IS" with no warranties,
>> and
>> >> confers no rights.


>> >> >> OK...  I've been messing around with DirectX 8.1
for
>> a
>> >> >> while now and I've come accross a weird problem
with
>> the
>> >> >> lighting.

>> >> >> Keep in mind I am using VB for this paticular
>> >> development
>> >> >> exercise.  I've done the exact same things in C++
and
>> >> they
>> >> >> work fine.

>> >> >> Anyway to get to the point, there are some
lighting
>> >> >> examples in the directX 8 help.  When I get to the
>> >> >> following line it generates an automation error.  
I
>> know
>> >> >> about automation errors and understand the nature.
>> >> >> However, I don't know enough about DirectX to
make a
>> >> clear
>> >> >> determination of the problem.

>> >> >> [Direct3DDevice].SetLight 0, [LightObject]

>> >> >> (Also keep in mind the following:
>> >> >>   I did create the device, and as a matter a fact
I
>> am
>> >> >> redering fine.  Or was until I introduced lights.)

>> >> >> If you have the DirectX help (for VB) installed
the
>> >> >> following URL should take you to the example I'm
>> >> refering
>> >> >> to.  Just paste it in your browser.



\directx8_vb.chm::/directx_vb/Graphics/ProgrammersGuide/Get

- Show quoted text -

Quote:
>> >> >> tingStarted/Tutorials/VB/4/Step2_2.htm

>> >> >.

>> >.

>.



Mon, 07 Feb 2005 05:55:42 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. damn damn damn!!!...

2. Multiple light sources with ambient lighting.

3. **!!**!! PRINT ACCESS REPORT FROM VB GOD DAMN IT **!!

4. VB can't see SQL tables, could someone shed some light please

5. VB can't see SQL tables, could someone shed some light please

6. VB Laser Light Show software problem

7. Internet/VB gurus, give me some light

8. Create mesh DX9 question, Lighting.VB example

9. Lights in VB??

10. VB and *.lit files

11. light VB objects?

12. Need Light drafting code for VB

 

 
Powered by phpBB® Forum Software