What langauge should I use?

I am thinking of branching out into the world of 3D graphics and OPEND GL has been suggesed as the way to go. What I want to achive is a number of models interacting with one another in a virtual enviroment. I want it to be platform independant and to run fast. I also want malnipulate the model using TCP/IP commands. IE the models can interact with one another over different machines over a network. Now I am thinking c++ for the ease of multiple platforms however I am not sure what the network interface capabilities IE how easy is it to interface with the network using c++.

Any advise?

Simon

OpenGL is a great 3d API, but it is a low-level API that has no notion of “objects.” You will have to manage objects yourself and use OpenGL as the renderer. If you’re ok with that then it is definitely a nice fast way to go. C/C++ are the languages of choice for many people here. For TCP/IP programming you should look into something called sockets. (Winsock under Win32, Berkeley sockets under UNIX/Linux)

Thanks for your reply.

I am aware that the object (models) that I want to create are something that I will have to draw from polygons lines etc… say for instance that I had two aeroplanes flying around an enviroment and that I wanted a fixed viewing angle but then have the planes moving that viewing point so that I could see the plane moving as you would do if you were a spectator on the ground. Is this all possible? I am sure that it is. I am more concerned about the Network interface and since I am used to things like VB where you have a network control as it were but using c++ I guess that there are librays that can be used.

Try SDL. It is portable and there is a SDL_net lib available. You find it here:
http://www.libsdl.org

Hope that helps
CoBour

No page @ http://www.libsdl.org/

I just checked the link in my reply and it worked…

[This message has been edited by CoBour (edited 04-20-2001).]

I’d definitely suggest going for C++ (and the ++ is important). IMO, third generation languages are the most applicable for this kind of programming, and the choice is not that large (I don’t even know if all of them support OpenGL):
-Basic (okokok, only joking)
-Java (welcome to 0.2 FPS)
-Fortran
-Pascal
-C (why bother? C++ got everything it’s got and a lot more, such as object-oriented and function overloading)
-C++

=> C++ seems to me to be the optimum. Drawback: So platform-independent that a lot of stuff was left to system-specific libraries, etc.

For someone who has used c++ and got over the Hello WORLD program and various others but doesn’t fully understand OO programming and only has a short time to learn it you still think that this is the way to go?

If you’re not so concerned about performance I’d recommend Java. That way you get an easy to use language and can concentrate on content instead of form. This way you can get started quickly and expand as you learn more. Although Java might not be the best choice for high performance it’s easier to learn and use than C++.

How well does JAVA interface with the network facilities?

When you say that preformace is compromised to what extent is this the case?

Thanks

Simon

I’d say Java has excellent network support, people doing server side programming generally see Java as the best thing since pizza. It’s slow though, beacuse it’s interpreted or compiled while you execute, and the fact that they didn’t design the language for performance (like C/C++) but for usability and security. So if you want to get cool things on screen fast use Java, if you want to learn performance oriented programming and use more low level techniques to get cool efects and high framerates, go for C++.

I use C++ and have never used java, however, when I go to Uni they use java to teach and expect all homework et.c to be in java therefore I will shortly be learning Java. With this in mind I have asked numerous people what java is like and especialy its speed. What I have found is that it usauly isn’t to slow, that suggestionof 0.2 FPS is a bit wrong. If you are not careful with java then you could see maybe a quater or less of the frame that you would get with c/c++ but if you are careful the it should run at a similar speed. I have seen demos of java SOFTWARE renders run fast than most peoples Opengl C++ engines (It was a complex multitextured landscape that ran at about 200 FPS on an “average” machine). Java I hear is a lot easier to learn and use, easier to debug and so is quicker to implement most projects. Where speed isn’t the main concern I think java would be the best bet. Once you have learned java then learnin to use c/c++ shouldn’t be too hard if you have come from using basci or something.

Tim

I am studying Engineering at university so I think that prehaps C++ is the prefered language for engineers however I am still a litle concerned about how I am going to communicate using the network TCP/IP though.

Thanks

Simon

You said you wanted it to be platform independant so that complicates things for networking…But under windows you can use the DirectX 8 SDK which has fairly easy to implement networking capabilities.

Can you not just say “NETWORK CARD SEND THIS” and what ever platorm it is on the compiler knows what to do with it.

I have been told a little about a thing called CORBA and implementing that anyone got any views on using CORBA?

Simon

And how about Ñ#?

Is it possible to use this language?

Sorry, wrong encoding. I mean C#

Stockton, for TCP/IP, sockets are really fairly easy to use. Probably the most difficult part about them is the initial setup and connection. (Filling out the address struct isn’t exactly difficult, but it is a bit more complicated then just using a string for an address.)

Just a quick example of some socket code using stream (TCP) sockets so you can look things up on your own…

//parameters not shown for simplicity…

Server:
s = socket(…);
bind(s,…);
listen(s,…);
client = accept(s,…);
send(client,…);
recv(client,…);

Client:
s=socket(…);
connect(s,…);
recv(s,…);
send(s,…);

As you can see once, you get the connection established, it is all about recv and send calls, which take simple strings for parameters.