A Virtual Computer Science Community, Meeting 2, 1/30/04

Announcements

  • The group message board has been added to http://www.cs.nmsu.edu/~jeffery/vcsc/
  • Dr. Cook indicated that he plans to add a couple machines to the PLEASE lab in the near future. This may ease testing across multiple Linux machines. For testing Windows-to-Windows connectivity we may need to add a machine, but if possible I would just as soon bring a laptop at those occasions.
  • Matt Hulin reported that sound device drivers are available for Linux machines, except in the main instructional labs. We need to check what sound card is installed on the PLEASE lab linux box, and see if its kernel already has a sound device, or if we need to get a different, supported sound card.

    Demos

    A major goal for demos should be to publish code for others to study and use. I plan to put these up on our group website for now. When you schedule a demo, think about what (if any) fragments of the code are interesting and would be helpful to show as part of the demo. Soon we will start a CVS repository for the project's main codebase.

    Korrey Jacobs, Tha Crib

    Issues: build from data structure, not hardwired code. Drawing tool to provide the data structure.

    Here are selected excerpts, see the online source code for full version.

    $include "keysyms.icn"
    
    
    #############
    #main procedure
    procedure main()
        &window := open("Tha Crib", "gl", "size=800,750","bg=grey", "inputmask=k")
        ...
    
        #render graphics
        render()
        #MAIN LOOP
        camera()
    end
    
    
    #
    # Render Graphics To Screen
    #
    procedure render()
    
        #FLOOR
        WAttrib("texmode=on", "texcoord=0,0,0,1,1,1,1,0", "texture=floor.GIF")
        Fg("ambient black")
        FillPolygon(-2.5,0,0, -2.5,0,-7.5, 2.5,0,-7.5, 2.5,0,0)
    
        # WALLS
        WAttrib("texture=walls.GIF", "texcoord=0,0,0,1,1,1,1,0")
        Fg("diffuse blue")
        FillPolygon(-2.5,0,-7.5, -2.5,5,-7.5, 2.5,5,-7.5, 2.5,0,-7.5)
        FillPolygon( 2.5,0,-7.5, 2.5,5,-7.5, 2.5,5,0, 2.5,0,0)   #RIGHT WALL
        FillPolygon( -2.5,0,0, -2.5,5,0, -2.5,5,-7.5, -2.5,0,-7.5)    #LEFT WALL
        FillPolygon(-2.5,5,0, -2.5,5,-7.5, 2.5,5,-7.5, 2.5,5,0)    #CEILING
      
        #FRONT
        WAttrib("texture=frontdoor.GIF", "texcoord=0,0,0,1,1,1,1,0", "fg=blue")
        FillPolygon(-2.5,0,0, -2.5,5,0, 2.5,5,0, 2.5,0,0)
    
        #COUCH
    
        WAttrib("fg=black", "texture=cbottom.GIF", "texcoord=0,0,0,1,1,1,1,0")
        PushTranslate(-1.70,0,-3.75)
        Rotate(90,0,1,0)
        FillPolygon(-1,0,0, -1,0.75,0, 1,0.75,0, 1,0,0)    #bottom
    
        WAttrib("texcoord=0.0,0.0,0.0,1.0,1.0,1.0,1.0,0.0")
        FillPolygon(-1,0.75,0, -1,0.75,-0.75, 1,0.75,-0.75, 1,0.75,0)     #cushion
    
        Fg("red")    #back rest
        FillPolygon(-1,0.75,-0.75, -1,1.75,-0.75, 1,1.75,-0.75, 1,0.75,-0.75)
    
        #left arm rest
        PushTranslate(-1,0.8,-0.75)
        WAttrib("texcoord=auto")
    
        #cover the hole in the cylinder
        PushTranslate(0,0.0,0.75)
        Rotate(60,1.0,0.0,0.0)
        DrawTorus(0.0,0.0,0.0,0.1,0.1)
        PopMatrix()
    
        Rotate(60,1.0,0.0,0.0)
        DrawCylinder(0.0,0.0,0.0,0.75,0.2,0.2)
        PopMatrix()
    
        #right arm rest
        PushMatrix()
        WAttrib("texcoord=auto")
        Translate(1,0.8,-0.75)
    
        #cover the hole in the cylinder
        PushMatrix()
        Translate(0,0.0,0.75)
        Rotate(60,1.0,0.0,0.0)
        DrawTorus(0.0,0.0,0.0,0.1,0.1)
        PopMatrix()
    
        Rotate(60,1.0,0.0,0.0)
        DrawCylinder(0.0,0.0,0.0,0.75,0.2,0.2)
        PopMatrix()
        PopMatrix() 
    
        #RIGHT WALL POSTER
        WAttrib("texmode=on", "texture=Halle.GIF", "texcoord=0,0,0,1,1,1,1,0")
        FillPolygon( -2.4,2,-3, -2.4,4,-3, -2.4,4,-4.5, -2.4,2,-4.5)
    end
    
    ###############
    #Set up the camera
    procedure camera()
      xdelta := ydelta := lookdelta := 0
    
      repeat {
        if *Pending() = 0 then {
    	if xdelta ~= 0 then elook := cam_move(xdelta)
    	if ydelta ~= 0 then elook := cam_orient_yaxis(ydelta)
    	if lookdelta ~= 0 then {
    	    elook := lookx || "," || (looky +:= lookdelta) || "," || lookz
    	    }
        }
        else {
        case (ev := Event()) of {
        Key_Up:    elook := cam_move(xdelta := 0.05)		# Move Foward
        Key_Down:  elook := cam_move(xdelta := -0.05)		# Move Backward
        Key_Left:  elook := cam_orient_yaxis(ydelta := -0.05)	# Turn Left
        Key_Right: elook := cam_orient_yaxis(ydelta := 0.05)	# Turn_Right
        "w":       elook := lookx || "," || (looky +:= (lookdelta := 0.05)) || "," || lookz   #Look Up
        "s":       elook := lookx || "," || (looky +:= (lookdelta := -0.05)) || "," || lookz    #Look Down
        "q": exit(0)
        -166 | -168: xdelta := 0
        -165 | -167: ydelta := 0
        -215 | -211 : lookdelta := 0
        -Key_Up - 128: xdelta := 0
        -Key_Down - 128: xdelta := 0
        -Key_Left - 128: ydelta := 0
        -Key_Right - 128: ydelta := 0
        -ord("w") - 128: lookdelta := 0
        -ord("s") - 128: lookdelta := 0
        }
       }
        myeye := "eye="||epos||","||elook||",0.0,1.0,0.0"
        if myeye ~=== oldmyeye then {
    	write(myeye)
    	WAttrib(myeye)
    	oldmyeye := myeye
            }
      }
    end
    
    procedure cam_move(dir)
        #variables holding the current eye position
    
        #calculate new position
        posx +:= dir*cam_lx
        posz +:= dir*cam_lz
    
        #store new eye position in the string epos
        epos := posx||","||posy||","||posz
    
        #update look at spot
        lookx := posx + cam_lx
        lookz := posz + cam_lz
    
        return lookx||","||looky||","||lookz
    end
    
    #
    # Orient the camera
    #
    procedure cam_orient_yaxis(turn)
    
        #update camera angle
        cam_angle +:= turn
    
        if abs(cam_angle) > 6.283 then # if > 2 pi
            cam_angle := 0.0
    
        cam_lx := sin(cam_angle)
        cam_lz := -cos(cam_angle)
    
        lookx := posx + cam_lx
        lookz := posz + cam_lz
    
        return lookx||","||looky||","||lookz
    end
    

    Dr. J, On Textures

    Now: .gif images. Textures and foreground color are mutually exclusive.

    Soon: ~24 standard texture names, and .jpg support. Textures and foreground color can be blended.

    Status Reports and Questions

    Next Steps

    Graphics

  • Action Item -> Get someone attached to the avatar project, develop requirements for it

    avatar environment (SH 167)
    1. smiley face (sphere w/text name)
    2. stick figure (text name)
    3. stick figure (scanned head)
    4. scan to "michelin" figure
    5. refine head textures
    6. refine limb textures
    7. limb motions
    1. do "tha PLEASE lab" equivalent to "tha Crib".
      • collect dimensions for the PLEASE lab walls, window and door
      • draw PLEASE lab using material surfaces (colors)
      • collect textures for the PLEASE lab; texture the surfaces
    2. add (simple) collision detection to make the walls solid
    3. virtual books
    4. virtual whiteboard
    5. virtual workstations

    Network

    One of our next steps should be to set different individual goals for each person in the group. It might or might not be reasonable to divide the labor by designating a "client person" and a "server-side person". Another possibility might be to have a "trailblazer" whose job is to create new network communication functionality, and an "integrator", whose job is to get networking functionality working in the main project.

    client server
    1. 2 person chat
    2. 2 person whiteboard
    3. 2 person chat, inside a virtual PLEASE session
    1. login/logout/directory service
    2. n person chat
    3. virtual "who"
    4. groups (persistent and temporary)

    Audio

    This group first writes C programs, and then works with Dr. J to integrate its capabilities into the Unicon virtual machine.
    1. Administration
      • Physical sound setup in the PLEASE lab (Dr. J)
      • Download and run one or more of the multiplatform audio libraries
      • Subdivision: in addition to a "Windows person" and a "Linux person" we may wish to subdivide as a "trailblazer" and a "VM integration person"
    2. Asynchronous audio
      • Write (multiplatform) C program to play audio files locally
      • Write (multiplatform) C program to record from microphone
      • Integrate play/record features into Unicon VM
    3. Networked audio
      • play audio across network
      • multicast audio files across network
    4. Synchronous, networked audio
      • unidirectional audio across net in real time
      • simplex bidirectional audio across net in real time
      • duplex bidirectional audio across net in real time
      • duplex multicast audio across net in real time