Upload
rossa
View
22
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Chapter 2: One on one (101). BOIDS. Three Forces Acting on a Boid. Cohesion. Alignment. Separation. V’ i. V i. A. P’ i. P i. One Time Step of a Boid. At time t+ t. At time t. Simulation. 1010100 1111001 0010101 0111101 1001. Renderer. Data Model. Software. Client. - PowerPoint PPT Presentation
Citation preview
Networked GraphicsBuilding Networked Virtual Environments and Networked GamesChapter 2: One on one (101)
BOIDS
Three Forces Acting on a Boid
Cohesion Alignment Separation
Pi
Vi
A
P’i
V’i
At time t At time t+t
One Time Step of a Boid
Data Model
Simulation
Renderer
10101001111001001010101111011001......
Software
Client
DISTRIBUTED BOIDS: CONCEPTS
Data-Push
Client BClient A
Client A Client B
Data-Sharing
Client BClient A
Data-Coupled
DISTRIBUTED BOIDS: IMPLEMENTATION
Data Model
Simulation
NetworkRenderer
10101001111001001010101111011001......
10101001111001001010101111011001......
Software
ModemClient
Router
RouterRouter
Router
Software
ModemClient
Boids Implementation
Data model
Local Flock
Remote Flock
Screen (Renderer Output)
Network
Internet
Router
RouterRouter
Router
Simulation
Create socket local port X_socket =
DatagramSocket();
Read packet_packet =
_socket.read()
Write packet to remote address and port
_socket .write(_packet)
Close_socket
Write packet to remote address and port
_socket .write(_packet)
Read packet_packet =
_socket.read()
Close_socket
Create socket local port X_socket =
DatagramSocket();
Create Datagram Packet to receive and send
_packet = DatagramPacket();
Create Datagram Packet to receive and send
_packet = DatagramPacket();
Create socket to listen to requests on local port X
_listenSocket = ServerSocket();
Wait for incoming connection requests
_connectionSocket = _listenSocket.accept();
Read messages on_connectionSocket
Write messages on _connectionSocket
Close_connectionSocket
Connect to remote address and port_clientSocket =
_Socket();
Write messages on_clientSocket
Read messages on _clientSocket
Close_clientSocket
Setup streams_connectionSocket
Setup streams_connectionSocket
REFLECTION
X
ClientA
t
X
ClientB
t+tNetwork
Boidi Boidi
wall clock time wall clock time
X
wall clock time
ClientA
t
X
wall clock time
ClientB
t+tNetwork
Boidi Boidi
t+tNetworkt
Boidj Boidi
t
X
wall clock timeClientA
t
X
wall clock time
ClientB
tNetwork
Boidj
Boidi
tNetwork
Boidj
Boidi
a) At time t b) At time t+tNetwork
c) At time t+2.tNetwork
ClientA ClientB ClientA ClientB
ClientA ClientB