Author Topic: Camera rotate  (Read 4864 times)

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Camera rotate
« on: August 29, 2007, 08:03:55 pm »
What object in jpct support to move camera fllow mouseMove event like ConterStrike game??
Thank for help!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Camera rotate
« Reply #1 on: August 29, 2007, 08:45:06 pm »
This thread has some info about it: http://www.jpct.net/forum2/index.php/topic,841.0.html

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Camera rotate
« Reply #2 on: August 30, 2007, 03:19:30 pm »
i already try to use the tip in that thread , but it throw this exeption:
Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalStateException: Display must be created.

i cant not find error!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Camera rotate
« Reply #3 on: August 30, 2007, 05:23:42 pm »
That is the error:
Code: [Select]
java.lang.IllegalStateException: Display must be created

You can't initialize the mouse-related stuff before an OpenGL-window has been created (i.e. before the renderer has been set). Or are you using the software renderer? Then it would be a different story.

Offline LiuFeng

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Camera rotate
« Reply #4 on: August 30, 2007, 05:56:16 pm »
no,my computer already has openGL, because  i run feud_demo  well

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: Camera rotate
« Reply #5 on: August 30, 2007, 06:47:19 pm »
Egon means that the call to the MouseMapper have to be called after initialiting the OpenGl code. This is becausse the MouseMapper works on native OpenGl windows.

If you are using software rendering you can use normal mouse events.


code sequence

-------
build the world and all those stuff

init all the rendering stuff

init the MouseMapper stuff

renderLoop

whatever
Nada por ahora