Show Posts
|
|
Pages: [1]
|
|
2
|
Game Development / Networking & Multiplayer / what am I doing wrong? (newbie- please help)
|
on: 2004-10-18 19:33:36
|
hello. I am making a JOGL networked aplication, and here is what I am trying to do: I have a few JSliders, that controls the atributes of a JOGL 3D object( a cube). So, if the user changes the position of the JSlider, it must send this information to all the other users, and then get the atributes changed. here is what I done, but it isn]t working: on the contructor: 1 2 3 4 5 6 7
| try { socket = new DatagramSocket(5000); }
catch(SocketException socketException) { socketException.printStackTrace(); } |
on the state changed metod of the SliderHandler class (couse I olnly have to send informations when someone chage the atributes value) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| try{
byte sendData[] = pacoteString.getBytes();
sendPacket = new DatagramPacket(sendData, sendData.length, InetAddress.getLocalHost(),5000); socket.send(sendPacket);
byte reciveData[] = new byte[100]; receivePacket =new DatagramPacket( reciveData, reciveData.length);
socket.receive(receivePacket);
pacoteString = new String(receivePacket.getData(), 0, receivePacket.getLength());
token = new StringTokenizer(pacoteString);
flag = Integer.parseInt(token.nextToken());
valor = Float.parseFloat(token.nextToken()); System.out.println(valor);
if(flag == ROTACAO_X_CUBO) renderer.setrotacaoCuboX(valor);
else if (flag == ROTACAO_Y_CUBO) renderer.setrotacaoCuboY(valor);
else if (flag == ROTACAO_Z_CUBO) renderer.setrotacaoCuboZ(valor);
else if (flag == TAMANHO_X_CUBO) renderer.settamanhoCuboX(valor);
else if (flag == TAMANHO_Y_CUBO) renderer.settamanhoCuboY(valor);
else if (flag == TAMANHO_Z_CUBO) renderer.settamanhoCuboZ(valor);
else if (flag == POSICAO_X_CUBO) renderer.setposicaoCuboX(valor);
else if (flag == POSICAO_Y_CUBO) renderer.setposicaoCuboY(valor);
else if (flag == POSICAO_Z_CUBO) renderer.setposicaoCuboZ(valor);
else if (flag == COR_VERMELHO_CUBO) renderer.setcorCuboVermelho(valor);
else if (flag == COR_VERDE_CUBO) renderer.setcorCuboVerde(valor);
else if (flag == COR_AZUL_CUBO) renderer.setcorCuboAzul(valor); }
catch (IOException ioException){
ioException.printStackTrace(); } } |
Should I made a diferent code for the client and the server? Couse the way it is now, it's all the same. What is happning is that it's only sending the packet to itself, like there isn't any other user runing the program. I don't have much experience, so any help would be very apreciated. thx, uderman
|
|
|
|
|
3
|
Game Development / Networking & Multiplayer / Sending float data over a network
|
on: 2004-08-16 17:57:07
|
|
Hello
I am writing a JOGL/Swing program, and in the network part of it I need to send information about some 3D objects over a network. When a user changes the objects atribute, every instance of the program must recive this information, so I will not be a client/server program right? I think all I have to do is to learn how to send data(floats) over a network. Can anyone help me or point me to the right direction?
Thx
|
|
|
|
|
4
|
Java Game APIs & Engines / JOGL Development / Selecting objects with the mouse
|
on: 2004-08-02 19:12:56
|
|
hello,
In my JOGL program, I have to objects ( a cube and a piramide), and all the program so is change some objects propriets like position, rotation, size, color using JSliders.
So far I have just implemented the changes to the Cube. I would like to be able to select the objects with the mouse, and then perform the actions to the object selected, and also be able to drag the objects aroung the world. How can I do that?
I have read some material about selection on OpenGL, but I am having problens to "port" this to JOGL. I think all I have to do is to somehow know wich object is selected, and then send this info to the ChangeListener class of the Jsliders to perform the action to the selected object.
thx, any help is apreciated.
|
|
|
|
|
7
|
Java Game APIs & Engines / JOGL Development / Using JCanvas with Swing
|
on: 2004-07-19 12:24:11
|
|
hello, I was thinking about making something similar to this:
----------------------------------------------------- |JMenu | ----------------------------------------------------- |JList | | | | | | | JCanvas | | | | | | | | | | | | | -------------------------------------------------------
is it possible? I know about the issues about mixing lightweight and heavyheight components, but that can be solved if I set the JMenu and JList components to heavyheight right?
How do I add the the JCanvas? Add it to a JPanel, and then add the JPanel to the main JFrame?
any help is apreciated, thx.
Edit: The ansii pic is messed up, but it´s a menu in the top, then a list if the left and the canvas.
|
|
|
|
|
9
|
Java Game APIs & Engines / JOGL Development / "no jogl in java.library.path"
|
on: 2004-07-07 20:05:49
|
|
C:\j2sdk1.4.2_04\bin\java.exe -classpath "C:\j2sdk1.4.2_04\jre\lib\rt.jar;C:\j2sdk1.4.2_04\lib\tools.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\lib\ext\jogl.jar;E:\Uderman\OpenGL\NEHE TUTORIAL\LESSON 1\JOGL CODE" Lesson01 java.lang.UnsatisfiedLinkError: no jogl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at net.java.games.jogl.impl.NativeLibLoader$1.run(NativeLibLoader.java:60) at java.security.AccessController.doPrivileged(Native Method) at net.java.games.jogl.impl.NativeLibLoader.<clinit>(NativeLibLoader.java:46) at net.java.games.jogl.impl.GLContext.<clinit>(GLContext.java:51) at net.java.games.jogl.impl.windows.WindowsGLContextFactory.createGLContext(WindowsGLContextFactory.java:82)
at net.java.games.jogl.GLCanvas.<init>(GLCanvas.java:69) at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:150) at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:118) at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:85) at Lesson01.main(Lesson01.java:121) Exception in thread "main" Finished executing
hello,
I got this erro when trying to run the JOGL code to nehe tutorial 1. Probably I didn´t installed JOGL correctly, so can anyone help me?
|
|
|
|
|
11
|
Java Game APIs & Engines / Java 3D / Should I use Java3D in my aplication?
|
on: 2004-06-20 23:09:03
|
hello, I need to build a networked virtual environment, and need to create the 3d space, and some 3d objects to play around. I asked at the JOGl forum if using JOGl was my best choice, and they said that I should use Java3D or Xith3D: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1087577051As far as I know, I would get best performace using Opengl, and would get the project better organized and would deal with the 3D objects in a network better using Java3D or Xith3D. Am I correct? Also, I would like to know if Java3D really is slow, takes more space, more memory and stuff, is it true? Is it possible to use Java3D in my aplication? Couse a important part of the project is study he behaves of the virtual environments when more users connect to it. Would it be a issue when sending packages over the network with informations about the objects(like position, moviments, if it´s selected by other users and more)? Thanks for ya help. uderman
|
|
|
|
|
12
|
Java Game APIs & Engines / JOGL Development / Re: Questions from a n00b
|
on: 2004-06-18 21:07:48
|
thx for the fast replies  another thing, I heard that Java3D is slow, takes much space and stuff, is it true? I am asking that couse it could be a problem for the project when sending information for the instances of the project over the nerwork. And I wil take a look at Xith3D to see what it's about.
|
|
|
|
|
13
|
Java Game APIs & Engines / JOGL Development / Questions from a n00b
|
on: 2004-06-18 16:44:11
|
|
hello all.
I am completly new to openGl, and don't have much experience in Java. I will develop as a research project at University a "Networked Virtual Environment" in Java. So I need to build the 3d ambient, and also add some 3d objects to it, then study the network efects while the users manipulate those objects on the environments.
I would like to know if using JOGl is my best choice, or if I should use Java3D, or anything else?
If the best choice is to use JOgl, the way I should go is to frist learn some openGl, and then JOgl right? Also, where can I find some resourses to learn JOGl? The only Tutorial I finded so far was this one: h++p://www.stud.ntnu.no/~johanno/appletviewer.jsp?task=tutorials. If anyone could provide me with some more resourses it would be great.
Thanks all,
Uderman
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|