sda4: commit the Glaze developer hard-drive dump

Un-ignored: the dev drive is the ground truth the restoration and
emulator work constantly reference (DPL3/LIBDPL + VRENDER i860 renderer
source, BT/RP live+dev game trees, VGL_LABS pod boot, scene/audio
content). Kept in-repo for the pod-owner community.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-04 19:41:15 -05:00
co-authored by Claude Fable 5
parent 504aef88d4
commit db7745fcd0
19993 changed files with 1983033 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
/*
* PROJECT: DVS
* SUBSYSTEM: VL
* MODULE: basictypes.def
*
* File: $RCSfile: basictypes.def,v $
* Revision: $Revision: 0.4 $
* Date: $Date: 1993/09/24 11:29:01 $
* Author: $Author: jon $
* RCS Ident: $Id: basictypes.def,v 0.4 1993/09/24 11:29:01 jon Exp $
*
* FUNCTION:
* This module is used to hold the parameterised definitions of the basic
* types used throughout the system for all the machines supported. When
* porting to a new architecture all type stuff should be modified in
* here. There should be no machine dependant code anywhere else!
*
* each of the basic type int8 uint8 etc, etc is defined in terms of
* standard ansi 'C' types here, and given a enum name for conveniance.
*
* The format is DEF_TYPE ( <enum name>, <type name>, <ansi 'C' equiv> )
*
* $Log: basictypes.def,v $
Revision 0.4 1993/09/24 11:29:01 jon
Release 2.0.4
Revision 1.1 93/07/12 08:12:21 john
Initial revision
# Revision 1.6 1993/03/19 15:24:22 john
# added definition for system V release 4.2
#
# Revision 1.5 1992/09/28 17:19:58 mark
# Added definitions for IRIS Indigo
#
# Revision 1.4 1992/09/15 13:47:54 jeff
# now use _SYSV386 not SYSV386
#
# Revision 1.3 1992/09/15 13:10:32 jeff
# added defs for SYSV386 targets.
#
# Revision 1.2 1992/09/14 13:18:53 jeff
# progress, progreess....
#
# Revision 1.1 1992/07/27 12:24:20 jeff
# Initial revision
#
*
* Copyright (c) 1992 Division Ltd.
*
* All Rights Reserved.
*
* This Document may not, in whole or in part, be copied,
* photocopied, reproduced, translated, or reduced to any
* electronic medium or machine readable form without prior
* written consent from Division Ltd.
*/
DEF_TYPE( INT8, int8, signed char )
DEF_TYPE( UINT8, uint8, unsigned char )
DEF_TYPE( INT16, int16, signed short )
DEF_TYPE( UINT16, uint16, unsigned short )
DEF_TYPE( INT32, int32, signed int )
DEF_TYPE( UINT32, uint32, unsigned int )
DEF_TYPE( FLOAT32, float32, float)
DEF_TYPE( FLOAT64, float64, double)
/*
* Note we may need to put ifdefs back in here for some machines IE 64Bit processors ?
*/

+241
View File
@@ -0,0 +1,241 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include <conio.h>
#include "dpltypes.h"
#include "dpl.h"
#include "matrix.h"
#include "spline.h"
/*{{{ static float atan2deg ( float dz, float dx )*/
static float _atan2deg ( float dz, float dx )
{
float angle;
if ((dx*dx) < 0.0001f) {
angle=(dz>0) ? 90.0f : -90.0f;
return angle;
}
else {
return (180.0f / 3.1415926535f) * atan2 ( dz, dx );
}
}
/*}}} */
/*{{{ static void xformpoint ( POINT q, POINT p, MATRIX m )*/
static void _xformpoint ( dpl_POINT q, dpl_POINT p, dpl_MATRIX m )
{
dpl_POINT r;
int i;
for (i=0; i<4; i++ ) {
r[i]=(p[0]*m[0][i])+
(p[1]*m[1][i])+
(p[2]*m[2][i])+
(p[3]*m[3][i]);
}
memcpy ( q, r, sizeof(dpl_POINT));
}
/*}}} */
/*{{{ void look_at ( VIEW *v, float *from, float *at, float z_spin )*/
void look_at ( dpl_VIEW *v, float *from, float *at, float z_spin )
{
/* construct a view from 2 points */
float dx, dy, dz;
float px, py, pz;
float thetax, thetay, thetaz;
float yaw, roll;
dpl_MATRIX m;
dpl_POINT p, q;
/* put 'at' at origin, construct a vector from 'from' */
px=from[0]; py=from[1]; pz=from[2];
dx=at[0]-px;
dy=at[1]-py;
dz=at[2]-pz;
thetaz=0.0f;
thetay=0.0f;
thetax=0.0f;
p[0]=dx;
p[1]=dy;
p[2]=dz;
p[3]=1;
yaw=-_atan2deg ( dz, dx );
dpl_IdMatrix ( m );
dpl_Rotate ( m, -yaw, dpl_Y );
_xformpoint ( q, p, m );
roll=_atan2deg(q[1], q[0] );
/* project onto x-z plane, assuming camera is initially looking down -z */
dpl_IdMatrix ( v->matrix );
/* apply angles to matrix */
dpl_Rotate ( v->matrix, z_spin, dpl_Z );
dpl_Rotate ( v->matrix, roll, dpl_X );
dpl_Rotate ( v->matrix, yaw-90.0f, dpl_Y );
dpl_Translate( v->matrix, px, py, pz );
dpl_Flush ( v );
}
/*}}} */
static int camera_inited=0;
static float camera_t=0.0f;
static cntl_point *camerahead=NULL;
/*{{{ void camera_move ( VIEW *eye,*/
void camera_move ( dpl_VIEW *eye,
char *spline_file,
dpl_POINT look_at_point,
float scale_fac,
float dt )
{
cntl_point *p=camerahead;
float t=camera_t;
float px, py, pz, rx, ry, rz;
dpl_POINT evalp;
if (camera_inited == 0) {
camera_inited=1;
p=init_splines(spline_file);
t=0;
}
px=eval(p->x_pos_cubic, t );
py=eval(p->y_pos_cubic, t );
pz=eval(p->z_pos_cubic, t );
rx=eval(p->x_rot_cubic, t );
ry=eval(p->y_rot_cubic, t );
rz=eval(p->z_rot_cubic, t );
camerahead=walk_spline ( p, &t, dt );
camera_t=t;
/* we have wobbled the spline according to the file - now build the
view matrix */
/*
eye->matrix[3][0]=px+look_at_point[0];
eye->matrix[3][1]=py+look_at_point[1];
eye->matrix[3][2]=pz+look_at_point[2];
look_at ( eye, &eye->matrix[3][0], look_at_point, rz );
*/
dpl_IdMatrix ( eye->matrix );
dpl_Rotate ( eye->matrix, rz, dpl_Z );
dpl_Rotate ( eye->matrix, rx, dpl_X );
dpl_Rotate ( eye->matrix, ry, dpl_Y );
dpl_Translate ( eye->matrix, px, py, pz );
printf ("camera at %f %f %f\n",
px, py, pz );
dpl_Flush(eye);
}
/*}}} */
/*{{{ void camera_move_kbd ( VIEW *eye,*/
static float yaw=0.0f, pitch=0.0f, roll=0.0f,
velocity=0.0f,
px=0.0f, py=0.0f, pz=0.0f,
pitch_velocity = 0.0f,
yaw_velocity = 0.0f,
roll_velocity = 0.0f,
dspin=0.3f, dspeed=0.3f;
void camera_move_kbd ( dpl_VIEW *eye,
char *spline_file,
dpl_POINT look_at_point,
float scale_fac,
float dt )
{
dpl_POINT vel0, vel1;
/* compute roll, pitch, yaw from keyboard input */
if (kbhit()) {
int ch;
ch=getch();
switch (ch) {
case '7' : /* roll left */
roll_velocity += dspin;
break;
case '9': /* roll right */
roll_velocity -= dspin;
break;
case '4' : /* swing left weeet chariot */
yaw_velocity+=dspin;
break;
case '6' : /* right */
yaw_velocity-=dspin;
break;
case '2' : /* upp */
pitch_velocity+=dspin;
break;
case '8' : /* downnn */
pitch_velocity-=dspin;
break;
case '5' : /* go faster */
velocity+=dspeed;
break;
case '0' : /* decelerate */
velocity-=dspeed;
break;
case '*' :
pitch_velocity = 0.0;
roll_velocity = 0.0;
yaw_velocity = 0.0;
break;
case '-':
pitch = 0.0;
yaw = 0.0;
roll = 0.0;
break;
case ' ' : /* set speed to 0 */
velocity=0.0f;
pitch_velocity = 0.0f;
yaw_velocity = 0.0f;
roll_velocity = 0.0f;
break;
}
}
vel0[0]=0;
vel0[1]=0;
vel0[2]=-velocity;
dpl_IdMatrix ( eye->matrix );
roll += roll_velocity;
pitch += pitch_velocity;
yaw += yaw_velocity;
dpl_Rotate ( eye->matrix, roll, dpl_Z );
dpl_Rotate ( eye->matrix, pitch, dpl_X );
dpl_Rotate ( eye->matrix, yaw, dpl_Y );
_xformpoint ( vel1, vel0, eye->matrix );
px+=vel1[0];
py+=vel1[1];
pz+=vel1[2];
dpl_Translate ( eye->matrix, px, py, pz );
dpl_Flush(eye);
}
/*}}} */
+17
View File
@@ -0,0 +1,17 @@
#ifndef camera_h
#define camera_h
#include "dpltypes.h"
extern void camera_move ( dpl_VIEW *eye,
char *spline_file,
dpl_POINT look_at_point,
float scale_fac,
float dt );
extern void camera_move_kbd ( dpl_VIEW *eye,
char *spline_file,
dpl_POINT look_at_point,
float scale_fac,
float dt );
#endif
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
20
0 310 -500 0 180 0
0 840 3000 -3 180 3
180 30 12000 5 180 9
-190 128 21000 -3 180 -9
190 3 31000 -2 180 10
-130 148 45000 -1 180 -2
110 38 53000 -4 180 -9
-150 158 58000 2 180 2
0 195 58000 0 270 0
0 235 58000 0 360 0
0 155 51000 0 360 0
-120 225 41000 0 360 0
170 265 31000 0 360 10
-260 201 21000 0 360 -8
230 215 11000 0 360 20
-120 5 5000 0 360 -20
210 3 2000 0 360 0
-150 80 -500 3 360 0
0 280 -500 3 270 0
0 110 -500 3 180 0
+22
View File
@@ -0,0 +1,22 @@
21
15 7 516 0 5 0
2 5 431 -5 10 8
-12 5 353 5 7 1.4
-14 6 247 -1 -1 -13
-13 4 164 -1 1.7 2.8
-16 4 67 4 1.7 2.8
-23 14 -69 -1.4 6.4 13
-13 11 -195 -1.4 -10.4 -12.1
9 9 -265 -1.4 -17 -18
0.76 8.2 -310 -1.4 25 27
-12 8.5 -313 11 109 27
-25 13 -293 11.7 162 27.2
-20 15 -259 0 193 21
-10 15 -197 0 187 -0.5
4 16 -103 1.8 186 -0.5
-20 20 20 1.8 165 -12
-30 23 143 1.8 182 3.8
5.8 28 321 1.8 187 10
17 16 416 -14 147 1.6
13 6.8 460 -14 118 -1
7.4 4.4 485 -7 63 0
+35
View File
@@ -0,0 +1,35 @@
34
-162 11 -77 0 -178 7
-161 11 -41 -8 -180 -5
-162 2 73 2.6 -191 11
-192 7.4 159 -10 -210 -13
-304 -3.5 268 8.5 -259 9.6
-459 -5 282 3 -275 -6.9
-579 -1 271 -1.5 -268 5
-690 -12 263 10 -229 2
-762 -6 315 2.8 -233 -4
-877 -5.5 360 10 -263 3.2
-982 12 368 7.4 -270 7.5
-1105 18 363 4.2 -283 -4.5
-1206 12 350 -5 -302 7
-1290 -3 283 11 -319 -3
-1329 -6 232 4.6 -330 8
-1360 -8 175 10 -338 0
-1408 -3.5 63 2 -330 -5
-1439 -1 -5 2 -343 7
-1449 -3 -167 8 -250 -8
-1513 -7 -172 2 -169 8
-1473 -7 -75 -3 -151 -4
-1413 -11 56 5 -157 5
-1379 -9 139 9 -161 -4
-1347 -3 281 5 -189 7
-1349 1 414 -4 -199 -1
-1398 -8 618 -1 -206 6
-1451 -12 724 3 -169 0
-1402 -13 705 -1 -69 -5
-1129 -7 591 3 -66 0
-734 5 421 0 -60 0
-352 12 341 9 -50 -5
-214 22 208 0 -55 -9
-160 19 92 -5 -190 -2
-151 10 15 -9 -200 2
+9
View File
@@ -0,0 +1,9 @@
8
-162 11 -89 0 -181 0
-162.7 11 -49.2 1 -181 -2.2
-167 11.2 70.4 2.2 -187.6 -0.2
-206.2 12.5 163.5 -0.4 -218.2 2
-303 6 260 3 -252 -4
-457 4 252 0.8 -263 3.4
-452 12 382 2 -59 5
-188 17 159 2 -25 2
+3
View File
@@ -0,0 +1,3 @@
2
0 0 -500 0 0 0
-30 0 -500 0 0 0
+3
View File
@@ -0,0 +1,3 @@
2
0 0 -500 0 0 0
30 0 -500 0 0 0
+614
View File
@@ -0,0 +1,614 @@
2):i860 service - nI860=2 memSize=0x1800000 memStart=0x82800000
2):Called vr_Init
2):>>> i860args action ::i860 50MHz and kicking::
2):>>> i860 code action
2):load_i860 segments => 0xffc00000:121408 0x82803000:65248 0x82812ee0:7648
2):went patch_entry_point, going ghastly_kernel...
2):went load_i860_segment many times, about to memcpy
2):memsize 1800000 memstart 82800000 procType 2
2):csize 121408 dsize 65248 bsize 7648
2):Processor 1 thinks shared_cntl is at 0x83bb6000
2):Processor 0 thinks shared_cntl is at 0x83bb6000
2):about to call dN_mynode
2):call dN_mynode, got 2
2):about to call dN_nodes
2):call dN_nodes, got 2
2):entering while(1) deal_with loop
2):Yes, init is for me
2):vr_init argv=/link_A|3|/link_B|-1|/device|0x150|/video|svga|/n_860s|1|
2):
initialize eyes
2):setRampEntry 0.0000000 0.0000000 0.0000000 1.000000 1.000000 1.000000 ramp 0
2):setRampEntry 0.300000 0.0000000 0.0000000 1.000000 1.000000 0.900000 ramp 1
2):setRampEntry 0.0000000 0.500000 0.0000000 1.000000 1.000000 1.000000 ramp 2
2):setRampEntry 0.0000000 0.0000000 0.400000 0.900000 0.900000 1.000000 ramp 3
2):pxpl5 init magicL 12993 magicR 12993
2):Calling hwdriver!!!
2):>>>> DRIVER : init 0x0 0x83bb3000 0x32c1 0x32c1 0x2074696e
2):>>>> init pxpl ware, mode 0x8 clk 0x9
create 1st view
fog 5000.000000, 12000.000000 0.000000, 0.000000, 0.000000
set background 0.400000, 0.600000, 0.800000
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
find texture file vtvall
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create dynamic object ddmule
find geometry file ddmule
dpl_LoadObject - name=..\geometry\ddmule.b2z
spline file race1.spl
22 cntl points
malloced knots
closing spline file
patched up 22 knots
approximating velocities
computing cubics
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
find texture file canal
loaded object
translate -80.000000 -90.000000 -15000.000000
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
loaded object
translate -80.000000 -90.000000 0.000000
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
loaded object
translate -80.000000 -90.000000 15000.000000
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
loaded object
translate -80.000000 -90.000000 30000.000000
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
loaded object
translate -80.000000 -90.000000 45000.000000
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
loaded object
translate -80.000000 -90.000000 60000.000000
create static object texcanal
find geometry file texcanal
dpl_LoadObject - name=..\geometry\texcanal.b2z
loaded object
translate -80.000000 -90.000000 75000.000000
create static object rocky
find geometry file rocky
dpl_LoadObject - name=..\geometry\rocky.b2z
2):flushed ramp 0x100e3100 to 0.0000000 0.0000000 0.0000000 0.999000 0.999000 0.999000
2):flushed ramp 0x100e3100 to 0.100000 0.200000 0.900000 0.200000 0.999000 0.200000
2):flushed ramp 0x100e31c0 to 0.0000000 0.0000000 0.0000000 0.999000 0.999000 0.999000
loaded object
translate 350.000000 -90.000000 0.000000
create static object rocky
find geometry file rocky
dpl_LoadObject - name=..\geometry\rocky.b2z
2):flushed ramp 0x100e31c0 to 0.100000 0.200000 0.900000 0.200000 0.999000 0.200000
loaded object
translate -510.000000 -90.000000 5000.000000
create static object rocky
find geometry file rocky
dpl_LoadObject - name=..\geometry\rocky.b2z
2):flushed ramp 0x100e31c0 to 0.100000 0.200000 0.900000 0.200000 0.999000 0.200000
loaded object
translate 500.000000 -90.000000 10000.000000
create static object rocky
find geometry file rocky
dpl_LoadObject - name=..\geometry\rocky.b2z
2):flushed ramp 0x100e31c0 to 0.100000 0.200000 0.900000 0.200000 0.999000 0.200000
loaded object
translate -440.000000 -90.000000 15000.000000
create static object rocky
find geometry file rocky
dpl_LoadObject - name=..\geometry\rocky.b2z
2):flushed ramp 0x100e31c0 to 0.100000 0.200000 0.900000 0.200000 0.999000 0.200000
loaded object
translate 520.000000 -90.000000 20000.000000
create static object rocky
find geometry file rocky
dpl_LoadObject - name=..\geometry\rocky.b2z
2):flushed ramp 0x100e31c0 to 0.100000 0.200000 0.900000 0.200000 0.999000 0.200000
loaded object
translate -420.000000 -90.000000 25000.000000
create static object plant1
find geometry file plant1
dpl_LoadObject - name=..\geometry\plant1.b2z
find texture file glommed.svt
2):flushed ramp 0x100e31c0 to 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000
2):flushed ramp 0x10101080 to 0.0000000 0.0000000 0.0000000 0.999000 0.999000 0.999000
loaded object
translate -100.000000 -90.000000 4000.000000
create static object plant1
find geometry file plant1
dpl_LoadObject - name=..\geometry\plant1.b2z
2):flushed ramp 0x10101080 to 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000
loaded object
translate -500.000000 -90.000000 24000.000000
create static object plant1
find geometry file plant1
dpl_LoadObject - name=..\geometry\plant1.b2z
2):flushed ramp 0x10101080 to 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000
loaded object
translate 400.000000 -90.000000 38000.000000
create static object plant1
find geometry file plant1
dpl_LoadObject - name=..\geometry\plant1.b2z
2):flushed ramp 0x10101080 to 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000
loaded object
translate -600.000000 -90.000000 46400.000000
create static object plant1
find geometry file plant1
dpl_LoadObject - name=..\geometry\plant1.b2z
2):flushed ramp 0x10101080 to 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000
loaded object
translate 300.000000 -90.000000 41400.000000
hey, read the scene
20 cntl points
malloced knots
closing spline file
patched up 20 knots
approximating velocities
computing cubics
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 1
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
2):setRampEntry 0.300000 0.0000000 0.0000000 0.999000 0.660000 0.300000 ramp 2
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.
+1
View File
@@ -0,0 +1 @@
tanks 20 floor.v2z zilch
+34
View File
@@ -0,0 +1,34 @@
32
0 0 0 0 0 0
2000 0 0 0 0 0
4000 0 0 0 0 0
6000 0 0 0 0 0
8000 0 20 0 90 0
8000 0 40 0 90 0
8000 0 60 0 90 0
8000 0 80 0 90 0
0 0 0 0 180 0
0 0 0 0 180 0
0 0 0 0 180 0
0 0 0 0 180 0
0 0 0 0 270 0
0 0 0 0 270 0
0 0 0 0 270 0
0 0 0 0 270 0
0 0 0 0 360 0
0 0 0 0 360 0
0 0 0 0 360 0
0 0 0 0 360 0
0 0 0 0 270 0
0 0 0 0 270 0
0 0 0 0 270 0
0 0 0 0 270 0
0 0 0 0 180 0
0 0 0 0 180 0
0 0 0 0 180 0
0 0 0 0 180 0
0 0 0 0 90 0
0 0 0 0 90 0
0 0 0 0 90 0
0 0 0 0 90 0

