Posted: 28th Jun 2003 21:40
Update: Resizing with handles in all 4 directions in first view. Should be easy to port over to other 2 views.
Posted: 28th Jun 2003 22:02
gets better all the time

dave
Posted: 28th Jun 2003 22:06
Thanks

Edit: Yay I got resizing working in XZ and XY views now
Posted: 28th Jun 2003 22:34
UPDATED CODE

Additions / changed:

- Drag RMB to create
- Handles for resizing - select shape and drag handles to resize

See first post for code.
Posted: 28th Jun 2003 23:34
thanks for sharing this this
however far you take it this will be a great
start fore anyone who wants to write there own editor

(thanks for the comments)

dave
Posted: 29th Jun 2003 0:13
thanks for sharing this this
however far you take it this will be a great
start fore anyone who wants to write there own editor

(thanks for the comments)

dave



No problem. However, I didn't put too many coments in tomorrow I'll add more.

[Edit]

.X exporter going in now..... I hope this works!
Posted: 29th Jun 2003 15:13
Yay I got the .x exporter in. It still needs a bit of refinement, as there is no exturing in yet (and so the model is invisible) but here is what is exported:

+ Code Snippet
xof 0302txt 0032
// DTEdit .x export - exporter written by David Tattersall
Header {
1;
0;
1;
}
Mesh object0 {
FrameTransformMatrix {
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
30,5,22;;
}
8;
60;20;32;,
40;20;32;,
40;20;52;,
60;20;52;,
60;10;32;,
40;10;32;,
40;10;52;,
60;10;52;,
12;            // 12 faces in a cube
3;0,1,2;,            // face 0 has 3 vertices
3;0,2,3;,            // and so on
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}
Mesh object1 {
FrameTransformMatrix {
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
30,5,-18;;
}
8;
60;20;-8;,
40;20;-8;,
40;20;12;,
60;20;12;,
60;10;-8;,
40;10;-8;,
40;10;12;,
60;10;12;,
12;            // 12 faces in a cube
3;0,1,2;,            // face 0 has 3 vertices
3;0,2,3;,            // and so on
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}
Mesh object2 {
FrameTransformMatrix {
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
-30,5,22;;
}
8;
0;20;32;,
-20;20;32;,
-20;20;52;,
0;20;52;,
0;10;32;,
-20;10;32;,
-20;10;52;,
0;10;52;,
12;            // 12 faces in a cube
3;0,1,2;,            // face 0 has 3 vertices
3;0,2,3;,            // and so on
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}
Mesh object3 {
FrameTransformMatrix {
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
-30,5,-18;;
}
8;
0;20;-8;,
-20;20;-8;,
-20;20;12;,
0;20;12;,
0;10;-8;,
-20;10;-8;,
-20;10;12;,
0;10;12;,
12;            // 12 faces in a cube
3;0,1,2;,            // face 0 has 3 vertices
3;0,2,3;,            // and so on
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}
Mesh object4 {
FrameTransformMatrix {
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
0,5,-28;;
}
8;
60;20;52;,
20;20;52;,
20;20;212;,
60;20;212;,
60;10;52;,
20;10;52;,
20;10;212;,
60;10;212;,
12;            // 12 faces in a cube
3;0,1,2;,            // face 0 has 3 vertices
3;0,2,3;,            // and so on
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}
Mesh object5 {
FrameTransformMatrix {
1.0,0.0,0.0,0.0,
0.0,1.0,0.0,0.0,
0.0,0.0,1.0,0.0,
0,0,0;;
}
8;
0;0;0;,
0;0;0;,
0;0;0;,
0;0;0;,
0;0;0;,
0;0;0;,
0;0;0;,
0;0;0;,
12;            // 12 faces in a cube
3;0,1,2;,            // face 0 has 3 vertices
3;0,2,3;,            // and so on
3;0,4,5;,
3;0,5,1;,
3;1,5,6;,
3;1,6,2;,
3;2,6,7;,
3;2,7,3;,
3;3,7,4;,
3;3,4,0;,
3;4,7,6;,
3;4,6,5;;
}


Wow that was hard but also fun. Thanks go to the kind soul at Microsoft who wrote the .x specification - a real help.
Posted: 29th Jun 2003 16:40
still trying to work out what's what :-s

dave
Posted: 29th Jun 2003 17:26
What's what in what? If you're talking about the exported .x file DBP will handle that for you

Plus, the exported file above had a few mistakes in it so the exporter is being rewritten. Here is the code for the exporter if you want:

+ Code Snippet
ExportX:

  cls
  set cursor 10,400

  input "File name: ",n$

  open to write 1,n$

  write string 1,"xof 0302txt 0032"
  write string 1,"// DTEdit .x export - exporter written by David Tattersall"
  write string 1,"Header {"
  write string 1,"1;"
  write string 1,"0;"
  write string 1,"1;"
  write string 1,"}"

  remstart
  ----------------------------------------------------------
  Here we would export all materials but since there are
  no textures yet just go straight to the meshes
  ----------------------------------------------------------
  remend

  for o = 0 to NumPlaced

  ` START NEW FRAME
   write string 1,"Frame Obj"+str$(o)+" {"

    ` TRANSFORM DATA - POSITION OF BOX GOES HERE
    ` Work out all bits of info about box
    width = Boxes(o).X2 - Boxes(o).X1
    height = Boxes(o).Y2 - Boxes(o).Y1
    depth = Boxes(o).Z2 - Boxes(o).Z1

    xp = (Boxes(o).Z1 + (0.5 * depth))*-1
    yp = (Boxes(o).Y1+ (0.5 * height))*-1
    zp = (Boxes(o).X1 + (0.5 * width))*-1

    x1 = (Boxes(o).Z1)*-1
    y1 = (Boxes(o).Y1)*-1
    z1 = (Boxes(o).X1)*-1

    x2 = x1 + depth
    y2 = y1 + height
    z2 = z1 + width

    write string 1,"FrameTransformMatrix {"
    write string 1,"1.0,0.0,0.0,0.0,"
    write string 1,"0.0,1.0,0.0,0.0,"
    write string 1,"0.0,0.0,1.0,0.0,"
    write string 1,str$(xp)+","+str$(yp)+","+str$(zp)+";;" :`Position
    write string 1,"}"

    ` START NEW MESH
    write string 1,"Mesh object"+str$(o)+" {"

    ` VERTICES - 8 CORNERS OF THE CUBE
    write string 1,"8;" : `Number of vertices - in a cube that is 8
    write string 1,str$(x2)+";"+str$(y2)+";"+str$(z1)+";," :`X2 Y2 Z1
    write string 1,str$(x1)+";"+str$(y2)+";"+str$(z1)+";," :`X1 Y2 Z1
    write string 1,str$(x1)+";"+str$(y2)+";"+str$(z2)+";," :`X1 Y2 Z2
    write string 1,str$(x2)+";"+str$(y2)+";"+str$(z2)+";," :`X2 Y2 Z2
    write string 1,str$(x2)+";"+str$(y1)+";"+str$(z1)+";," :`X2 Y1 Z1
    write string 1,str$(x1)+";"+str$(y1)+";"+str$(z1)+";," :`X1 Y1 Z1
    write string 1,str$(x1)+";"+str$(y1)+";"+str$(z2)+";," :`X1 Y1 Z2
    write string 1,str$(x2)+";"+str$(y1)+";"+str$(z2)+";," :`X2 Y1 Z2

    ` FACES - THERE ARE 12 FACES IN A CUBE - DESCRIBE THEM
    write string 1,"12;            // 12 faces in a cube"
    write string 1,"3;0,1,2;,            // face 0 has 3 vertices"
    write string 1,"3;0,2,3;,            // and so on"
    write string 1,"3;0,4,5;,"
    write string 1,"3;0,5,1;,"
    write string 1,"3;1,5,6;,"
    write string 1,"3;1,6,2;,"
    write string 1,"3;2,6,7;,"
    write string 1,"3;2,7,3;,"
    write string 1,"3;3,7,4;,"
    write string 1,"3;3,4,0;,"
    write string 1,"3;4,7,6;,"
    write string 1,"3;4,6,5;;"

    ` HERE WE WOULD DESCRIBE MATERIALS, BUT THERE ARE NONE YET
    `------


    `FINISH MESH
    write string 1,"}"

    ` FINISH FRAME
    write string 1,"}"



  next o

  close file 1

return
Posted: 29th Jun 2003 17:38
sorry i meant the whole thing,i'me going throu
the program a bit at a time,working out what code
dose what

dave
Posted: 29th Jun 2003 18:08
I'll comment it now and upload a new version.
Posted: 5th Jul 2003 11:47
any updates?
Posted: 6th Jul 2003 5:04
could you compile that for the poor,poor people who don't have DBPro?
Posted: 7th Jul 2003 21:50
@David89
could you post a link to the .x specification? Thanks
Posted: 8th Jul 2003 0:20
1. Yes, an update will come soon. I want to get texturing in there with .x

2. Maybe - probably yes

3. Sure - http://www.wotsit.org/search.asp?page=10&s=graphics
Posted: 10th Jul 2003 6:37
Thnx
Posted: 22nd Jul 2003 22:10
I can't get the first code to work i copyid it and pasted it in to darkbasicpro but it is saying missing include file whats wrong can any one post a link to the code allready setup
Posted: 1st Aug 2003 19:11
You'll get the error about 4 times. For some reason it didn't copy the carrige returns at the beginning of each include files, just separate the two lines:

return Rem include file

becomes

return
rem include file
Posted: 2nd Aug 2003 23:18
hi david89

how are things progressing with the editor
any news

dave
Posted: 3rd Aug 2003 20:51
Hi,

I've been away for 3 weeks so no work done since my last post

I think, unless I find free time, the curretn state might be the final state. It was not meant to be a proper editor, just test, and I did that.

I still want to do .x, though. Can't manage it yet