Post

 Resources 

Console


RE: Question about 3d stuff (quite newbie)... Carl Warwick (1 reply, 0 views) (2000-Aug-25)
-
I think I get what your saying, and I think you might be a little confused. D3DTLVERTEX - you specify the colour (lighting) and the screen coordinates (transformation). Thats why its TL vertex. D3DLVERTEX - you specify the colour, and the position in world space, and so D3D does the transformations for you. D3DVERTEX - you just specify the position in world space, and D3D calculates the colour of each vertex for you (by using the lights you set), and then transforms the world coords into screen coords. So as your doing a 2D game you will want to use TLVERTEX, and then to do your own lighting. The lighting is fairly simple, just calculate the distance of the light source from the vertex by using pythagorus theorum (a^2 = b^2 + c^2), then just increase the vertex colour by an amount proportional to the distance. so you will want to set an ambient lighting colour, so that the vertices can actually be increased in brightness.


-
Up One Level | Back to Forum

RE: Question about 3d stuff (quite newbie)... Almar Joling (0 replies) (2000-Aug-26)

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 70 visitors within the last 20 minutes
RSS News Feed