+11
View File
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
int main ( int argc, char **argv )
{
float t;
sscanf ( argv[1], "%f", &t );
printf ( "0x%x\n", *(int *) &t );
}
+1
View File
@@ -0,0 +1 @@
float.c(11): Warning! W107: Missing return value for function 'main'
Binary file not shown.
Binary file not shown.
Binary file not shown.
+504
View File
@@ -0,0 +1,504 @@
/*
FILE : testpp5.c
PROJECT : pxpl5 renderer test
Author : Phil Atkin
(C) Division Ltd 1993.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include "dpl.h"
#include "matrix.h"
#include "startup.h"
#include "spline.h"
#include "camera.h"
char *progname;
static char *dpl_arg;
/* a few static dpltypes */
static dpl_ZONE *zone=NULL;
static dpl_LMODEL *lmodel=NULL;
static dpl_LIGHT *direct=NULL;
static dpl_LIGHT *ambient=NULL;
static dpl_VIEW *eye, *rye;
/*{{{ void eyeStuff ( VIEW *view )*/
void eyeStuff ( dpl_VIEW *view, int left )
{
float scale=1.0;
dpl_IdMatrix(view->matrix);
dpl_Translate (view->matrix, scale*1.275, 0, 0 );
dpl_Rotate (view->matrix, 180, dpl_Y );
dpl_Translate (view->matrix, 0, 0, -48 );
dpl_Flush (view);
}
/*}}} */
/*{{{ char *makeVizName ( char *name )*/
char vizStr [256];
char *makeVizName ( char *name )
{
char *root;
if ((root=getenv("VIZPATH")) == NULL)
return(name);
else {
strcpy ( vizStr, root );
strcat ( vizStr, name );
return ( vizStr );
}
}
/*}}} */
/*{{{ char *makeTexName ( char *name )*/
char texStr [256];
char *makeTexName ( char *name )
{
char *root;
if ((root=getenv("TEXTURE")) == NULL)
return(name);
else {
strcpy ( texStr, root );
strcat ( texStr, name );
return ( texStr );
}
}
/*}}} */
/*{{{ char *makedplName ( char *name )*/
char *makedplName ( char *dplstr, char *name )
{
char *root;
if ((root=getenv("DVIEWBIN")) == NULL)
return(name);
else {
strcpy ( dplstr, root );
strcat ( dplstr, name );
return ( dplstr );
}
}
/*}}} */
/*{{{ int env2hex ()*/
int env2hex ( char *env_str, int default_v )
{
char *s;
int v;
if (s = getenv(env_str)) {
if (sscanf(s, "%x", &v) == 1) {
return v;
}
}
printf ("Defaulting on %s to 0x%x\n", env_str, default_v );
return default_v;
}
/*}}} */
/*{{{ cheesy scene file support*/
/*{{{ about the cheesy file format*/
/*
this is a DEAD quick and dirty 'get-your-geometry-executing' thing,
which loads up a scene, and constantly executes it, allowing the
user to wander round by keyboard flight.
it only took 30 minutes to write so is not supported.
cheesy scene format is
FOG z0 z1 r g b
BACKGND r g b
AMBIENT r g b
LIGHT r g b dx dy dz
STATIC name scale px py pz rx ry rz
DYNAMIC name scale splinefile t0 dt
*/
/*}}} */
/*{{{ cheesy structure*/
typedef struct s_cheesy {
dpl_DCS *dcs;
cntl_point *p;
float scale;
float t, dt;
struct s_cheesy *next;
} cheesy_scene;
cheesy_scene *camembert=NULL;
/*}}} */
/*{{{ static cheesy_scene *load_cheesy_scene ( char *s )*/
static cheesy_scene *load_cheesy_scene ( char *s )
{
cheesy_scene *cheesy_head=NULL;
FILE *fp=fopen(s, "rt" );
int read;
dpl_DCS *zone_root;
dpl_DCS *geom_root,
*geom_tail=NULL;
dpl_DCS *light_root,
*light_tail=NULL;
char *str=malloc(256);
if (fp==NULL) {
printf ("couldnt open scene file\n" );
exit(666);
}
zone_root =dpl_NewDcs();
light_root=dpl_NewDcs();
geom_root =dpl_NewDcs();
light_tail=light_root;
geom_tail =geom_root;
lmodel=dpl_NewLmodel ();
dpl_SetZoneRootDcs ( zone, zone_root );
dpl_SetZoneLmodel ( zone, lmodel );
dpl_LinkDcs ( zone_root, light_root );
dpl_NestDcs ( zone_root, geom_root );
read=fscanf( fp, "%s ", str );
while (read == 1) {
float neer, phar, r, g, b;
if (strncmp ( str, "FOG", 3) == 0) {
/*{{{ */
read=fscanf( fp, "%f %f %f %f %f\n", &neer, &phar, &r, &g, &b );
printf ("fog %f, %f %f, %f, %f\n", neer, phar, r, g, b );
dpl_SetViewFog ( eye, 1, r, g, b, neer, phar );
if (rye)
dpl_SetViewFog ( rye, 1, r, g, b, neer, phar );
/*}}} */
}
else if (strncmp ( str, "BACKGND", 7) == 0) {
/*{{{ */
read=fscanf( fp, "%f %f %f\n", &r, &g, &b );
printf ("set background %f, %f, %f\n", r, g, b );
dpl_SetViewBackGround ( eye, r, g, b );
if (rye) dpl_SetViewBackGround ( rye, r, g, b );
/*}}} */
}
else if (strncmp ( str, "STATIC", 5) == 0) {
/*{{{ */
dpl_DCS *d;
dpl_INSTANCE *i;
dpl_OBJECT *o;
read=fscanf( fp, "%s ", str );
printf ("create static object %s\n", str );
d=geom_tail;
o=dpl_NewObject();
if (o) {
float scale, tx, ty, tz, rx, ry, rz;
dpl_LoadObject ( o, str );
printf ("loaded object\n" );
read=fscanf( fp, "%f %f %f %f %f %f %f\n",
&scale, &tx, &ty, &tz, &rx, &ry, &rz );
printf ("translate %f %f %f\n", tx, ty, tz );
i=dpl_NewInstance();
dpl_SetInstanceObject ( i, o );
dpl_IdMatrix ( d->matrix );
dpl_Rotate ( d->matrix, rz, dpl_Z );
dpl_Rotate ( d->matrix, rx, dpl_X );
dpl_Rotate ( d->matrix, ry, dpl_Y );
dpl_Scale ( d->matrix, scale, scale, scale );
dpl_Translate ( d->matrix, tx, ty, tz );
d->identity=0;
dpl_SetDcsInstance ( d, i );
d=dpl_NewDcs ();
dpl_LinkDcs ( geom_tail, d );
geom_tail=d;
dpl_Hide(o);
}
else {
printf ("Failed to load object from file %s\n", str );
exit(666);
}
/*}}} */
}
else if (strncmp ( str, "DYNAMIC", 7) == 0) {
/*{{{ */
cheesy_scene *edam=malloc(sizeof(cheesy_scene));
dpl_DCS *d;
dpl_INSTANCE *i;
dpl_OBJECT *o;
read=fscanf( fp, "%s ", str );
printf ("create dynamic object %s\n", str );
o=dpl_NewObject();
if (o) {
float scale, t0, dt;
dpl_LoadObject ( o, str );
read=fscanf( fp, "%f %s %f %f\n",
&scale, str, &t0, &dt );
printf ("spline file %s\n", str );
i=dpl_NewInstance();
dpl_SetInstanceObject ( i, o );
d=geom_tail;
edam->p=init_splines ( str );
edam->scale = scale;
edam->t =t0;
edam->dt=dt;
edam->dcs=geom_tail;
edam->next=cheesy_head;
cheesy_head=edam;
dpl_SetDcsInstance ( d, i );
d=dpl_NewDcs ();
dpl_LinkDcs ( geom_tail, d );
geom_tail=d;
dpl_Hide(o);
}
else {
printf ("Failed to load object from file %s\n", str );
exit(666);
}
/*}}} */
}
else if (strncmp ( str, "AMBIENT", 6) == 0) {
/*{{{ */
dpl_LIGHT *light;
float r, g, b;
read=fscanf( fp, "%f %f %f\n", &r, &g, &b );
light=dpl_NewLight();
dpl_SetLightType ( light, dpl_light_type_ambient );
dpl_SetLightColor ( light, r, g, b );
dpl_AddLightToLmodel ( lmodel, light );
/*}}} */
}
else if (strncmp ( str, "LIGHT", 5) == 0) {
/*{{{ */
dpl_DCS *d;
dpl_LIGHT *light;
float r, g, b, x, y, z;
read=fscanf( fp, "%f %f %f %f %f %f\n", &r, &g, &b, &x, &y, &z );
d=light_tail;
light=dpl_NewLight();
dpl_SetLightType ( light, dpl_light_type_directional );
dpl_SetLightColor ( light, r, g, b );
dpl_AddLightToLmodel ( lmodel, light );
d=light_tail;
dpl_SetDcsLight ( d, light );
dpl_IdMatrix ( d->matrix );
dpl_Rotate ( d->matrix, z, dpl_Z );
dpl_Rotate ( d->matrix, x, dpl_X );
dpl_Rotate ( d->matrix, y, dpl_Y );
d->identity=0;
dpl_Flush(d);
d=dpl_NewDcs ();
dpl_LinkDcs ( light_tail, d );
light_tail=d;
/*}}} */
}
else {
printf ("Huh, dont understand %s\n", str );
exit(666);
}
read=fscanf( fp, "%s ", str );
}
fclose(fp);
printf ("hey, read the scene\n" );
fflush(stdout);
return cheesy_head;
}
/*}}} */
/*{{{ static execute ( cheesy_scene *s )*/
static execute ( cheesy_scene *s )
{
while (s) {
cntl_point *p=s->p;
if (p) {
dpl_DCS *d=s->dcs;
float t, px, py, pz, rx, ry, rz;
t=s->t;
px=eval(p->x_pos_cubic, t );
py=eval(p->y_pos_cubic, t );
pz=eval(p->z_pos_cubic, t );
rx=eval(p->x_rot_cubic, t );
ry=eval(p->y_rot_cubic, t );
rz=eval(p->z_rot_cubic, t );
p = walk_spline ( p, &s->t, s->dt );
s->p = p;
dpl_IdMatrix ( d->matrix );
dpl_Rotate ( d->matrix, rz, dpl_Z );
dpl_Rotate ( d->matrix, rx, dpl_X );
dpl_Rotate ( d->matrix, ry, dpl_Y );
dpl_Scale ( d->matrix, s->scale, s->scale, s->scale );
dpl_Translate ( d->matrix, px, py, pz );
dpl_Flush(d);
}
s=s->next;
}
}
/*}}} */
/*}}} */
/*{{{ int nain ( int argc, char *argv[])*/
int nain ( int argc, char *argv[])
{
dpl_node *sky;
zone=initialize_all ( dpl_arg,
0,
&eye, &rye, far_clip / 2.0f );
camembert=load_cheesy_scene ( argv[1] );
/*{{{ make sky move*/
if (sky=dpl_FindNamedTypedNode ( dpl_type_texture, "sky_tex")) {
dpl_TEXTURE *tex=(dpl_TEXTURE *) sky;
tex->u0=0;
tex->v0=0;
tex->dv=0.13f;
tex->du=0.0373f;
dpl_Flush(tex);
}
/*
*/
/*}}} */
/*{{{ make plant move*/
if (sky=dpl_FindNamedTypedNode ( dpl_type_texture, "plant")) {
dpl_TEXTURE *tex=(dpl_TEXTURE *) sky;
tex->u0=0;
tex->v0=0;
tex->dv=0.1;
tex->du=0.913f;
dpl_Flush(tex);
}
/*}}} */
/*{{{ make fish move*/
if (sky=dpl_FindNamedTypedNode ( dpl_type_texture, "plant4")) {
dpl_TEXTURE *tex=(dpl_TEXTURE *) sky;
tex->u0=0;
tex->v0=0;
tex->dv=0.6;
tex->du=0.0f;
dpl_Flush(tex);
}
/*}}} */
while (1) {
if (argc > 2)
camera_move ( eye, argv[2],
NULL, 0.0f, 0.0132f );
else
camera_move_kbd ( eye, "dontneed.one",
NULL, 1.0f, 0.0057f );
dpl_DrawScene (1);
execute ( camembert );
}
return 0;
}
/*}}} */
/*{{{ int main ( int argc, char *argv[] )*/
int main ( int argc, char *argv[] )
{
progname=argv[0];
if (argc < 2) {
printf ("usage %s: <scenefile>\n", argv[0] );
exit(666);
}
else {
dpl_arg=getenv("dplarg");
/* dpl_SetWarningLevel ( 100 ); */
if (dpl_arg) {
if (screen_resolution ( dpl_arg ) == 0) {
printf ("failed to understand video format\n");
exit(666);
}
}
else {
printf ("failed to getenv dplarg\n");
exit(666);
}
near_clip=6.0;
far_clip =12000.0f;
nain ( argc, argv );
}
return 0;
}
/*}}} */
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+548
View File
@@ -0,0 +1,548 @@
/*
FILE : testpp5.c
PROJECT : pxpl5 renderer test
Author : Phil Atkin
(C) Division Ltd 1993.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include "dpl.h"
#include "matrix.h"
#include "startup.h"
#include "spline.h"
#include "camera.h"
char *progname;
static char *dpl_arg;
/* a few static dpltypes */
static dpl_ZONE *zone=NULL;
static dpl_LMODEL *lmodel=NULL;
static dpl_LIGHT *direct=NULL;
static dpl_LIGHT *ambient=NULL;
static dpl_VIEW *eye, *rye;
/*{{{ void eyeStuff ( VIEW *view )*/
void eyeStuff ( dpl_VIEW *view, int left )
{
float scale=1.0;
dpl_IdMatrix(view->matrix);
dpl_Translate (view->matrix, scale*1.275, 0, 0 );
dpl_Rotate (view->matrix, 180, dpl_Y );
dpl_Translate (view->matrix, 0, 0, -48 );
dpl_Flush (view);
}
/*}}} */
/*{{{ char *makeVizName ( char *name )*/
char vizStr [256];
char *makeVizName ( char *name )
{
char *root;
if ((root=getenv("VIZPATH")) == NULL)
return(name);
else {
strcpy ( vizStr, root );
strcat ( vizStr, name );
return ( vizStr );
}
}
/*}}} */
/*{{{ char *makeTexName ( char *name )*/
char texStr [256];
char *makeTexName ( char *name )
{
char *root;
if ((root=getenv("TEXTURE")) == NULL)
return(name);
else {
strcpy ( texStr, root );
strcat ( texStr, name );
return ( texStr );
}
}
/*}}} */
/*{{{ char *makedplName ( char *name )*/
char *makedplName ( char *dplstr, char *name )
{
char *root;
if ((root=getenv("DVIEWBIN")) == NULL)
return(name);
else {
strcpy ( dplstr, root );
strcat ( dplstr, name );
return ( dplstr );
}
}
/*}}} */
/*{{{ int env2hex ()*/
int env2hex ( char *env_str, int default_v )
{
char *s;
int v;
if (s = getenv(env_str)) {
if (sscanf(s, "%x", &v) == 1) {
return v;
}
}
printf ("Defaulting on %s to 0x%x\n", env_str, default_v );
return default_v;
}
/*}}} */
/*{{{ cheesy scene file support*/
/*{{{ about the cheesy file format*/
/*
this is a DEAD quick and dirty 'get-your-geometry-executing' thing,
which loads up a scene, and constantly executes it, allowing the
user to wander round by keyboard flight.
it only took 30 minutes to write so is not supported.
cheesy scene format is
FOG z0 z1 r g b
BACKGND r g b
AMBIENT r g b
LIGHT r g b dx dy dz
STATIC name scale px py pz rx ry rz
DYNAMIC name scale splinefile t0 dt
*/
/*}}} */
/*{{{ cheesy structure*/
typedef struct s_cheesy {
dpl_DCS *dcs;
cntl_point *p;
float scale;
float t, dt;
struct s_cheesy *next;
} cheesy_scene;
cheesy_scene *camembert=NULL;
/*}}} */
/*{{{ static cheesy_scene *load_cheesy_scene ( char *s )*/
static cheesy_scene *load_cheesy_scene ( char *s )
{
cheesy_scene *cheesy_head=NULL;
FILE *fp=fopen(s, "rt" );
int read;
dpl_DCS *zone_root;
dpl_DCS *geom_root,
*geom_tail=NULL;
dpl_DCS *light_root,
*light_tail=NULL;
char *str=malloc(256);
if (fp==NULL) {
printf ("couldnt open scene file\n" );
exit(666);
}
zone_root =dpl_NewDcs();
light_root=dpl_NewDcs();
geom_root =dpl_NewDcs();
light_tail=light_root;
geom_tail =geom_root;
lmodel=dpl_NewLmodel ();
dpl_SetZoneRootDcs ( zone, zone_root );
dpl_SetZoneLmodel ( zone, lmodel );
dpl_LinkDcs ( zone_root, light_root );
dpl_NestDcs ( zone_root, geom_root );
read=fscanf( fp, "%s ", str );
while (read == 1) {
float neer, phar, r, g, b;
if (strncmp ( str, "//", 2) == 0) {
// read=fscanf( fp, "%s\n", str ); // throw away
str=fgets( str, 256, fp ); // throw away
}
else if (strncmp ( str, "CLIP", 4) == 0) {
read=fscanf( fp, "%f %f\n", &neer, &phar ); // throw away
/* see main() below */
}
else if (strncmp ( str, "FOG", 3) == 0) {
/*{{{ */
read=fscanf( fp, "%f %f %f %f %f\n", &neer, &phar, &r, &g, &b );
printf ("fog %f, %f %f, %f, %f\n", neer, phar, r, g, b );
dpl_SetViewFog ( eye, 1, r, g, b, neer, phar );
if (rye)
dpl_SetViewFog ( rye, 1, r, g, b, neer, phar );
/*}}} */
}
else if (strncmp ( str, "BACKGND", 7) == 0) {
/*{{{ */
read=fscanf( fp, "%f %f %f\n", &r, &g, &b );
printf ("set background %f, %f, %f\n", r, g, b );
dpl_SetViewBackGround ( eye, r, g, b );
if (rye) dpl_SetViewBackGround ( rye, r, g, b );
/*}}} */
}
else if (strncmp ( str, "STATIC", 5) == 0) {
/*{{{ */
dpl_DCS *d;
dpl_INSTANCE *i;
dpl_OBJECT *o;
read=fscanf( fp, "%s ", str );
printf ("create static object %s\n", str );
d=geom_tail;
o=dpl_NewObject();
if (o) {
float scale, tx, ty, tz, rx, ry, rz;
dpl_LoadObject ( o, str );
printf ("loaded object\n" );
read=fscanf( fp, "%f %f %f %f %f %f %f\n",
&scale, &tx, &ty, &tz, &rx, &ry, &rz );
printf ("translate %f %f %f\n", tx, ty, tz );
i=dpl_NewInstance();
dpl_SetInstanceObject ( i, o );
dpl_IdMatrix ( d->matrix );
dpl_Rotate ( d->matrix, rz, dpl_Z );
dpl_Rotate ( d->matrix, rx, dpl_X );
dpl_Rotate ( d->matrix, ry, dpl_Y );
dpl_Scale ( d->matrix, scale, scale, scale );
dpl_Translate ( d->matrix, tx, ty, tz );
d->identity=0;
dpl_SetDcsInstance ( d, i );
d=dpl_NewDcs ();
dpl_LinkDcs ( geom_tail, d );
geom_tail=d;
dpl_Hide(o);
}
else {
printf ("Failed to load object from file %s\n", str );
exit(666);
}
/*}}} */
}
else if (strncmp ( str, "DYNAMIC", 7) == 0) {
/*{{{ */
cheesy_scene *edam=malloc(sizeof(cheesy_scene));
dpl_DCS *d;
dpl_INSTANCE *i;
dpl_OBJECT *o;
read=fscanf( fp, "%s ", str );
printf ("create dynamic object %s\n", str );
o=dpl_NewObject();
if (o) {
float scale, t0, dt;
dpl_LoadObject ( o, str );
read=fscanf( fp, "%f %s %f %f\n",
&scale, str, &t0, &dt );
printf ("spline file %s\n", str );
i=dpl_NewInstance();
dpl_SetInstanceObject ( i, o );
d=geom_tail;
edam->p=init_splines ( str );
edam->scale = scale;
edam->t =t0;
edam->dt=dt;
edam->dcs=geom_tail;
edam->next=cheesy_head;
cheesy_head=edam;
dpl_SetDcsInstance ( d, i );
d=dpl_NewDcs ();
dpl_LinkDcs ( geom_tail, d );
geom_tail=d;
dpl_Hide(o);
}
else {
printf ("Failed to load object from file %s\n", str );
exit(666);
}
/*}}} */
}
else if (strncmp ( str, "AMBIENT", 6) == 0) {
/*{{{ */
dpl_LIGHT *light;
float r, g, b;
read=fscanf( fp, "%f %f %f\n", &r, &g, &b );
light=dpl_NewLight();
dpl_SetLightType ( light, dpl_light_type_ambient );
dpl_SetLightColor ( light, r, g, b );
dpl_AddLightToLmodel ( lmodel, light );
/*}}} */
}
else if (strncmp ( str, "LIGHT", 5) == 0) {
/*{{{ */
dpl_DCS *d;
dpl_LIGHT *light;
float r, g, b, x, y, z;
read=fscanf( fp, "%f %f %f %f %f %f\n", &r, &g, &b, &x, &y, &z );
d=light_tail;
light=dpl_NewLight();
dpl_SetLightType ( light, dpl_light_type_directional );
dpl_SetLightColor ( light, r, g, b );
dpl_AddLightToLmodel ( lmodel, light );
d=light_tail;
dpl_SetDcsLight ( d, light );
dpl_IdMatrix ( d->matrix );
dpl_Rotate ( d->matrix, z, dpl_Z );
dpl_Rotate ( d->matrix, x, dpl_X );
dpl_Rotate ( d->matrix, y, dpl_Y );
d->identity=0;
dpl_Flush(d);
d=dpl_NewDcs ();
dpl_LinkDcs ( light_tail, d );
light_tail=d;
/*}}} */
}
else {
printf ("Huh, dont understand %s\n", str );
exit(666);
}
read=fscanf( fp, "%s ", str );
}
fclose(fp);
printf ("hey, read the scene\n" );
fflush(stdout);
free(str);
return cheesy_head;
}
/*}}} */
/*{{{ static execute ( cheesy_scene *s )*/
static execute ( cheesy_scene *s )
{
while (s) {
cntl_point *p=s->p;
if (p) {
dpl_DCS *d=s->dcs;
float t, px, py, pz, rx, ry, rz;
t=s->t;
px=eval(p->x_pos_cubic, t );
py=eval(p->y_pos_cubic, t );
pz=eval(p->z_pos_cubic, t );
rx=eval(p->x_rot_cubic, t );
ry=eval(p->y_rot_cubic, t );
rz=eval(p->z_rot_cubic, t );
p = walk_spline ( p, &s->t, s->dt );
s->p = p;
dpl_IdMatrix ( d->matrix );
dpl_Rotate ( d->matrix, rz, dpl_Z );
dpl_Rotate ( d->matrix, rx, dpl_X );
dpl_Rotate ( d->matrix, ry, dpl_Y );
dpl_Scale ( d->matrix, s->scale, s->scale, s->scale );
dpl_Translate ( d->matrix, px, py, pz );
dpl_Flush(d);
}
s=s->next;
}
}
/*}}} */
/*}}} */
/*{{{ int nain ( int argc, char *argv[])*/
int nain ( int argc, char *argv[])
{
dpl_node *sky;
zone=initialize_all ( dpl_arg,
0,
&eye, &rye, far_clip / 2.0f );
camembert=load_cheesy_scene ( argv[1] );
/*{{{ make sky move*/
if (sky=dpl_FindNamedTypedNode ( dpl_type_texture, "sky_tex")) {
dpl_TEXTURE *tex=(dpl_TEXTURE *) sky;
tex->u0=0;
tex->v0=0;
tex->dv=0.13f;
tex->du=0.0373f;
dpl_Flush(tex);
}
/*
*/
/*}}} */
/*{{{ make plant move*/
if (sky=dpl_FindNamedTypedNode ( dpl_type_texture, "plant")) {
dpl_TEXTURE *tex=(dpl_TEXTURE *) sky;
tex->u0=0;
tex->v0=0;
tex->dv=0.1;
tex->du=0.913f;
dpl_Flush(tex);
}
/*}}} */
/*{{{ make fish move*/
if (sky=dpl_FindNamedTypedNode ( dpl_type_texture, "plant4")) {
dpl_TEXTURE *tex=(dpl_TEXTURE *) sky;
tex->u0=0;
tex->v0=0;
tex->dv=0.6;
tex->du=0.0f;
dpl_Flush(tex);
}
/*}}} */
while (1) {
if (argc > 2)
camera_move ( eye, argv[2],
NULL, 0.0f, 0.0132f );
else
camera_move_kbd ( eye, "dontneed.one",
NULL, 1.0f, 0.0057f );
dpl_DrawScene (1);
execute ( camembert );
}
return 0;
}
/*}}} */
/*{{{ int main ( int argc, char *argv[] )*/
int main ( int argc, char *argv[] )
{
FILE *fp;
int read;
char *str;
progname=argv[0];
if (argc < 2) {
printf ("usage %s: <scenefile> [camera_spline_file]\n", argv[0] );
exit(666);
}
else {
dpl_arg=getenv("dplarg");
/* dpl_SetWarningLevel ( 100 ); */
if (dpl_arg) {
if (screen_resolution ( dpl_arg ) == 0) {
printf ("failed to understand video format\n"); //(redundant message)
exit(666);
}
}
else {
printf ("failed to getenv dplarg\n");
exit(666);
}
near_clip=6.0;
far_clip =12000.0f;
fp = fopen( argv[1], "rt" );
if (fp==NULL) {
printf ("couldnt open scene file\n" );
exit(666);
}
str=malloc(256);
read=fscanf( fp, "%s ", str );
while (read == 1) {
float neer, phar;
if (strncmp ( str, "CLIP", 4) == 0) {
/*{{{ */
read=fscanf( fp, "%f %f\n", &neer, &phar );
printf ("clip %f, %f\n", neer, phar );
near_clip = neer;
far_clip = phar;
break;
/*}}} */
}
read=fscanf( fp, "%s ", str );
}
fclose(fp);
fflush(stdout);
free(str);
nain ( argc, argv );
}
return 0;
}
/*}}} */
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
goto total.c (Editing* C)
goto fold.stp (Editing* Default)
command "fold.cmd"
foldmark "Occam" "--" ""
foldmark "C" "/*" "*/"
foldmark "Pascal" "(*" "*)"
foldmark "Iterm" "#" ""
foldmark "Latex" "%%" ""
foldmark "Asm" ";" ""
foldmark "As860" "\\" ""
foldmark "C++" "//" ""
#{{{ 0 Macro key to type "--" at the beginning of a line
209 45 45 202
#}}}
#{{{ 1 Macro key to say Hello World
72 101 108 108 111 32 87 111 114 108 100
#}}}
#{{{ 3 Macro key to duplicate a fold marker
221 212 211 222 209 246 249 202 211 209 205
#}}}
#{{{ 8 Macro key to search
224
#}}}
#{{{ 9 Macro key to replace
225
#}}}
+388
View File
@@ -0,0 +1,388 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int *big_map=NULL,
*temp_map=NULL;
int map_edge;
/*{{{ friggy stuff*/
static int clut[16] = { 4, 5, 6, 7,
8, 10, 12, 14,
16, 20, 24, 28,
32, 40, 48, 56 };
/*}}} */
/*{{{ static int funny_fourbits ( int eight )*/
static int funny_fourbits ( int eight )
{
int ix=0, c0, c1;
if ((eight & 15) > 7) {
eight+=15;
if (eight > 255) return 15;
}
return eight>>4;
eight>>=2;
if (eight > clut[15])
eight=clut[15];
while (clut[ix+1] < eight)
ix++;
c0=clut[ix];
c1=clut[ix+1];
c0-=eight;
c1-=eight;
if ((c0*c0) < (c1*c1))
return ix;
else
return ix+1;
}
/*}}} */
/*{{{ static void fourbit_mono ( int field, int *temp_map, int *big_map )*/
static void fourbit_mono ( int field, int *temp_map, int *big_map )
{
int i, mask, shift;
mask=~(0xf<<field);
shift=field;
printf ("fourbitmono, field 0x%x mask 0x%x shift 0x%x\n", field, mask, shift );
printf ("Munging %d texels\n", map_edge );
for (i=0; i<map_edge; i++ ) {
int v, w, r, g, b;
v=*temp_map;
b=0xff & (v>>8);
r=0xff & (v>>16);
g=0xff & (v>>24);
v=0xff & (((180*g)+(51*r)+(25*b)) >> 8);
v=funny_fourbits(v);
w=*big_map;
*big_map=(w&mask)|(v<<shift);
temp_map++;
big_map++;
}
}
/*}}} */
/*{{{ static void eightbit_mono ( int field, int *temp_map, int *big_map )*/
static void eightbit_mono ( int field, int *temp_map, int *big_map )
{
int i, mask, shift;
mask=~(0xff<<field);
shift=field;
printf ("eightbitmono, field 0x%x mask 0x%x shift 0x%x\n", field, mask, shift );
for (i=0; i<map_edge; i++ ) {
int v, w, r, g, b;
printf ("Munging %d texels\n", map_edge );
v=*temp_map;
b=0xff & (v>>8);
r=0xff & (v>>16);
g=0xff & (v>>24);
v=0xff & (((180*g)+(51*r)+(25*b)) >> 8);
w=*big_map;
*big_map=(w&mask)|(v<<shift);
temp_map++;
big_map++;
}
}
/*}}} */
/*{{{ static void bilinear ( int *temp_map, int *big_map )*/
static void bilinear ( int *temp_map, int *big_map )
{
printf ("Dont bother - just make the loader do it\n");
memcpy ( big_map, temp_map, 4*map_edge );
}
/*}}} */
/*{{{ static void eightbit_color ( int field, int *temp_map, int *big_map )*/
static void eightbit_color ( int field, int *temp_map, int *big_map )
{
int i, mask, shift;
mask=~(0xff<<field);
shift=field;
printf ("eightbitcolor, field 0x%x mask 0x%x shift 0x%x\n", field, mask, shift );
printf ("Munging %d texels\n", map_edge );
for (i=0; i<map_edge; i++ ) {
int v, w, r, g, b;
v=*temp_map;
b=0xff & (v>>8);
g=0xff & (v>>16);
r=0xff & (v>>24);
r = (r>>5) & 0x7;
g = (g>>5) & 0x7;
b = (b>>6) & 0x3;
v=r|(g<<3)|(b<<6);
w=*big_map;
*big_map=(w&mask)|(v<<shift);
temp_map++;
big_map++;
}
}
/*}}} */
/*{{{ static void twelvebit_color ( int field, int *temp_map, int *big_map )*/
static void twelvebit_color ( int field, int *temp_map, int *big_map )
{
int i, mask, shift;
mask=~(0xfff<<field);
shift=field;
printf ("twelvebitcolor, field 0x%x mask 0x%x shift 0x%x\n", field, mask, shift );
printf ("Munging %d texels\n", map_edge );
for (i=0; i<map_edge; i++ ) {
int v, w, r, g, b;
v=*temp_map;
b=0xff & (v>>8);
g=0xff & (v>>16);
r=0xff & (v>>24);
r=funny_fourbits ( r );
g=funny_fourbits ( g );
b=funny_fourbits ( b );
v=r|(g<<4)|(b<<8);
w=*big_map;
*big_map=(w&mask)|(v<<shift);
temp_map++;
big_map++;
}
}
/*}}} */
/*{{{ load_svt ( char *full_name )*/
int
load_svt ( char *full_name, int mode )
{
FILE *fp=fopen(full_name, "rb" );
long l_edge, texels;
int i, edge;
char *texelp;
if (fp==NULL) {
printf ("failed to open file %s\n", full_name );
return 0;
}
else {
fseek ( fp, 0L, SEEK_END );
l_edge=ftell(fp);
fseek ( fp, 0L, SEEK_SET );
edge=128;
if (l_edge == 16384L) edge=64;
else if (l_edge == 65536L) edge=128;
else if (l_edge == 262144L) edge=256;
else {
printf("Bad texture file size 0x%lx\n",l_edge);
fclose(fp);
return 0;
}
}
texels=edge*edge;
if (temp_map == NULL) {
map_edge=texels;
temp_map=malloc(texels*4);
big_map =malloc(texels*4);
for (i=0; i<texels; i++ ) {
temp_map[i]=0x0;
big_map[i]=0x0;
}
}
else {
if (map_edge != texels) {
printf ("File size mismatch\n" );
exit (666);
}
}
texelp=(char *) temp_map;
while (texels) {
int i;
fread ( texelp, 1, 8192, fp );
texels-=2048;
texelp+=8192;
}
fclose(fp);
switch ( mode) {
case 0x3 :
fourbit_mono ( 8, temp_map, big_map );
break;
case 0x2 :
fourbit_mono ( 12, temp_map, big_map );
break;
case 0x1 :
fourbit_mono ( 16, temp_map, big_map );
break;
case 0x0 :
fourbit_mono ( 20, temp_map, big_map );
break;
case 0x4 :
eightbit_mono ( 8, temp_map, big_map );
break;
case 0x5 :
bilinear ( temp_map, big_map );
break;
case 0x6 :
eightbit_color ( 0, temp_map, big_map );
break;
case 0x7 :
twelvebit_color ( 0, temp_map, big_map );
break;
}
return 1;
}
/*}}} */
/*{{{ save_svt ( char *full_name )*/
int
save_svt ( char *full_name )
{
FILE *fp=fopen(full_name, "wb" );
long texels;
char *texelp;
if (fp==NULL) {
printf ("failed to open write file %s\n", full_name );
return 0;
}
if (big_map==NULL) {
printf ("No operations performed to generate file %s\n", full_name );
fclose(fp);
return 0;
}
else {
texelp=(char *) big_map;
texels=map_edge;
printf ("Saving %d texels\n", texels );
while (texels) {
int i;
for (i=0; i<2048; i++ ) {
char a, b, c, d;
int ix=i<<2;
a=texelp[ix+0];
b=texelp[ix+1];
c=texelp[ix+2];
d=texelp[ix+3];
texelp[ix+0]=d;
texelp[ix+1]=c;
texelp[ix+2]=b;
texelp[ix+3]=a;
}
fwrite ( texelp, 1, 8192, fp );
texels-=2048;
texelp+=8192;
}
fclose(fp);
}
return 1;
}
/*}}} */
/*
usage - glomm /mode 0x0 name /mode 0x1 name destname
*/
int main ( int argc, char **argv )
{
int n_files, i=0;
char *write_name=NULL;
for (i=1; i<argc; i++) {
char *s=argv[i];
int l=strlen(s);
if (strcmp(s,"/mode") == 0) {
int mode;
char *fname;
/* got a file thing, do it */
i++;
if (i == argc) {
printf ("malformed arguments\n" );
exit(666);
}
s=argv[i];
sscanf ( s, "%x", &mode );
i++;
if (i == argc) {
printf ("malformed arguments\n" );
exit(666);
}
fname=argv[i];
load_svt ( fname, mode );
}
else {
if (write_name) {
printf ("destination file name specified twice : %s : %s\n",
write_name, s );
exit(666);
}
else write_name=s;
}
}
if (write_name)
save_svt(write_name);
else
printf ("No destination name specified\n");
}
+18
View File
@@ -0,0 +1,18 @@
16
0.0 -4.0 0.0 0.01 -3.0 0.0
0.0 -4.0 0.0 0.01 -3.0 0.0
3.0 0.6 0.0 1.8 0.0 0.0
4.0 0.9 0.0 1.6 0.0 0.0
4.3 1.5 0.0 1.9 2.0 3.0
3.9 1.00 -0.1 1.4 -3.0 0.0
4.6 0.29 -0.1 1.2 -3.0 0.0
5.0 0.4 -0.20 1.6 -3.0 0.0
6.5 0.72 0.2 1.82 -3.0 0.0
7.0 0.90 0.0 1.93 -3.0 0.0
8.0 0.75 0.0 2.17 -3.0 0.0
9.0 -0.37 0.1 2.6 -3.0 0.0
10.0 -0.7 0.1 2.9 -3.0 0.0
11.0 -1.5 0.1 3.3 -3.0 0.0
12.0 -4.8 0.1 4.5 -3.0 0.0
0.0 -4.0 0.0 0.01 -3.0 0.0

