Posted: 12th Aug 2003 5:18
Can you change the wire color of a 3d wireframe object?
Posted: 12th Aug 2003 5:40
I don't think so. Any way, what good would that do???
Posted: 12th Aug 2003 13:14
Thanks TDK - just what I needed. I'm also after a VR headset (£333 anyone?) and if I could attach 3d glasses onto the headset, you could have a very realistic VR simulation.
Posted: 12th Aug 2003 16:24
Edit: even better code, use source below in message and not source code box.

Now this must work - I've re-done it using info I've fond on the web. I've tried this with my glasses and I'm sure it's 3D. It works very well.

+ Code Snippet
make object cube 1,10
make object sphere 2,20 : position object 2,0,5,10

` Cameras
set camera to image 0,3,512,512 : color backdrop 0,rgb(0,0,0)
make camera 1 : set camera to image 1,1,512,512 : color backdrop 1,rgb(0,0,0)
make camera 2 : set camera to image 2,2,512,512 : color backdrop 2,rgb(0,0,0)


` Position cameras correctly
position camera 0,0,0,-30
position camera 1,-0.5,0,-30
position camera 2,0.5,0,-30

` Setup display
sprite 1,0,0,1
sprite 2,0,0,2

set sprite alpha 1,128
set sprite alpha 2,128

size sprite 1,640,480
size sprite 2,640,480

set sprite diffuse 1,255,0,0
set sprite diffuse 2,0,0,255

` Main loop
do
  inc i#,0.5
  yrotate object 1,wrapvalue(i#)
  position camera 0,0,-30 + sin(i#) * 10

  gosub updatecam

  sync
loop

UpdateCam:

  x# = camera position x()
  y# = camera position y()
  z# = camera position z()
  ax# = camera angle x()
  ay# = camera angle y()
  az# = camera angle z()

  position camera 1,x#,y#,z# : rotate camera 1,ax#,ay#,az#
  position camera 2,x#,y#,z# : rotate camera 2,ax#,ay#,az#

  turn camera left 1,90
  move camera 1,0.5
  turn camera right 1,90

  turn camera right 2,90
  move camera 2,0.5
  turn camera left 2,90

return


Even my brother agrees, and he's been rejecting all my other attempts!
Posted: 12th Aug 2003 22:54
David89, the code didn't work for me. Mabe because it was too dark. On my PC it ran on 30 fps. That's a little slow. It'd be faster to use ghosted objects!
I'm trying to get new glasses but they're not easy to find here in Brazil. And spykids didn't come here (and probably wont come).
Posted: 12th Aug 2003 23:44
David89, the code didn't work for me. Mabe because it was too dark. On my PC it ran on 30 fps. That's a little slow. It'd be faster to use ghosted objects!
I'm trying to get new glasses but they're not easy to find here in Brazil. And spykids didn't come here (and probably wont come).


Hmm, the code above is quite old (well, compared to the latest version). I have since made it light. See my own thread on the subject.

The reason why i use sprites is to extract the indiviual colour channels from each view. Using ghosted objects will not work.

Nor will placing coloured objects either side of an object.

If you want to construct the code your own way, feel free to. This is how to do it:

- You need two cameras set to images 1 & 2.
- Make one camera be slightly to the left of the player
- Make one slightly to the right
- sprite a version of the right image to the screen and use set sprite diffuse to make only green visible
- sprite the left image to the screen and use set sprite diffuse to make only red visible
- sprite the right image to the screen and use set sprite diffuse to make only blue visible
- use set sprite alpha on the L and R images and make them semi-transparent (128)

Hopefully you should then have a 3d image.
Posted: 13th Aug 2003 1:46
keeblerElf:

Can you change the wire color of a 3d wireframe object?


Yes. You can effectively do this by texturing the whole matrix with a plain coloured tile of the same colour that you want the wireframe matrix to be.

TDK