NetTour3D is a very simple networked virtual environment (NVE) which allows sprites representing users (clients) on different machines to move about in a shared world. The world is the familiar checkboard, with scenery and obstacles (red poles).
NetTour3D is essentially a combination of two earlier examples: Tour3D from Chapter 18 which introduced the Sprite3D class, and networking code from the multi-threaded chat application in Chapter 30. It would be a good idea to (re-)read those chapters before starting on this one.
NetTour3D is a client/server application, with each client running a copy of the shared world, with messages passing between the clients via the server.
The image at the top of the page shows NetTour3D being run by two clients. Each window is a particular client's view of the shared world (a third person camera which follows the client's sprite). Each client can see their own sprite and, when in the right location, the sprites of the other visitors. A client can move his sprite around using the usual keyboard controls. All the visitors use the same robot image but their own names are floating above the robots. The world includes a castle and several obstacles.
A major weakness of this example is that the users cannot interact, apart from gliding about the checkboard. However, it wouldn't be difficult to graft a multi-user chat component onto NetTour3D. This would involve integrating more of the multi-threaded chat example of Chapter 30 into NetTour3D.
In this chapter, we begin by discussing the features of a fully fledged Networked Virtual Environment (NVE), and then consider the considerably simpler NetTour3D example.
Dr. Andrew Davison
Back to my home page