Archived

This topic is now archived and is closed to further replies.

ironfroggy

lines and light giving objects

Recommended Posts

How do I render a line in 3D? And, can I have that light be illuminated and give off light to the surroundings? How do I make other objects, like triangles, give off light? // God.c void main() { WORLD Earth; LIFE People = Earth.CreateLife(HUMAN); GiveHope(&People); delete Earth; EvilCackle(); }

Share this post


Link to post
Share on other sites
rendering a line in 3d is the same as drawing a regular line
after doing transformation && clipping you draw a line from point a to point b

if you are using opengl or d3d LOOK AT THE HELP FILE
they get paid to make it useable

in help you will find you should do somethind similar to this in
opengl:

glBegin(GL_LINE_STRIP);
glColor3f(1.0f,0.0f,0.0f); // this is for color (red)
glVertex3f(1.0f, 0.0f, 0.0f); // where the ends are
glVertex3f(0.0f, 1.0f, 0.0f);
glEnd();


d3d :
pd3dDevice->DrawIndexedPrimitive( type, D3DFVF_VERTEX,
//pd3dDevice->DrawIndexedPrimitive( D3DPT_LINESTRIP, D3DFVF_VERTEX,
(VOID*)Vert, 3,
Indice, 3, 0 );

----
always read your help file first

Share this post


Link to post
Share on other sites
i forgot about the lights

you can''t have the WHOLE line or triangle give off light in 3d very easily

the standard is point lights
go look at help for that
if you do software lighting you can do whatever you want

Share this post


Link to post
Share on other sites