show3d.inc
2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<TABLE width="595" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD>
This is the beginning of an information-system like a running-text
written in java. At the end it should wirl a lot of vertices in a
spherical room and form words from it. The basic 3D-Stuff is ready and
shown in the applet below. Sadly it is so slow that i am not sure if
it will ever work as i thought it should.<BR><BR>
<CENTER>
<APPLET code="test.class" codebase="classes"
width=200 height=150 name="test">
You must activate Java with your browser if you want to see
anything...
</APPLET>
</CENTER><BR>
In the actual state the applet does the following:<BR><BR>
<OL>
<LI>
<B>translation, rotation, scale</B><BR>
calculation of the 3D-coordinates for every vertex.<BR>
<I>relatively fast</I>
<LI>
<B>projection</B><BR>
The 3D-coordinates will be projected on 2D-screenspace.<BR>
<I>relatively fast, too</I>
<LI>
<B>lighting</B><BR>
calculating a color-intensity by the angle of the normal
vector of a polygon (triangle)to a defined light-vector.<BR>
<I>even this isn't the speed problem</I>
<LI>
<B>backface-culling</B><BR>
Polygons facing away from the viewer are not drawn.<BR>
<I>fast...</I>
<LI>
<B>scanline-conversion and lineal texturemapping</B><BR>
i map previously calculatet checker-texture on every polygon.
There are a few error (rounding?) in this and it is...<BR>
<I>slow....</I>
</OL><BR>
The sourcecode is available for download.<BR>
I plan to write a documentation about the things i have done so far
in this applet.
</TD>
</TR>
</TABLE>