Author Topic: 3D in Basic  (Read 5679 times)

0 Members and 1 Guest are viewing this topic.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
3D in Basic
« on: August 29, 2006, 06:59:00 pm »
I was thinking one day about making a 3d game in TI 83+ BASIC with Xlib, and I have some ideas on how to move the 3d objects but I don't have the equations, so I was wondering if someone could help me find a way to draw a cube and rotate it in all four ways.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Offline lolje

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 299
  • Rating: +2/-0
    • View Profile
3D in Basic
« Reply #1 on: August 30, 2006, 12:48:00 am »
If you asked me, I don't know but I think they should integrate this Engine into xLIB:
user posted image
0_os049.gif
83+/84+ xLIB projects
Age of culture II (~89%)

Contact: [email protected]

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
3D in Basic
« Reply #2 on: August 30, 2006, 01:17:00 am »
O_Oshocked2.gifO_Oshocked2.gif HOLY s***! more and more 3d engines o.oblink.gif I saw the one from benryves on mc but not that one. It could be a good feature indeed

but managing all collision detection may be very slow with all those math/if/then :(sad.gif

Offline lolje

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 299
  • Rating: +2/-0
    • View Profile
3D in Basic
« Reply #3 on: August 30, 2006, 02:38:00 am »
No, I mean a function like the shape function, The Input would be coordinates (X,Y,Z) and size (also X,Y,Z). That should not be such a big problem...

You could e.g. use a 2D-Engine, but 3D-Graphics  :lol:bounce2.gif
83+/84+ xLIB projects
Age of culture II (~89%)

Contact: [email protected]

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
3D in Basic
« Reply #4 on: August 30, 2006, 03:37:00 am »
i c >.<

elfprince13

  • Guest
3D in Basic
« Reply #5 on: August 30, 2006, 09:33:00 am »
I did a wall based 3d maze engine in pure basic a while back, it worked pretty well too, and if I optimized it I can probably wrench some more speed out of it.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
3D in Basic
« Reply #6 on: August 30, 2006, 12:43:00 pm »
Actually I found the equation to convert 3D points to 2D on a plane from some C documents so I made a copy of the C programs in BASIC for true 3D rendering but sadly it is very slow it takes about 2 seconds to render 8 3D vertices
There are 10 types of people in this world-- those that can read binary, and those that can't.

Dragon__lance

  • Guest
3D in Basic
« Reply #7 on: August 30, 2006, 12:48:00 pm »
if you want psuedo 3d, be sure to check out CDI's p3d! It's really cool! :Dbiggrin.gif

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
3D in Basic
« Reply #8 on: August 30, 2006, 01:00:00 pm »
if someone have a BASIC routine to do wireframe 3D stuff I would be happy to mess with it a little just for fun :Dbiggrin.gif

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
3D in Basic
« Reply #9 on: August 30, 2006, 02:31:00 pm »
QuoteBegin-xlibman+30 Aug, 2006, 19:0-->
QUOTE (xlibman @ 30 Aug, 2006, 19:00)
if someone have a BASIC routine to do wireframe 3D stuff I would be happy to mess with it a little just for fun :Dbiggrin.gif

 Someone on UTI made one with xLIB.

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
3D in Basic
« Reply #10 on: August 30, 2006, 03:06:00 pm »
This is a C to BASIC translation so it's not perfect but it is true 3D. Im just posting it so someone can mess with it. I know how to do rotations with it but I haven't implemented that yet but if you want to know then just ask and i'll post it. Although it is sorta hard to understand kinda. Also I have a way to make it solid instead of wireframe which is also hard to explain but if needed to know then just ask.
-Recommended screens settings are -94,94 for X and -94,94 for Y too.



L=list thingy

c1-->
CODE
ec1
Clrdraw
\\This list is used to tell the lines which points to connect
{0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7}->LLin
\\This is used to store 3D vertices to 2D transformations
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}->LSRC
\\This is the work list because you want to keep your orignal list there at all times
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}->LWOR
\\This is the camera in 3D space
{0,0,20}->LCAM
\\This is the center of the screen
{0,0}->LSCC
\\These are your 3D vertices
{-10,-10,-10,10,-10,10,10,10,-10,-10,10,-10,-10,-10,10,10,-10,10,10,10,10,-10,10,10}->LCUB
\\This variable is the distortion
8->D
->B
For(A,1,24
If B<3:Then
B+1->B
Else
1->B
End
LCUB(A->E
LCAM(B->F
\\It is required that you subtract the camera position (x or y or z) depending on B
E-F->LWOR(A
End
-1->B
For(A,1,24,3
B+2->B
LSCC(1->E
LWOR(A->F
LWOR(A+2->G
// coord.x = screen_center.x + (distortion * 3Dcoord.x)/ 3Dcoord.z
E+(D*F)/G->LSRC(B
LSCC(2->E
LWOR(A+1->F
// coord.y = screen_center.y + (distortion * 3Dcoord.y)/ 3Dcoord.z
E-(D*F)]G->LSRC(B+1
End
For(A,1,16,2
round(LSRC(A,->X
round(LSRC(A+1,->Y
Pt-On(X,Y
End
\\Now we draw the lines in to make the cube
For(A,1,24,2
LLIN(A)*2+1->W
LLIN(A+1)*2+1->V
LSRC(W->X
LSRC(W+1->Y
LSRC(V->Z
LSRC(V+1->theta
Line(X,Y,Z,theta
End
c2
ec2
There are 10 types of people in this world-- those that can read binary, and those that can't.

runtogetdone

  • Guest
3D in Basic
« Reply #11 on: August 31, 2006, 01:46:00 am »
Here's a http://www.rafb.net/paste/results/eKrD7599.html to some basic 3D formulas that might prove useful
(Thank tr1p1ea for the links, not me  ;)wink.gif)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
3D in Basic
« Reply #12 on: August 31, 2006, 02:33:00 am »
OMG I'll try asap, I hope I can convert code to tigl format tho :(sad.gif, maybe someone could post a 8xp?

Offline Halifax

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1334
  • Rating: +2/-1
    • View Profile
    • TI-Freakware
3D in Basic
« Reply #13 on: August 31, 2006, 11:42:00 am »
That link doesn't work

Also I'm working on implementing rotation into that source code above, but anyways xlibman the 8xp format is attached.
There are 10 types of people in this world-- those that can read binary, and those that can't.

Alex

  • Guest
3D in Basic
« Reply #14 on: August 31, 2006, 03:43:00 pm »
I'd like to experiment with a little 3D myself hehe :)smile.gif I wish you guys good luck, pushing calc limits is always fun and admirable :)smile.gif

- Alex