|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Map-Editor first official screens
[Re: ventilator]
#52193
08/21/05 16:54
08/21/05 16:54
|
Joined: Oct 2002
Posts: 4,753 Munich, Bavaria, South of Germ...
TripleX
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
|
Exakt so hatte ich es geplant  Gut jetzt hab ich was, was ich genau nach programmieren kann.. Programmieren mit Vorlage..  Sag mal wie hast du die Boundingbox per Script nachgefahren? Falls ja kannst du mir da vll. den Script mal per PM schicken? Wäre super weil ich das im moment nicht ganz hinbekomme  mfg TripleX
|
|
|
Re: Map-Editor first official screens
[Re: TripleX]
#52194
08/21/05 17:10
08/21/05 17:10
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
Code:
//-----------------------------------------------------------------------------line function boldline3d(&_start, &_end, &_color, _alpha) { var _s[3]; var _e[3]; vec_set(_s, _start); vec_set(_e, _end); vec_to_screen(_s, camera); vec_to_screen(_e, camera);
// todo: clipping algorithm?
if (_s.z > camera.clip_near && _e.z > camera.clip_near) // if there is no distortion { // bold line 3x3 draw_line(_s, null, _alpha); draw_line(_s, _color, _alpha); draw_line(_e, _color, _alpha); draw_line(vector(_s.x+1, _s.y+1, 0), null, _alpha); draw_line(vector(_e.x+1, _e.y+1, 0), _color, _alpha); draw_line(vector(_s.x-1, _s.y-1, 0), null, _alpha); draw_line(vector(_e.x-1, _e.y-1, 0), _color, _alpha); draw_line(vector(_s.x+1, _s.y-1, 0), null, _alpha); draw_line(vector(_e.x+1, _e.y-1, 0), _color, _alpha); draw_line(vector(_s.x-1, _s.y+1, 0), null, _alpha); draw_line(vector(_e.x-1, _e.y+1, 0), _color, _alpha); draw_line(vector(_s.x, _s.y+1, 0), null, _alpha); draw_line(vector(_e.x, _e.y+1, 0), _color, _alpha); draw_line(vector(_s.x, _s.y-1, 0), null, _alpha); draw_line(vector(_e.x, _e.y-1, 0), _color, _alpha); draw_line(vector(_s.x+1, _s.y, 0), null, _alpha); draw_line(vector(_e.x+1, _e.y, 0), _color, _alpha); draw_line(vector(_s.x-1, _s.y, 0), null, _alpha); draw_line(vector(_e.x-1, _e.y, 0), _color, _alpha); } }
function line3d(&_start, &_end, &_color, _alpha) { var _s[3]; var _e[3]; vec_set(_s, _start); vec_set(_e, _end); vec_to_screen(_s, camera); vec_to_screen(_e, camera);
// todo: clipping algorithm? if (_s.z > camera.clip_near && _e.z > camera.clip_near) // if there is no distortion { draw_line(_s, null, _alpha); draw_line(_s, _color, _alpha); draw_line(_e, _color, _alpha); } }
//-----------------------------------------------------------------------------box var p1[3]; var p2[3]; var p3[3]; var p4[3]; var p5[3]; var p6[3]; var p7[3]; var p8[3]; function drawbox(_entity, &_color, _alpha) { you = _entity; vec_set(p1, vector(you.min_x, you.min_y, you.min_z)); vec_set(p2, vector(you.min_x, you.max_y, you.min_z)); vec_set(p3, vector(you.max_x, you.max_y, you.min_z)); vec_set(p4, vector(you.max_x, you.min_y, you.min_z)); vec_set(p5, vector(you.min_x, you.min_y, you.max_z)); vec_set(p6, vector(you.min_x, you.max_y, you.max_z)); vec_set(p7, vector(you.max_x, you.max_y, you.max_z)); vec_set(p8, vector(you.max_x, you.min_y, you.max_z)); vec_rotate(p1, you.pan); vec_add(p1, you.x); vec_rotate(p2, you.pan); vec_add(p2, you.x); vec_rotate(p3, you.pan); vec_add(p3, you.x); vec_rotate(p4, you.pan); vec_add(p4, you.x); vec_rotate(p5, you.pan); vec_add(p5, you.x); vec_rotate(p6, you.pan); vec_add(p6, you.x); vec_rotate(p7, you.pan); vec_add(p7, you.x); vec_rotate(p8, you.pan); vec_add(p8, you.x); line3d(p1, p2, _color, _alpha); line3d(p2, p3, _color, _alpha); line3d(p3, p4, _color, _alpha); line3d(p4, p1, _color, _alpha); line3d(p1, p5, _color, _alpha); line3d(p2, p6, _color, _alpha); line3d(p3, p7, _color, _alpha); line3d(p4, p8, _color, _alpha); line3d(p5, p6, _color, _alpha); line3d(p6, p7, _color, _alpha); line3d(p7, p8, _color, _alpha); line3d(p8, p5, _color, _alpha); }
ich habe draw_line zum zeichnen von 3d linien ohne z-buffering missbraucht. man sollte besser mal eine kleine dll mit verschiedenen draw funktionen schreiben, aber ich kenn mich mit direct3d nicht aus.
|
|
|
Re: Map-Editor first official screens
[Re: ventilator]
#52195
08/21/05 17:31
08/21/05 17:31
|
Joined: Oct 2002
Posts: 4,753 Munich, Bavaria, South of Germ...
TripleX
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
|
Okay vielen Dank.. kommst auf jeden fall in die credits Ich werd den Code nicht ganz übernehmen aber doch halbwegs  mfg Triple-X EDIT: *daumen hoch* Wichtig ist, dass du nicht vergisst davor mit c_setminmax bzw c_updatehull die min/max werte zu berechnen. Hab noch hinzugefügt, dass einzelne Linien nicht gezeichnet werden, falls Sie von Panels verdeckt sind (sonst würden Sie die Panels übermalen).
|
|
|
Re: Map-Editor first official screens
[Re: TripleX]
#52196
08/21/05 21:05
08/21/05 21:05
|
Joined: Oct 2002
Posts: 4,753 Munich, Bavaria, South of Germ...
TripleX
OP
Expert
|
OP
Expert
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
|
puhh after a long programming day (+8 hours programming.. holidays and my friends are not here.. i go on wendsday) and the 1000ths removed bug the "changing action" and removing&creating entity action is finally finished (I hope so  ) Really a bit strange that i have to remove and recreate a model in the wmp file to change the action.. but okay.. I don't want to complain  Tomorrow I'll implement the Move System of objects (like in ventilators example) and than lets see  TripleX
|
|
|
|