+18
View File
@@ -0,0 +1,18 @@
16
0.0 -4.0 0.0 0.01 -3.0 0.0
0.0 -1.6 0.2 0.8 0.0 0.0
1.0 6.9 0.0 1.1 0.0 0.0
1.3 19.5 0.1 1.9 2.0 3.0
2.9 16.40 -0.1 2.2 -3.0 0.0
6.8 14.9 -0.1 2.3 -3.0 0.0
14.3 16.0 -0.20 2.1 -3.0 0.0
12.8 14.9 0.2 2.4 -3.0 0.0
11.3 14.0 0.0 2.2 -3.0 0.0
12.8 15.1 0.0 2.047 -3.0 0.0
14.3 16.0 0.1 2.3 -3.0 0.0
12.8 15.0 0.0 2.2 -3.0 0.0
11.0 13.7 -0.1 0.43 -3.0 0.0
10.0 -0.3 0.1 0.0 -3.0 0.0
0.0 -4.0 0.0 0.01 -3.0 0.0
0.0 -4.0 0.0 0.01 -3.0 0.0

+262
View File
@@ -0,0 +1,262 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include <conio.h>
#include "dpl.h"
#include "matrix.h"
#include "spline.h"
/*{{{ static float atan2deg ( float dz, float dx )*/
static float _atan2deg ( float dz, float dx )
{
float angle;
if ((dx*dx) < 0.0001f) {
angle=(dz>0) ? 90.0f : -90.0f;
return angle;
}
else {
return (180.0f / 3.1415926535f) * atan2 ( dz, dx );
}
}
/*}}} */
/*{{{ static void xformpoint ( POINT q, POINT p, MATRIX m )*/
static void _xformpoint ( dpl_POINT q, dpl_POINT p, dpl_MATRIX m )
{
dpl_POINT r;
int i;
for (i=0; i<4; i++ ) {
r[i]=(p[0]*m[0][i])+
(p[1]*m[1][i])+
(p[2]*m[2][i])+
(p[3]*m[3][i]);
}
memcpy ( q, r, sizeof(dpl_POINT));
}
/*}}} */
/*{{{ void look_at ( VIEW *v, float *from, float *at, float z_spin )*/
void look_at ( dpl_VIEW *v, float *from, float *at, float z_spin )
{
/* construct a view from 2 points */
float dx, dy, dz;
float px, py, pz;
float thetax, thetay, thetaz;
float yaw, roll;
dpl_MATRIX m;
dpl_POINT p, q;
/* put 'at' at origin, construct a vector from 'from' */
px=from[0]; py=from[1]; pz=from[2];
dx=at[0]-px;
dy=at[1]-py;
dz=at[2]-pz;
thetaz=0.0f;
thetay=0.0f;
thetax=0.0f;
p[0]=dx;
p[1]=dy;
p[2]=dz;
p[3]=1;
yaw=-_atan2deg ( dz, dx );
dpl_IdMatrix ( m );
dpl_Rotate ( m, -yaw, dpl_Y );
_xformpoint ( q, p, m );
roll=_atan2deg(q[1], q[0] );
/* project onto x-z plane, assuming camera is initially looking down -z */
dpl_IdMatrix ( v->matrix );
/* apply angles to matrix */
dpl_Rotate ( v->matrix, z_spin, dpl_Z );
dpl_Rotate ( v->matrix, roll, dpl_X );
dpl_Rotate ( v->matrix, yaw-90.0f, dpl_Y );
dpl_Translate( v->matrix, px, py, pz );
}
/*}}} */
static int camera_inited=0;
static float camera_t=0.0f;
static cntl_point *camerahead=NULL;
/*{{{ void camera_move ( VIEW *eye,*/
void camera_move ( dpl_VIEW *eye,
char *spline_file,
dpl_POINT look_at_point,
float scale_fac,
float dt )
{
cntl_point *p=camerahead;
float t=camera_t;
float px, py, pz, rx, ry, rz;
dpl_POINT evalp;
if (camera_inited == 0) {
camera_inited=1;
p=init_splines(spline_file);
t=0;
}
px=eval(p->x_pos_cubic, t );
py=eval(p->y_pos_cubic, t );
pz=eval(p->z_pos_cubic, t );
rx=eval(p->x_rot_cubic, t );
ry=eval(p->y_rot_cubic, t );
rz=eval(p->z_rot_cubic, t );
camerahead=walk_spline ( p, &t, dt );
camera_t=t;
/* we have wobbled the spline according to the file - now build the
view matrix */
/*
eye->matrix[3][0]=px+look_at_point[0];
eye->matrix[3][1]=py+look_at_point[1];
eye->matrix[3][2]=pz+look_at_point[2];
look_at ( eye, &eye->matrix[3][0], look_at_point, rz );
*/
dpl_IdMatrix ( eye->matrix );
dpl_Rotate ( eye->matrix, rz, dpl_Z );
dpl_Rotate ( eye->matrix, rx, dpl_X );
dpl_Rotate ( eye->matrix, ry, dpl_Y );
dpl_Translate ( eye->matrix, px, py, pz );
dpl_Flush(eye);
}
/*}}} */
/*{{{ void camera_move_kbd ( VIEW *eye,*/
static float
yaw = 0.0f, pitch = 0.0f, roll = 0.0f,
x_velocity = 0.0f,
y_velocity = 0.0f,
z_velocity = 0.0f,
px = 0.0f, py = 5.0f, pz = 0.0f,
pitch_velocity = 0.0f,
yaw_velocity = 0.0f,
roll_velocity = 0.0f,
dspin = 0.3f, dspeed = 0.3f;
static int
enhanced_key = 0; //Flag: True if next char is enhanced key.
void camera_move_kbd ( dpl_VIEW *eye,
char *spline_file,
dpl_POINT look_at_point,
float scale_fac,
float dt )
{
dpl_POINT vel0, vel1;
/* compute roll, pitch, yaw from keyboard input */
if (kbhit()) {
int ch;
ch = getch();
if (enhanced_key) {
enhanced_key = 0; //False
switch (ch) {
case 'H': // 0,72 'H' up arrow
y_velocity+=dspeed;
break;
case 'P': // 0,80 'P' down arrow
y_velocity-=dspeed;
break;
case 'M': // 0,77 'M' left arrow
x_velocity+=dspeed;
break;
case 'K': // 0,75 'K' right arrow
x_velocity-=dspeed;
break;
}
}
else if (ch == 0) {
enhanced_key = -1; //True
}
else {
switch (ch) {
case '7' : /* roll left */
roll_velocity += dspin;
break;
case '9': /* roll right */
roll_velocity -= dspin;
break;
case '4' : /* swing left weeet chariot */
yaw_velocity+=dspin;
break;
case '6' : /* right */
yaw_velocity-=dspin;
break;
case '8' : /* upp */
pitch_velocity-=dspin;
break;
case '2' : /* downnn */
pitch_velocity+=dspin;
break;
case '5' : /* go faster */
z_velocity+=(dspeed+dspeed);
break;
case '0' : /* decelerate */
z_velocity-=(dspeed+dspeed);
break;
case '-':
pitch = 0.0;
yaw = 0.0;
roll = 0.0;
break;
case ' ' : /* set speed to 0 */
x_velocity=0.0f;
y_velocity=0.0f;
z_velocity=0.0f;
// v--fall through--v //
case '*' :
pitch_velocity = 0.0f;
yaw_velocity = 0.0f;
roll_velocity = 0.0f;
break;
}
}
}
vel0[0]=x_velocity;
vel0[1]=y_velocity;
vel0[2]=-z_velocity;
dpl_IdMatrix ( eye->matrix );
roll += roll_velocity;
pitch += pitch_velocity;
yaw += yaw_velocity;
dpl_Rotate ( eye->matrix, roll, dpl_Z );
dpl_Rotate ( eye->matrix, pitch, dpl_X );
dpl_Rotate ( eye->matrix, yaw, dpl_Y );
_xformpoint ( vel1, vel0, eye->matrix );
px+=vel1[0];
py+=vel1[1];
pz+=vel1[2];
dpl_Translate ( eye->matrix, px, py, pz );
dpl_Flush ( eye );
}
/*}}} */
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
0
+35
View File
@@ -0,0 +1,35 @@
# ##############################################################
#
# makefile for WATCOM C to generate PC-interface dView example
#
#
BIN=$(WATCOM)\bin
DVINC=..\libdpl
DVLIB=..\libdpl
CFLAGS= -zp4 -ei -7 -dDVIEW=1 -DMS_DOS=1 -i=$(WATCOM)\h;$(DVINC)
.c.obj:
$(BIN)\wcc386 $(CFLAGS) $<
.obj.exe:
$(BIN)b\wcl386 -l=386 $*.obj startdpl.obj kamera.obj spline.obj $(DVLIB)\libdpl.lib
O=.obj
testf15.exe: testf15.obj testf15.c startdpl.obj spline.obj $(DVLIB)\libdpl.lib
spin.exe: spin.obj spin.c spline.obj startdpl.obj $(DVLIB)\libdpl.lib
tanks.exe: tanks.obj tanks.c camera.obj spline.obj startdpl.obj $(DVLIB)\libdpl.lib
tankfog.exe: tankfog.obj tankfog.c camera.obj spline.obj startdpl.obj $(DVLIB)\libdpl.lib
flyk.exe: flyk.obj flyk.c kamera.obj spline.obj startdpl.obj $(DVLIB)\libdpl.lib
test.exe: test.obj test.c $(DVLIB)\libdpl.lib
glomm.exe: glomm.obj glomm.c
$(BIN)b\wcl386 -l=386 $*.obj
+48
View File
@@ -0,0 +1,48 @@
# ##############################################################
#
# makefile for WATCOM C to generate dpl interface
#
#
BIN=$(WATCOM)\bin
CFLAGS= -we -ox -ei -7 -DMS_DOS -i=$(WATCOM)\h;.
.c.obj:
$(BIN)\wcc386 $(CFLAGS) $<
.asm.obj:
386asm -80386P -COMPAT M1 $*.asm
test.obj : test.c dpl.h dpltypes.h
dpl.obj : dpl.c dpl.h dpl_host.h dpltypes.h vr_comms.h
dpl_host.obj : dpl_host.c dpl.h dpl_host.h dpltypes.h vr_comms.h
dpl_load.obj : dpl_load.c dpl.h dpl_host.h dpltypes.h vr_comms.h
vr_comms.obj : vr_comms.c vr_comms.h dpl.h dpl_host.h dpltypes.h
bizread.obj : bizread.c bizread.h dpl_host.h dpltypes.h
matrix.obj : matrix.c matrix.h dpl_host.h dpltypes.h
linkio.obj : linkio.c linkio.h
libdpl.lib: dpl.obj dpl_host.obj dpl_load.obj vr_comms.obj linkio.obj outfast.obj bizread.obj matrix.obj
$(BIN)b\wlib libdpl.lib -+dpl.obj -+dpl_host.obj -+dpl_load.obj -+vr_comms.obj -+linkio.obj -+outfast.obj -+bizread.obj -+matrix.obj
copy libdpl.lib libdpl
copy dpl.h libdpl
copy dpltypes.h libdpl
copy basictyp.h libdpl
test.exe : test.c test.obj libdpl.lib
$(BIN)b\wcl386 -l=386 $*.obj libdpl.lib
testla.exe : testla.c testla.obj vr_comms.c vr_comms.obj dpl_load.obj dpl_host.c dpl_host.obj dpl.c dpl.obj linkio.c linkio.obj outfast.obj
$(BIN)b\wcl386 -l=386 $*.obj dpl_load.obj dpl_host.obj vr_comms.obj dpl.obj linkio.obj outfast.obj
testrand.exe : testrand.c testrand.obj
$(BIN)b\wcl386 -l=386 $*.obj
+26
View File
@@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
static int my_malloced=0;
char *my_malloc ( int n )
{
char *c=malloc(n);
if (c) {
my_malloced+=n;
printf ( "malloced %d bytes, total %d\n", n, my_malloced );
}
else {
printf ( "malloced FAILED on %d bytes, total %d\n", n, my_malloced );
}
return c;
}
void my_free ( char *c )
{
free(c);
printf ("free 0x%x\n", c );
}
+61
View File
@@ -0,0 +1,61 @@
Volume in drive U is VOL2
Volume Serial Number is 0900-7C68
Directory of U:\DEMOS\VR\MAZE\SAMPLE16
COLOUR PST 47632 07-24-92 7:19a
FILE PST 72320 07-24-92 7:21a
TWEET PST 52922 03-20-92 10:53p
STOP PST 60000 03-20-92 10:53p
LIGHT PST 40228 03-20-92 10:53p
RESIZE PST 80212 03-20-92 10:53p
FILER PST 62050 03-20-92 10:52p
POP PST 21170 10-31-91 3:43p
WINDOW PST 246962 03-20-92 10:51p
DIRECT PST 63356 03-20-92 10:52p
QUACK PST 37928 03-20-92 10:53p
DOOR PST 133334 03-20-92 10:52p
TOM1 PST 60000 03-20-92 10:51p
PAINT PST 42336 07-24-92 7:18a
GLOBE PST 60416 03-20-92 10:52p
BREATH PST 205504 07-25-92 3:32p
WALK PST 45872 07-24-92 9:23a
WHOOSH PST 52922 03-20-92 10:52p
START PST 88202 03-20-92 10:52p
SURF PST 470992 06-05-92 4:46p
CLANG PST 88202 03-20-92 10:51p
ZZTOP PST 352800 04-25-93 1:36p
RUNNING PST 44102 03-20-92 10:51p
BUFFER PST 66624 03-20-92 10:53p
GUN PST 66668 03-20-92 10:51p
JAWS2 PST 207264 07-25-92 4:32p
TOM2 PST 80000 03-20-92 10:51p
PICK PST 35280 07-11-92 6:16p
BLUEDRM PST 666800 07-23-92 11:33a
BIGRUSH PST 492160 07-23-92 11:41a
BLUES PST 696784 07-23-92 11:54a
TROT PST 74960 07-26-92 3:24p
TRIUMPH PST 335152 07-23-92 12:11p
PICK2 PST 35280 07-24-92 8:34a
BUMPH PST 335152 07-23-92 3:00p
BIGUMPH PST 1229504 07-23-92 3:01p
PING PST 62624 07-23-92 6:30p
PING2 PST 89968 07-23-92 6:34p
FLY PST 51152 07-24-92 7:17a
WORLD PST 97024 07-24-92 7:20a
SCALE PST 70560 07-24-92 7:20a
TRASH PST 51152 07-24-92 7:22a
GALLOP PST 86448 07-26-92 3:25p
SPLASH PST 229328 07-23-92 12:18p
DROP PST 26448 07-11-92 6:14p
SATCH PST 500080 04-25-93 12:58p
MOTOR PST 44096 08-26-92 1:50p
JET PST 17632 08-26-92 1:47p
BEETH6 PST 692368 04-25-93 1:41p
ADD BAT 29 10-29-92 12:03a
RENAULT PST 554784 04-25-93 1:48p
HORN1 PST 70560 04-25-93 1:54p
HORN2 PST 211680 04-25-93 1:55p
HORN3 PST 52912 04-25-93 1:56p
54 file(s) 9659935 bytes
495288320 bytes free
+79
View File
@@ -0,0 +1,79 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*{{{ void copy_image ( int *dest, int *src, in x0, int y0 )*/
void copy_image ( int *dest, int *src, int x0, int y0 )
{
int i, s_index, d_index, j;
d_index=(y0*256)+x0;
s_index=15;
for (j=0; j<64; j++ ) {
for (i=0; i<32; i++) {
int t;
t=src[s_index+i];
if (t==0) {
dest[d_index+i]=0x0;
}
else {
dest[d_index+i]=t | 256;
}
}
d_index+=256;
s_index+=64;
}
}
/*}}} */
/*{{{ int main ( int argc, char **argv )*/
int main ( int argc, char **argv )
{
FILE *s, *d;
char fname[256];
int *dest=malloc(256*256*sizeof(int));
int *src =malloc(64*64*sizeof(int));
int i, j, fix=1, index;
for (j=0; j<4; j++ ) {
for (i=0; i<8; i++) {
int ii, jj;
int *srcp=src;
sprintf ( fname, "t:/usr/phil/f%d.tga", fix );
fix++;
printf ("read file %s\n", fname );
s=fopen( fname, "rb" );
fread ( src, 1, 18, s ); /* throw away tga header */
for (ii=0; ii<64; ii++ ) { /* read tga as 24-bit pixels */
for (jj=0; jj<64; jj++ ) {
char *csrcp=(char *) srcp;
*srcp=0;
fread ( csrcp+1, 1, 1, s );
fread ( csrcp+2, 1, 1, s );
fread ( csrcp+3, 1, 1, s );
srcp++;
}
}
fclose (s);
index=(j*256*64)+(i*32);
printf ("extracting central portion\n" );
copy_image(dest, src, i*32, j*64 );
}
}
strcpy ( fname, "t:/usr/phil/allovem.svt" );
d=fopen( fname, "wb" );
fwrite ( dest, 1, 256*256*4, d );
fclose (d);
}
/*}}} */
+30
View File
@@ -0,0 +1,30 @@
FOG 2000.0 10000.0 0.4 0.3 0.2
BACKGND 0.4 0.6 0.8
AMBIENT 0.3 0.3 0.3
LIGHT 0.69 0.69 0.69 60 30 0
STATIC ocean 20.0 0 -190 0 0 0 0
STATIC ddmule 44 -800 0 -800 0 178 0
STATIC ddmule 44 -800 0 0 0 20 0
STATIC ddmule 44 -800 0 800 0 -42 0
STATIC ddmule 44 0 0 -800 0 50 0
STATIC ddmule 44 0 0 0 0 20 0
STATIC ddmule 44 0 0 800 0 -42 0
STATIC ddmule 44 800 0 -800 0 -35 0
STATIC ddmule 44 800 0 0 0 20 0
STATIC ddmule 44 800 0 800 0 -42 0
DYNAMIC ddmule 44 tankvw1.spl 0.4 0.00232
DYNAMIC ddmule 44 tankvw2.spl 2.4 0.00832
DYNAMIC ddmule 44 tankvw3.spl 0.6 0.00232
DYNAMIC ddmule 44 tankvw4.spl 1.2 0.00532
STATIC plant1 30.0 -500 -190 -600 0 -35 90
STATIC plant2 32.0 0 -190 -500 0 70 90
STATIC plant3 31.0 600 -190 -500 0 20 90
STATIC plant1 70.0 -1100 -190 400 0 -35 90
+1
View File
@@ -0,0 +1 @@
testf15 400 0
+34
View File
@@ -0,0 +1,34 @@
32
-0.2 0.1 0.0 0.0 0.0 0.0
0.3 -1.4 0.1 2.0 4.0 2.0
0.2 -1.4 0.1 2.0 2.0 3.0
0.3 -1.4 0.1 2.0 4.0 5.0
0.2 0.3 1.7 3.0 2.0 3.0
0.1 0.4 0.1 4.0 2.0 4.0
-0.0 -0.1 -0.6 1.0 -3.0 0.0
-0.0 -0.4 -0.1 1.0 -3.0 1.0
-0.0 -0.3 -0.1 1.0 -3.0 0.0
0.3 1.0 0.1 3.0 -1.0 -5.0
0.1 1.31 1.8 -1.0 3.0 2.0
0.1 1.41 -1.2 -1.0 3.0 4.0
0.3 0.01 1.5 0.0 3.0 0.0
0.0 0.01 0.2 0.0 0.0 360.0
0.1 0.41 -0.2 1.0 0.0 360.0
0.2 -0.21 -0.3 0.0 0.0 360.0
0.1 -0.2 0.25 2.0 2.0 361.0
-0.0 -0.3 -0.4 0.0 -3.0 359.0
0.3 0.2 0.1 2.0 -1.0 360.0
-0.2 0.01 0.2 0.0 0.0 360.0
0.0 0.01 0.2 0.0 0.0 0.0
0.4 0.31 0.0 2.0 0.0 0.0
-0.2 1.8 0.1 2.0 0.0 0.0
0.3 1.8 0.3 1.0 2.0 5.0
-0.2 1.8 0.0 2.0 0.0 0.0
-0.2 1.6 0.0 2.0 0.0 0.0
0.2 1.7 0.2 2.0 0.0 0.0
-0.2 1.8 0.0 2.0 0.0 0.0
0.3 1.6 0.3 1.0 2.0 5.0
0.3 -0.4 0.3 1.0 2.0 0.0

Binary file not shown.
Binary file not shown.
+117
View File
@@ -0,0 +1,117 @@
DIV-VIZ2
HEADER
(
VERSION=2:01;
DATE=28:2:94;
TIME=17:55
)
{
}
TEXTURE(NAME=plant)
{
MAP {"funknoiz.svt"}
MINIFY {POINT_SAMPLED}
MAGNIFY {BILINEAR}
}// End of texture
MATERIAL(NAME=robert)
{
TEXTURE {plant}
AMBIENT {0.39, 0.99, 0.19}
DIFFUSE {0.39, 0.99, 0.19}
}// End of material
OBJECT
(
)
{
PATCH
(
F_MATERIAL=robert;
B_MATERIAL=robert;
VERTEX=RGB 2D_TEXTURE ;
)
{
TRISTRIP {
{-7.35181e-008, -3.02097, -320, 0.31453, 0.262108, 0.131054, 0, 0, 0}
{-6.30152e-008, -2.58939, -318, 0.224363, 0.186969, 0.093484, 1, 0, 0.499975}
{-2, -2.44554, -320, 0.334181, 0.278484, 0.139242, 0, 0.499975, 0}
{-2, -2.02296, -318, 0.277538, 0.231282, 0.115641, 1, 0.499975, 0.499975}
{-4, -2.01396, -320, 0.446312, 0.371927, 0.185963, 0, 0.99995, 0}
{-4, -1.73526, -318, 0.368861, 0.307384, 0.153692, 1, 0.99995, 0.499975}
{-6, -2.31069, -320, 0.312218, 0.260181, 0.130091, -1, 1.49993, 0}
{-6, -1.72626, -318, 0.334181, 0.278484, 0.139242, 1, 1.49993, 0.499975}
{-8, -1.87011, -320, 0.298346, 0.248621, 0.124311, -0.4, 1.9999, 0}
{-8, -1.01598, -318, 0.498331, 0.415276, 0.207638, 1, 1.9999, 0.499975}
{-10, -1.59141, -320, 0.349209, 0.291007, 0.145504, 0, 2.49988, 0}
{-10, -1.00698, -318, 0.500643, 0.417203, 0.208601, 1, 2.49988, 0.499975}
{-12, -1.43856, -320, 0.315686, 0.263072, 0.131536, 0, 2.99985, 0}
{-12, -0.5844, -318, 0.664794, 0.553995, 0.276997, 1, 2.99985, 0.499975}
{-14, -1.29468, -320, 0.520295, 0.433579, 0.21679, -1.1, 3.49983, 0}
{-14, -1.01598, -318, 0.683289, 0.569407, 0.284704, 1, 3.49983, 0.499975}
{-16, -2.16681, -320, 0.478679, 0.3989, 0.19945, -0.4, 3.9998, 0}
{-16, -2.15784, -318, 0.42666, 0.35555, 0.177775, 1, 3.9998, 0.499975}
}
TRISTRIP {
{-6.30152e-008, -2.58939, -318, 0.224363, 0.186969, 0.093484, 1, 0, 0.499975}
{-3.5227e-008, -1.44753, -316, 0.294878, 0.245731, 0.122866, 1, 0, 0.99995}
{-2, -2.02296, -318, 0.277538, 0.231282, 0.115641, 1, 0.499975, 0.499975}
{-2, -1.01598, -316, 0.388512, 0.32376, 0.16188, 1, 0.499975, 0.99995}
{-4, -1.73526, -318, 0.368861, 0.307384, 0.153692, 1, 0.99995, 0.499975}
{-4, -1.15983, -316, 0.46134, 0.38445, 0.192225, 1, 0.99995, 0.99995}
{-6, -1.72626, -318, 0.334181, 0.278484, 0.139242, 1, 1.49993, 0.499975}
{-6, -1.58241, -316, 0.409321, 0.3411, 0.17055, 1, 1.49993, 0.99995}
{-8, -1.01598, -318, 0.498331, 0.415276, 0.207638, 1, 1.9999, 0.499975}
{-8, -1.44753, -316, 0.535323, 0.446102, 0.223051, 1, 1.9999, 0.99995}
{-10, -1.00698, -318, 0.500643, 0.417203, 0.208601, 1, 2.49988, 0.499975}
{-10, -1.87011, -316, 0.519139, 0.432616, 0.216308, 1, 2.49988, 0.99995}
{-12, -0.5844, -318, 0.664794, 0.553995, 0.276997, 1, 2.99985, 0.499975}
{-12, -1.87011, -316, 0.537634, 0.448029, 0.224014, 1, 2.99985, 0.99995}
{-14, -1.01598, -318, 0.683289, 0.569407, 0.284704, 1, 3.49983, 0.499975}
{-14, -1.73526, -316, 0.609306, 0.507755, 0.253878, 1, 3.49983, 0.99995}
{-16, -2.15784, -318, 0.42666, 0.35555, 0.177775, 1, 3.9998, 0.499975}
{-16, -2.15784, -316, 0.444, 0.37, 0.185, 1, 3.9998, 0.99995}
}
TRISTRIP {
{-3.5227e-008, -1.44753, -316, 0.294878, 0.245731, 0.122866, 1, 0, 0.99995}
{-1.75043e-008, -0.71928, -314, 0.315686, 0.263072, 0.131536, 1, 0, 1.49993}
{-2, -1.01598, -316, 0.388512, 0.32376, 0.16188, 1, 0.499975, 0.99995}
{-2, -0.44055, -314, 0.498331, 0.415276, 0.207638, 1, 0.499975, 1.49993}
{-4, -1.15983, -316, 0.46134, 0.38445, 0.192225, 1, 0.99995, 0.99995}
{-4, -0.8721, -314, 0.553819, 0.461516, 0.230758, 1, 0.99995, 1.49993}
{-6, -1.58241, -316, 0.409321, 0.3411, 0.17055, 1, 1.49993, 0.99995}
{-6, -1.44753, -314, 0.516827, 0.430689, 0.215345, 1, 1.49993, 1.49993}
{-8, -1.44753, -316, 0.535323, 0.446102, 0.223051, 1, 1.9999, 0.99995}
{-8, -1.73526, -314, 0.553819, 0.461516, 0.230758, 1, 1.9999, 1.49993}
{-10, -1.87011, -316, 0.519139, 0.432616, 0.216308, 1, 2.49988, 0.99995}
{-10, -2.45454, -314, 0.497176, 0.414313, 0.207156, 1, 2.49988, 1.49993}
{-12, -1.87011, -316, 0.537634, 0.448029, 0.224014, 1, 2.99985, 0.99995}
{-12, -2.73324, -314, 0.482148, 0.40179, 0.200895, 1, 2.99985, 1.49993}
{-14, -1.73526, -316, 0.609306, 0.507755, 0.253878, 1, 3.49983, 0.99995}
{-14, -2.59839, -314, 0.47868, 0.3989, 0.19945, 1, 3.49983, 1.49993}
{-16, -2.15784, -316, 0.444, 0.37, 0.185, 1, 3.9998, 0.99995}
{-16, -2.44554, -314, 0.463652, 0.386376, 0.193188, 1, 3.9998, 1.49993}
}
TRISTRIP {
{-1.75043e-008, -0.71928, -314, 0.315686, 0.263072, 0.131536, 1, 0, 1.49993}
{0, 0, -312, 0.494399, 0.414543, 0.205575, 0, 0, 1.9999}
{-2, -0.44055, -314, 0.498331, 0.415276, 0.207638, 0.6, 0.499975, 1.49993}
{-2, -0.43155, -312, 0.536479, 0.447066, 0.223533, 0, 0.499975, 1.9999}
{-4, -0.8721, -314, 0.553819, 0.461516, 0.230758, 1, 0.99995, 1.49993}
{-4, -1.15083, -312, 0.537635, 0.448029, 0.224014, -0.4, 0.99995, 1.9999}
{-6, -1.44753, -314, 0.516827, 0.430689, 0.215345, 1, 1.49993, 1.49993}
{-6, -1.72626, -312, 0.482148, 0.40179, 0.200895, 0, 1.49993, 1.9999}
{-8, -1.73526, -314, 0.553819, 0.461516, 0.230758, 0.5, 1.9999, 1.49993}
{-8, -1.87011, -312, 0.517983, 0.431652, 0.215826, 0.3, 1.9999, 1.9999}
{-10, -2.45454, -314, 0.497176, 0.414313, 0.207156, 1, 2.49988, 1.49993}
{-10, -2.58939, -312, 0.482147, 0.40179, 0.200895, -0.4, 2.49988, 1.9999}
{-12, -2.73324, -314, 0.482148, 0.40179, 0.200895, 0.2, 2.99985, 1.49993}
{-12, -3.16482, -312, 0.407009, 0.339174, 0.169587, 0, 2.99985, 1.9999}
{-14, -2.59839, -314, 0.47868, 0.3989, 0.19945, 1, 3.49983, 1.49993}
{-14, -3.02097, -312, 0.499487, 0.416239, 0.20812, -0.5, 3.49983, 1.9999}
{-16, -2.44554, -314, 0.463652, 0.386376, 0.193188, 1, 3.9998, 1.49993}
{-16, -3.02097, -312, 0.390825, 0.325687, 0.162844, -1, 3.9998, 1.9999}
}
}// End of patch
}// End of object
+23
View File
@@ -0,0 +1,23 @@
22
0 100 0 0 90 5
-200 70 1000 0 180 -4
-400 108 3000 0 180 3
-300 128 8000 0 180 -2
-400 30 16000 0 180 7
-300 70 24000 0 180 -4
-400 108 32000 0 180 5
-200 58 37000 0 180 1
-100 78 39000 0 180 -1
0 98 40000 0 270 10
100 118 41000 0 180 -8
0 128 42000 0 90 1
-100 148 41000 0 0 -3
0 168 40000 0 -90 8
100 148 39000 0 0 -3
200 138 37000 0 0 12
300 118 32000 0 0 -9
300 50 24000 0 0 7
200 70 16000 0 0 -9
260 48 8000 0 0 2
280 28 3000 0 0 1
80 30 1000 0 0 -8
+23
View File
@@ -0,0 +1,23 @@
22
0 210 0 3 90 5
-100 270 1000 0 135 -4
-400 268 3000 -3 180 3
-300 178 8000 1 180 -2
-400 130 16000 -2 180 10
-600 70 24000 4 180 -14
-500 28 32000 -8 180 6
-700 70 40000 5 180 -9
-500 28 48000 -7 180 6
-400 58 53000 4 180 12
-300 128 55000 -2 225 -9
-50 248 56000 3 270 10
100 278 55000 -4 315 -3
200 288 53000 5 360 7
410 268 48000 -3 360 -2
560 218 40000 6 360 9
500 108 32000 2 360 -9
600 150 24000 -8 360 7
450 70 16000 -4 360 -19
360 48 8000 3 360 2
210 78 3000 4 360 11
80 130 1000 -1 315 -8
+23
View File
@@ -0,0 +1,23 @@
22
0 260 0 3 90 5
-100 320 1000 0 135 -4
-400 318 3000 -3 180 3
-300 228 8000 1 180 -2
-400 180 16000 -2 180 10
-600 120 24000 4 180 -14
-500 78 32000 -8 180 6
-700 120 40000 5 180 -9
-500 78 48000 -7 180 6
-400 108 53000 4 180 12
-300 178 55000 -2 225 -9
-50 298 56000 3 270 10
100 328 55000 -4 315 -3
200 338 53000 5 360 7
410 318 48000 -3 360 -2
560 268 40000 6 360 9
500 158 32000 2 360 -9
600 200 24000 -8 360 7
450 120 16000 -4 360 -19
360 98 8000 3 360 2
210 128 3000 4 360 11
80 180 1000 -1 315 -8
+19
View File
@@ -0,0 +1,19 @@
18
100 200 0 0 90 5
300 130 1000 0 180 -4
600 208 3000 0 180 3
800 128 8000 0 180 2
700 230 16000 0 180 -3
900 210 24000 0 180 4
630 178 32000 0 180 5
750 180 37000 0 180 1
960 158 39000 0 180 -1
10 118 40000 0 90 1
-980 228 39000 0 0 -3
-840 218 37000 0 0 1
-930 168 32000 0 0 6
-750 30 24000 0 0 0
-640 70 16000 0 0 -2
-700 148 8000 0 0 2
-860 28 3000 0 0 1
-110 130 1000 0 0 4
+19
View File
@@ -0,0 +1,19 @@
18
100 100 0 0 90 5
500 170 1000 0 180 -4
600 108 3000 0 180 3
400 328 8000 0 180 2
700 30 16000 0 180 -3
500 270 24000 0 180 4
600 108 32000 0 180 5
700 128 37000 0 180 1
900 128 39000 0 180 -1
10 128 40000 0 90 1
-900 128 39000 0 0 -3
-800 128 37000 0 0 1
-900 128 32000 0 0 6
-700 230 24000 0 0 0
-600 70 16000 0 0 -2
-700 108 8000 0 0 2
-800 328 3000 0 0 1
-80 30 1000 0 0 4
+19
View File
@@ -0,0 +1,19 @@
18
100 100 0 0 90 5
500 170 1000 0 180 -4
600 108 3000 0 180 3
400 328 8000 0 180 2
700 30 16000 0 180 -3
500 270 24000 0 180 4
600 108 32000 0 180 5
700 128 37000 0 180 1
900 128 39000 0 180 -1
10 128 40000 0 90 1
-900 128 39000 0 0 -3
-800 128 37000 0 0 1
-900 128 32000 0 0 6
-700 230 24000 0 0 0
-600 70 16000 0 0 -2
-700 108 8000 0 0 2
-800 328 3000 0 0 1
-80 30 1000 0 0 4
+19
View File
@@ -0,0 +1,19 @@
18
100 100 0 0 90 5
500 170 1000 0 180 -4
600 108 3000 0 180 3
400 328 8000 0 180 2
700 30 16000 0 180 -3
500 270 24000 0 180 4
600 108 32000 0 180 5
700 128 37000 0 180 1
900 128 39000 0 180 -1
10 128 40000 0 90 1
-900 128 39000 0 0 -3
-800 128 37000 0 0 1
-900 128 32000 0 0 6
-700 230 24000 0 0 0
-600 70 16000 0 0 -2
-700 108 8000 0 0 2
-800 328 3000 0 0 1
-80 30 1000 0 0 4
+19
View File
@@ -0,0 +1,19 @@
18
100 100 0 0 90 5
500 170 1000 0 180 -4
600 108 3000 0 180 3
400 328 8000 0 180 2
700 30 16000 0 180 -3
500 270 24000 0 180 4
600 108 32000 0 180 5
700 128 37000 0 180 1
900 128 39000 0 180 -1
10 128 40000 0 90 1
-900 128 39000 0 0 -3
-800 128 37000 0 0 1
-900 128 32000 0 0 6
-700 230 24000 0 0 0
-600 70 16000 0 0 -2
-700 108 8000 0 0 2
-800 328 3000 0 0 1
-80 30 1000 0 0 4
+19
View File
@@ -0,0 +1,19 @@
18
100 100 0 0 90 5
500 170 1000 0 180 -4
600 108 3000 0 180 3
400 328 8000 0 180 2
700 30 16000 0 180 -3
500 270 24000 0 180 4
600 108 32000 0 180 5
700 128 37000 0 180 1
900 128 39000 0 180 -1
10 128 40000 0 90 1
-900 128 39000 0 0 -3
-800 128 37000 0 0 1
-900 128 32000 0 0 6
-700 230 24000 0 0 0
-600 70 16000 0 0 -2
-700 108 8000 0 0 2
-800 328 3000 0 0 1
-80 30 1000 0 0 4
+19
View File
@@ -0,0 +1,19 @@
18
200 200 0 0 90 5
400 70 1000 0 180 -4
500 108 3000 0 180 3
600 228 8000 0 180 2
300 130 16000 0 180 -3
700 70 24000 0 180 4
400 208 32000 0 180 5
800 108 37000 0 180 1
500 228 39000 0 180 -1
10 628 40000 0 90 1
-500 128 39000 0 0 -3
-700 138 37000 0 0 1
-800 178 32000 0 0 6
-500 130 24000 0 0 0
-900 270 16000 0 0 -2
-100 148 8000 0 0 2
-500 128 3000 0 0 1
-100 30 1000 0 0 4
View File
+103
View File
@@ -0,0 +1,103 @@
102
10 0.158300 2 37.736755 -45.000000 2720.064941
10 0.296900 2 37.736755 -45.000000 2720.064941
10 0.326600 2 37.736755 -45.000000 2720.064941
10 0.356300 2 37.736755 -45.000000 2720.064941
10 0.366200 2 37.736755 -45.000000 2720.064941
10 0.395900 2 37.736755 -45.000000 2720.064941
10 0.425600 2 37.736755 -45.000000 2720.064941
10 0.445400 2 37.736755 -45.000000 2720.064941
10 0.475100 2 37.736755 -45.000000 2720.064941
10 0.613700 1 37.736755 -45.000000 2720.064941
10 0.752299 1 37.736755 -45.000000 2720.064941
10 0.781999 1 37.736755 -45.000000 2720.064941
10 0.791899 1 37.736755 -45.000000 2720.064941
10 0.821599 1 37.736755 -45.000000 2720.064941
10 0.851299 1 37.736755 -45.000000 2720.064941
10 0.871099 1 37.736755 -45.000000 2720.064941
10 0.900799 1 37.736755 -45.000000 2720.064941
10 0.930499 1 37.736755 -45.000000 2720.064941
11 0.366200 1 38.309364 -45.000000 2719.680176
11 0.950299 1 38.381969 -44.767715 2719.183594
12 0.098900 1 38.381969 -44.767715 2719.183594
12 0.108800 1 38.381969 -44.767715 2719.183594
12 0.138500 1 38.381969 -44.767715 2719.183594
12 0.168200 1 38.381969 -44.767715 2719.183594
12 0.554300 8 38.381969 -44.767715 2719.183594
12 0.613700 6 38.381969 -44.767715 2719.183594
12 0.781999 3 38.381969 -44.767715 2719.183594
12 0.811699 4 38.381969 -44.767715 2719.183594
12 0.821599 5 38.381969 -44.767715 2719.183594
12 0.851299 6 38.381969 -44.767715 2719.183594
13 0.079100 2 38.381969 -44.767715 2719.183594
13 0.108800 3 38.381969 -44.767715 2719.183594
13 0.296900 2 38.381969 -44.767715 2719.183594
14 0.781999 8 38.381969 -44.767715 2719.183594
14 0.920599 8 38.381969 -44.767715 2719.183594
15 0.306800 8 38.381969 -44.767715 2719.183594
15 0.356300 8 38.381969 -44.767715 2719.183594
15 0.415700 8 38.381969 -44.767715 2719.183594
15 0.475100 8 38.381969 -44.767715 2719.183594
15 0.524600 8 38.381969 -44.767715 2719.183594
15 0.554300 8 38.381969 -44.767715 2719.183594
15 0.613700 8 38.381969 -44.767715 2719.183594
15 0.653300 8 38.381969 -44.767715 2719.183594
15 0.702800 8 38.381969 -44.767715 2719.183594
15 0.752299 8 38.381969 -44.767715 2719.183594
15 0.781999 8 38.381969 -44.767715 2719.183594
15 0.841399 8 38.381969 -44.767715 2719.183594
15 0.871099 8 38.381969 -44.767715 2719.183594
15 0.920599 8 38.381969 -44.767715 2719.183594
15 0.979999 8 38.381969 -44.767715 2719.183594
16 0.029600 8 38.381969 -44.767715 2719.183594
16 0.079100 8 38.381969 -44.767715 2719.183594
16 0.128600 8 38.381969 -44.767715 2719.183594
16 0.158300 8 38.381969 -44.767715 2719.183594
16 0.217700 8 38.381969 -44.767715 2719.183594
16 0.247400 8 38.381969 -44.767715 2719.183594
16 0.306800 8 38.381969 -44.767715 2719.183594
16 0.673100 1 38.381969 -44.767715 2719.183594
16 0.811699 1 38.381969 -44.767715 2719.183594
16 0.821599 1 38.381969 -44.767715 2719.183594
16 0.851299 1 38.381969 -44.767715 2719.183594
16 0.871099 1 38.381969 -44.767715 2719.183594
16 0.900799 1 38.381969 -44.767715 2719.183594
16 0.930499 1 38.381969 -44.767715 2719.183594
16 0.960199 1 38.381969 -44.767715 2719.183594
16 0.979999 1 38.381969 -44.767715 2719.183594
17 0.019700 1 38.381969 -44.767715 2719.183594
17 0.049400 1 38.381969 -44.767715 2719.183594
17 0.059300 1 38.381969 -44.767715 2719.183594
17 0.089000 1 38.381969 -44.767715 2719.183594
17 0.128600 1 38.381969 -44.767715 2719.183594
17 0.138500 1 38.381969 -44.767715 2719.183594
17 0.168200 1 38.381969 -44.767715 2719.183594
17 0.197900 1 38.381969 -44.767715 2719.183594
17 0.762199 1 38.381969 -44.767715 2719.183594
17 0.900799 1 38.381969 -44.767715 2719.183594
17 0.930499 1 38.381969 -44.767715 2719.183594
17 0.940399 1 38.381969 -44.767715 2719.183594
17 0.979999 1 38.381969 -44.767715 2719.183594
18 -0.000100 1 38.381969 -44.767715 2719.183594
18 0.029600 1 38.381969 -44.767715 2719.183594
18 0.059300 1 38.381969 -44.767715 2719.183594
18 0.079100 1 38.381969 -44.767715 2719.183594
18 0.108800 1 38.381969 -44.767715 2719.183594
18 0.138500 1 38.381969 -44.767715 2719.183594
18 0.168200 1 38.381969 -44.767715 2719.183594
18 0.178100 1 38.381969 -44.767715 2719.183594
18 0.217700 1 38.381969 -44.767715 2719.183594
18 0.247400 1 38.381969 -44.767715 2719.183594
18 0.257300 1 38.381969 -44.767715 2719.183594
18 0.287000 1 38.381969 -44.767715 2719.183594
18 0.306800 1 38.381969 -44.767715 2719.183594
18 0.336500 1 38.381969 -44.767715 2719.183594
18 0.366200 1 38.381969 -44.767715 2719.183594
18 0.395900 1 38.381969 -44.767715 2719.183594
18 0.415700 1 38.381969 -44.767715 2719.183594
18 0.445400 1 38.381969 -44.767715 2719.183594
18 0.475100 1 38.381969 -44.767715 2719.183594
18 0.485000 1 38.381969 -44.767715 2719.183594
18 0.524600 1 38.381969 -44.767715 2719.183594
18 0.534500 1 38.381969 -44.767715 2719.183594
18 0.564200 1 38.381969 -44.767715 2719.183594
+19
View File
@@ -0,0 +1,19 @@
18
-13.000000 13.000000 -847.000000 0.000000 180.000000 0.000000
-12.999975 13.000000 -355.600220 0.000000 180.000000 0.000000
-12.999880 13.000000 870.500610 0.000000 180.000000 0.000000
-12.999784 13.000000 2190.496582 0.000000 180.000000 0.000000
-12.999755 11.495656 2611.500488 -22.199995 180.000000 0.000000
-9.721725 7.301622 2621.240967 -22.199995 198.600189 0.000000
19.652800 -24.096941 2692.535156 -22.799994 198.600189 0.000000
19.652800 -24.096941 2692.535156 -29.099977 213.300339 0.000000
19.652800 -24.096941 2692.535156 -32.399971 213.300339 0.000000
19.652800 -24.096941 2692.535156 -32.399971 213.300339 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
19.652800 -24.096941 2692.535156 -32.399971 215.100357 0.000000
+1
View File
@@ -0,0 +1 @@
0
+33
View File
@@ -0,0 +1,33 @@
32
-13.000000 13.000000 -847.000000 0.000000 180.000000 0.000000
-13.000000 13.000000 -820.900574 0.000000 180.000000 0.000000
-4.299994 13.000000 -730.898132 0.000000 180.000000 0.000000
-2.799994 13.000000 -626.496277 0.000000 180.000000 0.000000
1.100019 13.000000 -501.395264 0.000000 180.000000 0.000000
1.100031 13.000000 -351.395264 0.000000 180.000000 0.000000
8.300042 13.000000 -201.395264 0.000000 180.000000 0.000000
8.300042 13.000000 -51.395264 0.000000 180.000000 0.000000
3.800057 13.000000 109.704803 0.000000 180.000000 0.000000
3.800081 13.000000 289.704834 0.000000 180.000000 0.000000
3.800105 13.000000 469.703613 0.000000 180.000000 0.000000
-1.899874 21.099989 649.702393 0.000000 180.000000 0.000000
-5.499868 24.399982 829.701172 0.000000 180.000000 0.000000
2.000154 19.299995 1009.699951 0.000000 180.000000 0.000000
1.700178 8.199999 1189.704346 0.000000 180.000000 0.000000
-3.999812 8.199999 1369.709229 0.000000 180.000000 0.000000
-3.999789 8.199999 1549.714111 0.000000 180.000000 0.000000
-3.999765 8.199999 1729.718994 0.000000 180.000000 0.000000
-3.999760 36.517067 1852.750854 19.200006 180.000000 0.000000
-3.999760 36.681656 1930.905640 -8.700002 180.000000 0.000000
-3.999760 41.287971 1988.996460 8.099998 180.000000 0.000000
-3.999760 40.769279 2048.835693 -4.500003 180.000000 0.000000
-3.999760 38.828079 2131.616455 -1.200004 180.000000 0.000000
-3.999760 38.988346 2221.606689 0.899996 180.000000 0.000000
-3.999760 40.402073 2311.596924 0.899996 180.000000 0.000000
-3.999760 38.852982 2401.449219 -9.600006 180.000000 0.000000
-21.099749 3.019116 2483.218506 -29.099976 180.000000 0.000000
-33.523499 -7.775504 2569.781250 -6.599964 160.199799 0.000000
-55.804218 -23.539778 2654.712891 -4.799963 184.500046 0.000000
-19.971062 -7.554310 2738.041748 25.200020 233.700546 0.000000
33.913113 27.290636 2795.360596 9.900039 263.700470 0.000000
84.342186 19.149284 2583.589844 -20.099960 293.699249 0.000000
+35
View File
@@ -0,0 +1,35 @@
FOG 8000.0 12000.0 0.0 0.0 0.0
BACKGND 0.4 0.6 0.8
AMBIENT 0.3 0.3 0.3
LIGHT 0.9 0.9 0.9 40 60 0
DYNAMIC ddmule 44 race1.spl 0.8 0.0162
DYNAMIC ddmule 44 race1.spl 2.9 0.0162
DYNAMIC ddmule 44 race1.spl 4.2 0.0162
DYNAMIC ddmule 44 race1.spl 6.2 0.0162
DYNAMIC ddmule 44 race1.spl 9.8 0.0162
DYNAMIC ddmule 44 race1.spl 11.5 0.0162
DYNAMIC ddmule 44 race1.spl 13 0.0162
DYNAMIC ddmule 44 race1.spl 18 0.0162
STATIC texcanal 30 -80 -90 -15000 0 180 0
STATIC texcanal 30 -80 -90 0 0 180 0
STATIC texcanal 30 -80 -90 15000 0 180 0
STATIC texcanal 30 -80 -90 30000 0 180 0
STATIC texcanal 30 -80 -90 45000 0 180 0
STATIC texcanal 30 -80 -90 60000 0 180 0
STATIC texcanal 30 -80 -90 75000 0 180 0
STATIC thing 50 550 180 0 0 0 0
STATIC thing 50 -710 180 5000 0 90 0
STATIC thing 50 700 180 10000 0 180 0
STATIC thing 50 -640 180 15000 0 270 0
STATIC thing 50 720 180 20000 0 45 0
STATIC thing 50 -620 180 25000 0 135 0
STATIC plant1 70.0 -100 -90 4000 0 70 90
STATIC plant1 70.0 -500 -90 24000 0 280 90
STATIC plant1 70.0 400 -90 38000 0 90 90
STATIC plant1 70.0 -600 -90 46400 0 260 90
STATIC plant1 70.0 300 -90 41400 0 96 90
+1
View File
@@ -0,0 +1 @@
set DPLARG=/tranny~..\vrendmon.btl~/i860~..\vrend.mng~/link_A~3~/link_B~-1~/device~0x150~/video~svga~/n_860s~1
+1
View File
@@ -0,0 +1 @@
set DPLARG=/tranny~..\vrendmon.btl~/i860~..\vrend.mng~/device~0x150~/video~svga~/n_860s~1~/framebuf~1
+1
View File
@@ -0,0 +1 @@
set DPLARG=/tranny~..\vrendmon.btl~/i860~..\vrend.mng~/device~0x150~/video~svga~/pipes~1~/qual~0x14
+7
View File
@@ -0,0 +1,7 @@
set dos4g=quiet
set LEFTMAGIC=0x3281
set RIGHTMAGIC=0x3281
set vizpath=..\geometry\
set dviewbin=..\dvwrgbin\
set texture=..\texture\
set transputer=200
+7
View File
@@ -0,0 +1,7 @@
set dos4g=quiet
set LEFTMAGIC=0x3291
set RIGHTMAGIC=0x3291
set vizpath=..\geometry\
set dviewbin=..\dvwrgbin\
set texture=..\texture\
set transputer=200
+7
View File
@@ -0,0 +1,7 @@
set dos4g=quiet
set LEFTMAGIC=0x3209
set RIGHTMAGIC=0x3209
set vizpath=..\geometry\
set dviewbin=..\dvwrgbin\
set texture=..\texture\
set transputer=200
+1
View File
@@ -0,0 +1 @@
set DPLARG=/tranny~..\vrendmon.btl~/i860~..\vrend.mng~/link_A~3~/link_B~-1~/device~0x150~/video~ntsc~/n_860s~1
+1
View File
@@ -0,0 +1 @@
set DPLARG=/tranny~..\vrendmon.btl~/i860~..\vrend.mng~/device~0x150~/video~ntsc~/n_860s~1~/framebuf~1
+1
View File
@@ -0,0 +1 @@
set DPLARG=/tranny~..\vrendmon.btl~/i860~..\vrend.mng~/device~0x150~/video~ntsc~/pipes~1~/qual~0x14
+7
View File
@@ -0,0 +1,7 @@
set dos4g=quiet
set LEFTMAGIC=0x32c1
set RIGHTMAGIC=0x32c1
set vizpath=..\geometry\
set dviewbin=..\dvwrgbin\
set texture=..\texture\
set transputer=200
+10
View File
@@ -0,0 +1,10 @@
8
0 0.0 200.0 0.0 270.0 0.0
100 0.0 100.0 0.0 180.0 0.0
0 0.0 0.0 0.0 90.0 0.0
-100 0.0 -100.0 0.0 0.0 0.0
0 0.0 -200.0 0.0 90.0 0.0
100 0.0 -100.0 0.0 180.0 0.0
0 0.0 0.0 0.0 270.0 0.0
-100 0.0 100.0 0.0 360.0 0.0
+1
View File
@@ -0,0 +1 @@
flyk sharks.scn
+28
View File
@@ -0,0 +1,28 @@
FOG 2000.0 12000.0 0.2 0.3 0.5
BACKGND 0.4 0.6 0.8
AMBIENT 0.3 0.6 0.4
LIGHT 0.99 0.82 0.99 60 0 0
STATIC ocean 20.0 0 -190 0 0 0 0
STATIC butter 10.0 -485.0 410.0 -434.0 0 20 0
STATIC golden 10.0 -510.0 420.0 -440.0 0 -70 0
STATIC grouper 10.0 -518.0 400.0 -425.0 0 -10 0
STATIC angel 10.0 -480.0 410.0 -430.0 0 -30 0
STATIC butter 10.0 -460.0 350.0 -434.0 0 -10 0
STATIC golden 10.0 -463.0 361.0 -440.0 0 -15 0
STATIC grouper 10.0 -449.0 370.0 -432.0 0 -20 0
STATIC angel 10.0 -453.0 354.0 -430.0 0 -31 0
STATIC shark 8.0 0 230.0 -200.0 0 0 0
STATIC shark 8.0 280.0 330.0 0 0 20 0
STATIC shark 8.0 -480.0 410.0 -450.0 0 -40 0
STATIC plant 30.0 -500 -190 -600 0 -35 90
STATIC plant 32.0 0 -190 -500 0 70 90
STATIC plant 31.0 600 -190 -500 0 20 90
STATIC plant 27.0 -500 -190 0 0 0 90
STATIC plant 33.0 0 -190 0 0 -30 90
STATIC plant 35.0 500 -190 0 0 90 90
STATIC plant 32.0 -500 -190 500 0 0 90
STATIC plant 42.0 0 -190 600 0 15 90
STATIC plant 49.0 600 -190 500 0 80 90
+10
View File
@@ -0,0 +1,10 @@
8
0 0.0 400.0 0.0 0.0 0
200 0.0 200.0 0.0 0.0 0
0 0.0 0.0 0.0 0.0 0
-200 0.0 -200.0 0.0 0.0 0
0 0.0 -400.0 0.0 0.0 0
200 0.0 -200.0 0.0 0.0 0
0 0.0 0.0 0.0 0.0 0
-200 0.0 200.0 0.0 0.0 0
Binary file not shown.
+274
View File
@@ -0,0 +1,274 @@
/*
FILE : testpp5.c
PROJECT : pxpl5 renderer test
Author : Phil Atkin
(C) Division Ltd 1993.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include "dpl5.h"
#include "boot.h"
#include "startup.h"
char *progname;
int860 link_A, link_B;
extern int860 __acks_per_frame;
extern int magicLeftVal,
magicRightVal;
/*{{{ void eyeStuff ( VIEW *view )*/
void eyeStuff ( VIEW *view, int left )
{
float scale=1.0;
PAZidMatrix(view->f);
PAZidMatrix(view->b);
if (left) scale *= -1.0f;
PAZtranslatePair (view->f, view->b, scale*1.275, 0, 0 );
PAZrotatePair (view->f, view->b, 180, PAZ_Y );
PAZtranslatePair (view->f, view->b, 0, 0, -48 );
if (left == (-1)) view->shift_x=0.0;
else if (left) view->shift_x=0.2147;
else view->shift_x=-0.2147;
/* view->shift_y = 0.0f; */
PAZwriteView ( view );
}
/*}}} */
/*{{{ void spinning_jenny ( INSTANCE *inst, VIEW *view, char *scale_str )*/
void spinning_jenny ( INSTANCE *inst, VIEW *eye, VIEW *rye, char *scale_str, int base, int times )
{
float theta, scale_fac=0.1;
int i;
float then, now;
if (rye == NULL)
eyeStuff ( eye, -1 );
else {
eyeStuff ( eye, 0 );
eyeStuff ( rye, 1 );
}
sscanf(scale_str, "%f", &scale_fac );
printf ("spinning jenny, scale factor %f\n", scale_fac );
for (i=base; i<times; i++) {
int nulls=0;
theta = (i+40)*0.43;
PAZidMatrix(inst->f);
PAZscale (inst->f, scale_fac, scale_fac, scale_fac, 1 );
PAZrotate (inst->f, theta*2.4, PAZ_X, 1 );
PAZrotate (inst->f, theta*1.3, PAZ_Z, 1 );
PAZrotate (inst->f, theta/2.5, PAZ_Y, 1 );
PAZwriteMatrix ( inst );
PAZrenderScene ();
}
}
/*}}} */
/*{{{ char *makeVizName ( char *name )*/
char vizStr [256];
char *makeVizName ( char *name )
{
char *root;
if ((root=getenv("VIZPATH")) == NULL)
return(name);
else {
strcpy ( vizStr, root );
strcat ( vizStr, name );
return ( vizStr );
}
}
/*}}} */
/*{{{ char *makeTexName ( char *name )*/
char texStr [256];
char *makeTexName ( char *name )
{
char *root;
if ((root=getenv("TEXTURE")) == NULL)
return(name);
else {
strcpy ( vizStr, root );
strcat ( vizStr, name );
return ( vizStr );
}
}
/*}}} */
/*{{{ char *makedplName ( char *name )*/
char *makedplName ( char *dplstr, char *name )
{
char *root;
if ((root=getenv("DVIEWBIN")) == NULL)
return(name);
else {
strcpy ( dplstr, root );
strcat ( dplstr, name );
return ( dplstr );
}
}
/*}}} */
/*{{{ int env2hex ()*/
int env2hex ( char *env_str, int default_v )
{
char *s;
int v;
if (s = getenv(env_str)) {
if (sscanf(s, "%x", &v) == 1) {
return v;
}
}
printf ("Defaulting on %s to 0x%x\n", env_str, default_v );
return default_v;
}
/*}}} */
/*{{{ int nain ( int argc, char *argv[])*/
int nain ( int argc, char *argv[])
{
LIGHTSOURCE *bulb1, *bulb2, *bulb3, *bulb4, *bulb5, *bulb6;
INSTANCE *inst, *kiddy, *kiddy2;
OBJECT *obj;
SCENE *s;
VIEW *eye, *rye;
float t;
char *objname;
int i, made, ramp;
MATERIAL *mtl;
TEXTURE *tex;
s = initialize_all ( 0, -1, &eye, &rye );
printf ( "PAZcreateInstance\n" );
inst = PAZcreateInstance ();
printf ("returned 0x%x\n", inst );
obj=PAZcreateObject ( makeVizName(argv[2]), makeTexName );
inst->obj=obj;
PAZidMatrixPair ( inst->f, inst->b );
inst->enable=1;
PAZwriteInstance ( inst );
printf ( "PAZcreateMaterial\n" );
mtl=PAZcreateMaterial();
{
mtl->kd[0]=0.99;
mtl->kd[1]=0.99;
mtl->kd[2]=0.99;
mtl->ks =0.7;
mtl->power=7.3;
mtl->opacity=1.0f;
mtl->tex=tex;
mtl->ramp_entry=0;
strcpy ( mtl->texture_name, "default" );
strcpy ( mtl->material_name, "viz_0001" );
}
PAZwriteMaterial(mtl);
printf ("returned 0x%x\n", mtl );
/* create 3 light bulbs */
/*
*/
bulb1=PAZcreateLight ();
PAZinitLight ( bulb1, 0, 0.9, 0.2, 0.9, 1, 0, 0 );
PAZwriteLight ( bulb1 );
bulb3=PAZcreateLight ();
PAZinitLight ( bulb3, 0, 0.2, 0.9, 0.9, -1, 0, 0 );
PAZwriteLight ( bulb3 );
bulb2=PAZcreateLight ();
PAZinitLight ( bulb2, 2, 0.4, 0.4, 0.4, -0.577, 0.577, -0.577 );
PAZwriteLight ( bulb2 );
PAZsetBackGND ( 0.5, 0.3, 0.2 );
PAZfog ( 1, 200.0, 4000.0, 0.4f, 0.3f, 0.1f );
while (1) {
inst->f_material=mtl->name;
PAZwriteInstance ( inst );
spinning_jenny ( inst, eye, rye, argv[1], 0, 1000 );
inst->f_material=NULL;
PAZwriteInstance ( inst );
spinning_jenny ( inst, eye, rye, argv[1], 0, 1000 );
}
}
/*}}} */
/*{{{ int main ( int argc, char *argv[] )*/
int main ( int argc, char *argv[] )
{
link_A= 1;
link_B=-1;
progname=argv[0];
if (argc < 3) {
printf ("usage %s: <scale> <v2zfile>\n", argv[0] );
exit(666);
}
else {
char dplStr1 [256];
char dplStr2 [256];
magicLeftVal =env2hex("LEFTMAGIC", 0x3281);
magicRightVal=env2hex("RIGHTMAGIC", 0x3281);
if (magicLeftVal & 0x8) {
x_size=1024;
y_size=768;
}
else if (magicLeftVal & 0x10) {
x_size=640;
y_size=480;
}
else if (magicLeftVal & 0x20) {
x_size=832;
y_size=512;
}
start_dView ( makedplName ( dplStr1, "dv_skip.btl"),
NULL,
makedplName ( dplStr2, "pazpl5.mng"),
env2hex("TRANSPUTER", 0x200), 1, -1 );
nain ( argc, argv );
}
}
/*}}} */
+259
View File
@@ -0,0 +1,259 @@
/*{{{ on cubic splining the cheesey way*/
/*
spline path follower - reads in a set of control points
with x, y, z, rx, ry, rz
computes dx, dy, dz, drx, dry, drz per control point by cheesey
difference - dx(n) = 0.5 * (x(n+1) - x(n-1))
these differences are wrt t, the parametric, not time.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*}}} */
/*{{{ spline types*/
typedef struct s_cntl_point {
int knot_id; /* checking */
float pos[3];
float vel[3];
float ang[3];
float rot[3];
float x_pos_cubic[4];
float y_pos_cubic[4];
float z_pos_cubic[4];
float x_rot_cubic[4];
float y_rot_cubic[4];
float z_rot_cubic[4];
struct s_cntl_point *next;
struct s_cntl_point *prev;
} cntl_point;
/*}}} */
/*{{{ void solve_cubic ( float *coeffs, float v0, float v1, float d0, float d1 )*/
static void solve_cubic ( float *coeffs, float v0, float v1, float d0, float d1 )
{
/*
v = at^3 + bt^2 + ct + d
dv = 3at^2 + 2bt + c
d = v0
a+b+c+d = v1
c = d0
3a + 2b + c = d1
2b + 3a = d1 - d0
a + b = v1 - v0 - d0
3a + 2b - 2a - 2b = d1 - d0 - 2v1 + 2v0 + 2d0
a = d1 - d0 - 2v1 + 2v0 + 2d0
a = d1 + d0 - 2v1 + 2v0
b = v1 - v0 - d0 - a
*/
coeffs[3] = v0;
coeffs[2] = d0;
coeffs[0] = d1 + d0 - (2.0f*v1) + (2.0f*v0);
coeffs[1] = v1 - v0 - d0 - coeffs[0];
}
/*}}} */
/*{{{ static void solve_rot_cubic ( float *coeffs, float v0, float v1, float d0, float d1 )*/
static void solve_rot_cubic ( float *coeffs, float v0, float v1, float d0, float d1 )
{
/*
v = at^3 + bt^2 + ct + d
dv = 3at^2 + 2bt + c
d = v0
a+b+c+d = v1
c = d0
3a + 2b + c = d1
2b + 3a = d1 - d0
a + b = v1 - v0 - d0
3a + 2b - 2a - 2b = d1 - d0 - 2v1 + 2v0 + 2d0
a = d1 - d0 - 2v1 + 2v0 + 2d0
a = d1 + d0 - 2v1 + 2v0
b = v1 - v0 - d0 - a
*/
if (d0>360.0f) d0-=360.0f;
if (d1>360.0f) d1-=360.0f;
coeffs[3] = v0;
coeffs[2] = d0;
coeffs[0] = d1 + d0 - (2.0f*v1) + (2.0f*v0);
coeffs[1] = v1 - v0 - d0 - coeffs[0];
}
/*}}} */
/*{{{ void fill_knot ( cntl_point *knot )*/
static void fill_knot ( cntl_point *knot )
{
cntl_point *next=knot->next;
/*{{{ x*/
solve_cubic ( knot->x_pos_cubic,
knot->pos[0], next->pos[0],
knot->vel[0], next->vel[0] );
/*}}} */
/*{{{ y*/
solve_cubic ( knot->y_pos_cubic,
knot->pos[1], next->pos[1],
knot->vel[1], next->vel[1] );
/*}}} */
/*{{{ z pos*/
solve_cubic ( knot->z_pos_cubic,
knot->pos[2], next->pos[2],
knot->vel[2], next->vel[2] );
/*}}} */
/*{{{ x*/
solve_rot_cubic ( knot->x_rot_cubic,
knot->ang[0], next->ang[0],
knot->rot[0], next->rot[0] );
/*}}} */
/*{{{ y*/
solve_rot_cubic ( knot->y_rot_cubic,
knot->ang[1], next->ang[1],
knot->rot[1], next->rot[1] );
/*}}} */
/*{{{ z rot*/
solve_rot_cubic ( knot->z_rot_cubic,
knot->ang[2], next->ang[2],
knot->rot[2], next->rot[2] );
/*}}} */
}
/*}}} */
/*{{{ void knot_velocity ( cntl_point *prev, cntl_point *this, cntl_point *next )*/
static void knot_velocity ( cntl_point *prev, cntl_point *this, cntl_point *next )
{
int i;
for (i=0; i<3; i++ ) {
float v1, v2, delta;
this->vel[i] = (next->pos[i] - prev->pos[i]) / 2.0f;
v1=this->ang[i];
v2=next->ang[i];
delta=v2-v1;
while (delta>180) delta-=180;
while (delta<-180) delta+=180;
this->rot[i] =delta / 2.0f;
/*
if (v1<0) this->ang[i]+=360.0f;
else
*/
while (this->ang[i]>360.0f) this->ang[i]-=360.0f;
}
}
/*}}} */
/*{{{ float eval ( float *coeffs, float t )*/
float eval ( float *coeffs, float t )
{
/* return a*t^3 + b*t^2 + c*t + d */
return (coeffs[0]*t*t*t) + (coeffs[1]*t*t) + (coeffs[2]*t) + coeffs[3];
}
/*}}} */
/*{{{ cntl_point *walk_spline ( cntl_point *v, float *t, float dt )*/
cntl_point *walk_spline ( cntl_point *v, float *t, float dt )
{
float s=dt + (*t);
int fix=1;
while (fix) {
if (s < 0.0f) {
s+=1.0f;
v=v->prev;
}
else if (s > 1.0f) {
s-=1.0f;
v=v->next;
}
else fix=0;
}
*t=s;
return v;
}
/*}}} */
cntl_point *init_splines ( char *fname )
{
FILE *fp=fopen(fname, "rt");
if (fp==NULL) {
printf ("Failed to open spline file %s\n", fname );
return NULL;
}
else {
int n_pts, i;
cntl_point *knots, *prev=NULL;
/* read in cntl points */
fscanf ( fp, "%d\n", &n_pts );
printf ("%d cntl points\n", n_pts );
knots = (cntl_point *) malloc ( n_pts * sizeof (cntl_point));
printf ("malloced knots\n", n_pts );
for (i=0; i<n_pts; i++ ) {
int n_read=0;
n_read= fscanf ( fp, "%f %f %f",
&knots[i].pos[0],
&knots[i].pos[1],
&knots[i].pos[2] );
n_read+=fscanf ( fp, "%f %f %f\n",
&knots[i].ang[0],
&knots[i].ang[1],
&knots[i].ang[2] );
if (n_read == 6) {
knots[i].knot_id = i;
if (prev) {
prev->next=&knots[i];
knots[i].prev=prev;
}
prev=&knots[i];
}
else {
n_pts=i;
break;
}
}
printf ("closing spline file\n" );
fclose(fp);
knots[0].prev=&knots[n_pts-1];
knots[n_pts-1].next=&knots[0];
printf ("patched up %d knots\n", n_pts );
printf ("approximating velocities\n" );
/* approx velocities */
for (i=0; i<n_pts; i++ )
knot_velocity ( knots[i].prev, &knots[i], knots[i].next );
/* compute cubics */
printf ("computing cubics\n" );
for (i=0; i<n_pts; i++ )
fill_knot ( &knots[i] );
return &knots[0];
}
}
+21
View File
@@ -0,0 +1,21 @@
/*{{{ spline types*/
typedef struct s_cntl_point {
int knot_id; /* checking */
float pos[3];
float vel[3];
float ang[3];
float rot[3];
float x_pos_cubic[4];
float y_pos_cubic[4];
float z_pos_cubic[4];
float x_rot_cubic[4];
float y_rot_cubic[4];
float z_rot_cubic[4];
struct s_cntl_point *next;
struct s_cntl_point *prev;
} cntl_point;
extern float eval ( float *coeffs, float t );
extern cntl_point *walk_spline ( cntl_point *v, float *t, float dt );
extern cntl_point *init_splines ( char *fname );
/*}}} */
Binary file not shown.
+202
View File
@@ -0,0 +1,202 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dpltypes.h>
#include <dpl.h>
int x_size=832,
y_size=512;
float near_clip=4.0f, far_clip=2000.0f;
/*{{{ static char *find_dpl_arg ( char *dpl_arg, char *find_arg )*/
static char *find_dpl_arg ( char *dpl_arg, char *find_arg )
{
char *check=dpl_arg, *ret=NULL;
int len=strlen(find_arg);
while (*check) {
/* printf ("checking %s with %s, %d chars\n", find_arg, check, len ); */
if (strncmp (check, find_arg, len) == 0) {
/* found it ? */
/* printf ("preliminary match, on %s\n", check ); */
while ((*check) != dpl_arg_sep) {
if ((*check) == 0x0) return NULL;
/* printf ("skipping %c\n", *check ); */
check++;
}
check++;
if ((*check) == 0x0) return NULL;
else {
/* printf ("match, returning %s!\n", check ); */
return check;
}
}
else check++;
}
return NULL;
}
/*}}} */
/*{{{ int screen_resolution ( dpl_argv )*/
int screen_resolution ( char *dpl_argv )
{
char *video=find_dpl_arg ( dpl_argv, "video" );
if (video == NULL) return 0;
if (strncmp ( video, "ntsc", 4 ) == 0) {
x_size=704;
y_size=480;
return 1;
}
if (strncmp ( video, "vga", 3 ) == 0) {
x_size=640;
y_size=480;
return 1;
}
if (strncmp ( video, "hires", 5 ) == 0) {
x_size=1024;
y_size=768;
return 1;
}
if (strncmp ( video, "svga", 4 ) == 0) {
x_size=832;
y_size=512;
return 1;
}
if (strncmp ( video, "nucolor", 7 ) == 0) {
x_size=640;
y_size=480;
return 1;
}
if (strncmp ( video, "kaiser", 6 ) == 0) {
x_size=640;
y_size=480;
return 1;
}
else {
printf ("Unknown video format %s\n", video );
x_size=640;
y_size=480;
return 0;
}
}
/*}}} */
/*{{{ dpl_ZONE *initialize_eyes ( char *dpl_args, int stereo,*/
dpl_ZONE *initialize_eyes ( int stereo,
dpl_VIEW **lye,
dpl_VIEW **rye,
float fog_near )
{
dpl_ZONE *z;
dpl_VIEW *eye;
float fog_far;
if (fog_near > far_clip)
fog_far=fog_near+256;
else
fog_far=far_clip;
printf ("initialize eyes\n" );
z=dpl_NewZone();
printf ("create 1st view\n" );
*lye = dpl_NewView();
if ((*lye) == NULL) {
printf ("NULL eye\n" );
return NULL;
}
eye=*lye;
dpl_SetZoneEnable ( z, 1 );
dpl_AddZoneToScene ( z );
dpl_SetViewClipPlanes ( eye, near_clip, far_clip );
dpl_SetViewBackGround ( eye, 0.4f, 0.6f, 0.9f );
dpl_SetViewFog ( eye, 0, 0.5f, 0.5f, 0.6f, fog_near, fog_far );
dpl_SetViewProjection ( eye, x_size, y_size,
-1.0f, -1.0f, 1.0f, 1.0f,
1.9f );
dpl_AddViewToScene ( eye );
if (stereo == 0) {
*rye=NULL;
}
else {
printf ("create 2nd view\n" );
*rye = dpl_NewView();
if ((*rye) == NULL) {
printf ("NULL rye\n" );
return NULL;
}
eye=*rye;
dpl_SetViewClipPlanes ( eye, near_clip, far_clip );
dpl_SetViewBackGround ( eye, 0.4f, 0.6f, 0.9f );
dpl_SetViewFog ( eye, 0, 0.5f, 0.5f, 0.6f, fog_near, fog_far );
dpl_SetViewProjection ( eye, x_size, y_size,
-1.0f, -1.0f, 1.0f, 1.0f,
1.9f );
dpl_AddViewToScene ( eye );
}
return z;
}
/*}}} */
/*{{{ dpl_ZONE *initialize_all ( char *dpl_args,*/
dpl_ZONE *initialize_all ( char *dpl_args,
int stereo,
dpl_VIEW **lye,
dpl_VIEW **rye,
float fog_near )
{
dpl_ZONE *z;
dpl_PATHITEM *gpathitem, *tpathitem;
dpl_EXTNITEM *gextnitem, *textnitem;
dpl_FILEPATH *gpath, *tpath;
dpl_Init ( dpl_args );
gpath =dpl_NewFilePath();
gpathitem=dpl_NewPathItem();
gextnitem=dpl_NewExtnItem();
tpath =dpl_NewFilePath();
tpathitem=dpl_NewPathItem();
textnitem=dpl_NewExtnItem();
dpl_SetPathItemPath ( gpathitem, "..\\geometry" );
dpl_SetExtnItemExtn ( gextnitem, "b2z" );
dpl_SetPathItemPath ( tpathitem, "..\\texture" );
dpl_SetExtnItemExtn ( textnitem, "svt" );
dpl_AddPathToFilepath ( gpath, gpathitem );
dpl_AddExtToFilepath ( gpath, gextnitem );
dpl_AddPathToFilepath ( tpath, tpathitem );
dpl_AddExtToFilepath ( tpath, textnitem );
dpl_SetGeometryFilePath ( gpath );
dpl_SetTextureFilePath ( tpath );
z = initialize_eyes ( stereo, lye, rye, fog_near );
return z;
}
/*}}} */
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
#ifdef startup_h
#else
#define startup_h
extern int x_size, y_size;
extern float near_clip, far_clip;
extern dpl_ZONE *initialize_eyes ( int stereo, dpl_VIEW **eye, dpl_VIEW **rye, float fog );
extern dpl_ZONE *initialize_all ( char *arg, int stereo, dpl_VIEW **eye, dpl_VIEW **rye, float fog );
#endif

Some files were not shown because too many files have changed in this diff Show More