Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:26:41+00:00 2026-06-09T20:26:41+00:00

Im trying make first person camera in my project. I followed this tutorial http://www.morrowland.com/apron/tutorials/gl/gl_camera_3b.zip

  • 0

Im trying make first person camera in my project. I followed this tutorial

http://www.morrowland.com/apron/tutorials/gl/gl_camera_3b.zip

Keyboard movement is ok but Mouse movement is strange. I’m using java+jolg but i think there is no much difference

Here is the two methods responsible for rotating:

    public void rotate(float speed) {
    aux = mView.minus(mPos);
    mView.z = (float) (mPos.z + Math.sin(Math.toRadians(speed)) * aux.x + Math.cos(Math.toRadians(speed))
            * aux.z);
    mView.x = (float) (mPos.x + Math.cos(Math.toRadians(speed)) * aux.x - Math.sin(Math.toRadians(speed))
            * aux.z);

}

    public void mouseMove(float x, float y) {
    float angle_y = 0.0f;
    float angle_z = 0.0f;

    if ((x == w/2) && (h/2 == y))
        return;

    robot.mouseMove(w / 2, h / 2);


    angle_y = (float) ((w / 2 - x)) / 1000;
    angle_z = (float) ((h / 2 - y)) / 1000;


    mView.y += angle_z * 2;

    if ((mView.y - mPos.y) > 8)
        mView.y = mPos.y + 8;
    if ((mView.y - mPos.y) < -8)
        mView.y = mPos.y - 8;

    rotate(-angle_y); // Rotate
}

and there is listener:

            public void mouseMoved(MouseEvent e) {
            Point p = e.getPoint();
            camera.mouseMove((float)p.getX(),(float) p.getY());
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:26:42+00:00Added an answer on June 9, 2026 at 8:26 pm

    Problem was in how java getting point from canvas. So if I changed

    Point p = e.getPoint();
    

    to

    Point p = MouseInfo.getPointerInfo().getLocation();
    

    It works.

    Sorry for late answer. I forgotten for this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make kind of online gallery, this is first .html doc
I'm developing a 3d (first/third person) game and I'm trying to make it multiplayer
Hy, I am currently trying to make a first person game.what i was able
I trying to make my first AJAX with JSON call using jQuery and CodeIgniter.
I'm trying to make my first app for Microsoft Surface. I need to use
I am trying to make my first app using XNA, and I am having
Hi I'm trying to make the first element of my observableArray hidden, the following
It's my first time trying to make anything really interesting in C# and I
I am trying to make two .exe files in c where first one store
I'm trying to make a multiplayer game for the first time on Android. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.