{"id":24655166,"url":"https://github.com/xtenzq/jogl-helicopter","last_synced_at":"2026-05-16T01:32:56.856Z","repository":{"id":115828454,"uuid":"103526982","full_name":"xtenzQ/Jogl-Helicopter","owner":"xtenzQ","description":"🚁 Simple OpenGL implementation of a flying helicopter with basic physics applied","archived":false,"fork":false,"pushed_at":"2018-04-02T13:30:14.000Z","size":9135,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T11:45:05.639Z","etag":null,"topics":["game","helicopter","helicopter-game","java","jogl","opengl","physics","simulation"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xtenzQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-14T12:00:45.000Z","updated_at":"2023-04-14T20:07:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c4bca23-0b38-424d-8884-c8a5a389613d","html_url":"https://github.com/xtenzQ/Jogl-Helicopter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xtenzQ/Jogl-Helicopter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2FJogl-Helicopter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2FJogl-Helicopter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2FJogl-Helicopter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2FJogl-Helicopter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtenzQ","download_url":"https://codeload.github.com/xtenzQ/Jogl-Helicopter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtenzQ%2FJogl-Helicopter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33087028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","helicopter","helicopter-game","java","jogl","opengl","physics","simulation"],"created_at":"2025-01-25T22:36:19.530Z","updated_at":"2026-05-16T01:32:56.842Z","avatar_url":"https://github.com/xtenzQ.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JOGL Helicopter\n\n### *UNDER CONSTRUCTION*\n\n## Contents\n1. [Before we start](#before-we-start)\n2. [IDEs and plugins used](#ides-and-plugins-used)\n3. [Main classes](#main-classes)\n    - [Helicopter](#helicopter)\n    - [Main procedure of controller class](#main-procedure-of-controller-class)\n4. [References](#references)\n\n## Before we start\n\n![Helicopter](https://i.imgur.com/DLTbumP.png)\n*The application is developed as the part of the project for computer graphics course at Irkutsk National Research Techincal University.*\n\n## IDEs and plugins used\n- NetBeans IDE ([Download](https://netbeans.org/downloads/index.html))\n- NetBeans OpenGL Pack ([Download](http://plugins.netbeans.org/plugin/3260/netbeans-opengl-pack))\n\n## Main classes\n### Helicopter\n\nFirst of all, we have to define parameter fields for a helicopter.\nModel related fields:\n```Java\n// Obj file for helicopter model\nprivate final Object body;\n// Main screw\nprivate final Object mainScrew;\n// Roll screw\nprivate final Object rollScrew;\n```\nPhysics-related fields:\n```Java\n// Mass\npublic final float mass = 11000; // 11 000 kg\n// Max Y speed\npublic final float maxSpeedY = 20; // 20 meters per second\n\n// Speed\npublic Vector3 speed;\n// Acceleration\npublic Vector3 accel;\n\n// Angular Velocity\npublic Vector3 speedAngle;\n// Angular Acceleration\npublic Vector3 accelAngle;\n\n// Thrust\npublic static float pull = (float) 0;\n// Rotational speed relative to the yaw axis\npublic static float pullAngle = (float) 0.3;\n```\nThen create a constructor. Before doing anything it's needed to load three models (obj-files) of our helicopter: \n```Java\nbody = new Object(\"heli/Helicopter.obj\");\nmainScrew = new Object(\"heli/MainScrew.obj\");\nrollScrew = new Object(\"heli/RollScrew.obj\");\n```\nAfter this we have to set two screws of the helicopter:\n```Java\nmainScrew.position.x = (float) 0.05961;\nmainScrew.position.y = (float) 3.58183;\nmainScrew.position.z = (float) -0.07208;\nmainScrew.angles.x = (float) -3;\n\nrollScrew = new Object(\"heli/RollScrew.obj\");\n// Фикс рулевого винта\nrollScrew.position.x = (float) -0.51373;\nrollScrew.position.y = (float) 3.06563;\nrollScrew.position.z = (float) -10.9899;\n```\nNow program physics:\n```Java\npublic void physImpact() {\n    /* Изменение по координатам */\n    position.add(speed);\n    speed.add(accel);\n    // 0.1633 = 9.8 м/с2 / 60 (FPS)\n    speed.y -= 9.8 / FPS * 0.21;\n    // сопротивление\n    speed.mult(0.95);\n    // изменение по углу\n    angles.add(speedAngle);\n    speedAngle.add(accelAngle);\n    speedAngle.mult(0.7);\n\n    mainScrew.angles.y += 8 * Math.PI ;//5 ------ 8*Pi\n    mainScrew.angles.y += (speed.y \u003e 0) ? 3 : -3; //3\n\n    rollScrew.angles.x += 40 * Math.PI;//10 ------ 40*Pi\n    rollScrew.angles.x += (speedAngle.y \u003e 0) ? 3 : -3; //3\n    rollScrew.angles.x += (speed.y \u003e 0) ? 2 : -2; //2\n}\n```\nAnd collision:\n ```Java\npublic void collision(float height) {\n    if (height \u003e position.y - 0.3656) {\n        position.y += height - position.y + 0.3656;\n        speed.y = 0;\n    }\n}\n```\n\n### Main procedure of controller class:\n```Java\npublic static void controll() {\n    double sin;\n    double cos;\n    double angle;\n    if (spectator) {\n        if (yawLeft || yawRight || forward || back) {\n            angle = toRadian * MainCamera.angles.y;\n            sin = Math.sin(angle) * speed;\n            cos = Math.cos(angle) * speed;\n            if (yawRight) {\n                MainCamera.position.x += cos;\n                MainCamera.position.z -= sin;\n            }\n            if (yawLeft) {\n                MainCamera.position.x -= cos;\n                MainCamera.position.z += sin;\n            }\n            if (forward) {\n                MainCamera.position.x -= sin;\n                MainCamera.position.z -= cos;\n            }\n            if (back) {\n                MainCamera.position.x += sin;\n                MainCamera.position.z += cos;\n            }\n        }\n        if (up || down) {\n            if (up) {\n                MainCamera.position.y += speed;\n            }\n            if (down) {\n                MainCamera.position.y -= speed;\n            }\n        }\n    } else {\n        heli.accel.mult(0);\n        heli.accelAngle.mult(0);\n\n        angle = toRadian * heli.angles.y;\n        sin = Math.sin(angle);\n        cos = Math.cos(angle);\n//            MainCamera.position.x = heli.position.x - (float) (sin) * distance;\n//            MainCamera.position.y = heli.position.y + 15;\n//            MainCamera.position.z = heli.position.z - (float) (cos) * distance;\n//            MainCamera.angles.x = - 20;\n//            MainCamera.angles.y = heli.angles.y + 180;\n        double cosX = Math.cos(-MainCamera.angles.x * toRadian + Math.PI * 0.5);\n        double sinX = Math.sin(-MainCamera.angles.x * toRadian + Math.PI * 0.5);\n        double cosY = Math.cos(-MainCamera.angles.y * toRadian - Math.PI * 0.5);\n        double sinY = Math.sin(-MainCamera.angles.y * toRadian - Math.PI * 0.5);\n        MainCamera.position.x = heli.position.x - (float) (distance * sinX * cosY);\n        MainCamera.position.y = heli.position.y - (float) (distance * cosX);\n        MainCamera.position.z = heli.position.z - (float) (distance * sinX * sinY);\n\n        Vector3 direction = new Vector3(0, 0, 0);\n\n        // Рыскание вправо\n        if (yawRight) {\n            heli.accelAngle.y = -(float) pullAngle;\n        }\n        // Рыскание влево\n        if (yawLeft) {\n            heli.accelAngle.y = (float) pullAngle;\n        }\n        if (rollRight) {\n            heli.angles.z += (20 - heli.angles.z) * 0.1;\n            direction.x += -(float) cos;\n            direction.z += (float) sin;\n        }\n        if (rollLeft) {\n            heli.angles.z += (-20 - heli.angles.z) * 0.1;\n            direction.x += (float) cos;\n            direction.z += -(float) sin;\n        }\n        if (forward) {\n            heli.angles.x += (30 - heli.angles.x) * 0.1;\n            direction.x += (float) sin;\n            direction.z += (float) cos;\n        }\n        if (back) {\n            heli.angles.x += (-30 - heli.angles.x) * 0.1;\n            direction.x += -(float) sin;\n            direction.z += -(float) cos;\n        }\n        if (up) {\n            direction.y += (float) 1;\n        }\n        if (down) {\n            direction.y += -(float) 1;\n        }\n        if (!forward \u0026\u0026 !back) {\n            heli.angles.x *= 0.9;\n        }\n        if (!rollRight \u0026\u0026 !rollLeft) {\n            heli.angles.z *= 0.9;\n        }\n        direction.normalize();\n        direction.mult(pull);\n        heli.accel = direction;\n    }\n}\n```\n\n## References\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtenzq%2Fjogl-helicopter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtenzq%2Fjogl-helicopter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtenzq%2Fjogl-helicopter/lists"}