earth navigation

This commit is contained in:
Morev_Nikita 2025-09-16 00:12:12 +02:00
parent 0b7dd792c8
commit 56b1d2d533
18 changed files with 342 additions and 0 deletions

11
Nikita/camera_hub.tscn Normal file
View file

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=3 uid="uid://tvwwstaorixw"]
[ext_resource type="Script" uid="uid://co77n1eq661oo" path="res://Nikita/scripts/camera_hub.gd" id="1_1mhol"]
[node name="CameraHub" type="Node3D"]
script = ExtResource("1_1mhol")
[node name="XRotation" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="XRotation"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1)

17
Nikita/earth.tscn Normal file
View file

@ -0,0 +1,17 @@
[gd_scene load_steps=6 format=3 uid="uid://cjlojmoyhw2cp"]
[ext_resource type="PackedScene" uid="uid://7fijqcjxggit" path="res://Nikita/source/Earth_Final.fbx" id="1_mnd7v"]
[ext_resource type="Texture2D" uid="uid://cw4gkryn2sl7y" path="res://Nikita/textures/Earth2_Water_BaseColor.png" id="2_v2ft5"]
[ext_resource type="Texture2D" uid="uid://da0uksbt2mkqw" path="res://Nikita/textures/Earth2_Land_BaseColor.png" id="3_drefq"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tyl1s"]
albedo_texture = ExtResource("2_v2ft5")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3pxso"]
albedo_texture = ExtResource("3_drefq")
[node name="Earth_Final" instance=ExtResource("1_mnd7v")]
[node name="earth4" parent="." index="0"]
surface_material_override/0 = SubResource("StandardMaterial3D_tyl1s")
surface_material_override/1 = SubResource("StandardMaterial3D_3pxso")

29
Nikita/hub_scene.tscn Normal file
View file

@ -0,0 +1,29 @@
[gd_scene load_steps=7 format=3 uid="uid://b6kb866y3e4aa"]
[ext_resource type="PackedScene" uid="uid://cjlojmoyhw2cp" path="res://Nikita/earth.tscn" id="1_248vy"]
[ext_resource type="Texture2D" uid="uid://cn2wdmm2xiodm" path="res://Nikita/textures/panorama_image.png" id="2_vvf8p"]
[ext_resource type="PackedScene" uid="uid://tvwwstaorixw" path="res://Nikita/camera_hub.tscn" id="3_ur8lc"]
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_ur8lc"]
panorama = ExtResource("2_vvf8p")
[sub_resource type="Sky" id="Sky_fkqbs"]
sky_material = SubResource("PanoramaSkyMaterial_ur8lc")
[sub_resource type="Environment" id="Environment_ur8lc"]
background_mode = 2
sky = SubResource("Sky_fkqbs")
[node name="Node3D" type="Node3D"]
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_ur8lc")
[node name="Earth_Final2" parent="." instance=ExtResource("1_248vy")]
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)
[node name="CameraHub" parent="." instance=ExtResource("3_ur8lc")]
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.0337074, -0.226039, 0.973535, 0.00782163, 0.974118, 0.225904, -0.999401, 0, 0.034603, 15.6131, 3.61956, 0)

View file

@ -0,0 +1,68 @@
extends Node3D
var rotation_speed = PI/2
var min_zoom = 1.3
var max_zoom = 5.0
var zoom_speed = 0.2
var zoom = 2.0
var mouse_grab_sensitivity = 0.006
var grabbed : bool = false
var velocity_y = 0.0
var dampening_y = 0.3
var stop_threashold_y = 0.5
var velocity_x = 0.0
var dampening_x = 0.1
var stop_threashold_x = 0.3
func _process(delta: float) -> void:
$XRotation.rotation.x = clamp($XRotation.rotation.x, -1.3, 1.3)
scale = lerp(scale, Vector3.ONE * zoom, zoom_speed)
velocity_y = clamp(velocity_y, -100.0, 100.0)
velocity_x = clamp(velocity_x, -10.0, 10.0)
if !grabbed:
rotate_object_local(Vector3.UP, -1 * velocity_y * mouse_grab_sensitivity)
if velocity_y > stop_threashold_y:
velocity_y -= dampening_y
elif velocity_y < -stop_threashold_y:
velocity_y += dampening_y
else:
velocity_y = 0.0
$XRotation.rotate_object_local(Vector3.RIGHT, -1 * velocity_x * mouse_grab_sensitivity)
if velocity_x > stop_threashold_x:
velocity_x -= dampening_x
elif velocity_x < -stop_threashold_x:
velocity_x += dampening_x
else:
velocity_x = 0.0
$XRotation.rotation.x = clamp($XRotation.rotation.x, -1.3, 1.3)
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
grabbed = event.pressed
if grabbed:
velocity_x = 0.0
velocity_y = 0.0
elif event.button_index == MOUSE_BUTTON_WHEEL_UP:
zoom -= zoom_speed
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
zoom += zoom_speed
zoom = clamp(zoom, min_zoom, max_zoom)
if event is InputEventMouseMotion and grabbed:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
if event.relative.x != 0:
var x_rotation = clamp(event.relative.x, -30, 30)
if abs(event.relative.x - x_rotation) > 0:
velocity_y = event.relative.x - x_rotation
rotate_object_local(Vector3.UP, -1 * x_rotation * mouse_grab_sensitivity)
if event.relative.y != 0:
var y_rotation = clamp(event.relative.y, -10, 10)
if abs(event.relative.y - y_rotation) > 0:
velocity_x = event.relative.y - y_rotation
$XRotation.rotate_object_local(Vector3.RIGHT, -1 * y_rotation * mouse_grab_sensitivity)
else:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
func get_mouse_input(delta: float):
return

View file

@ -0,0 +1 @@
uid://co77n1eq661oo

Binary file not shown.

View file

@ -0,0 +1,38 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://7fijqcjxggit"
path="res://.godot/imported/Earth_Final.fbx-82ce24a36b10df65c736c390f1ab8d63.scn"
[deps]
source_file="res://Nikita/source/Earth_Final.fbx"
dest_files=["res://.godot/imported/Earth_Final.fbx-82ce24a36b10df65c736c390f1ab8d63.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://da0uksbt2mkqw"
path.s3tc="res://.godot/imported/Earth2_Land_BaseColor.png-7ee2f5da2a05aadb931d4316a8113a29.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Nikita/textures/Earth2_Land_BaseColor.png"
dest_files=["res://.godot/imported/Earth2_Land_BaseColor.png-7ee2f5da2a05aadb931d4316a8113a29.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal="uid://bknabbn1h3w2q"
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bknabbn1h3w2q"
path="res://.godot/imported/Earth2_Land_Roughness.png-249e734ef9e5504f2a4e037209f1c48d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Nikita/textures/Earth2_Land_Roughness.png"
dest_files=["res://.godot/imported/Earth2_Land_Roughness.png-249e734ef9e5504f2a4e037209f1c48d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cw4gkryn2sl7y"
path.s3tc="res://.godot/imported/Earth2_Water_BaseColor.png-6206b41a43a411cb6e46ce8bd7b1b1da.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Nikita/textures/Earth2_Water_BaseColor.png"
dest_files=["res://.godot/imported/Earth2_Water_BaseColor.png-6206b41a43a411cb6e46ce8bd7b1b1da.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal="uid://c85cxc0wihnpt"
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c85cxc0wihnpt"
path="res://.godot/imported/Earth2_Water_Roughness.png-b18c4d0abfc494db36920a42508774ae.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Nikita/textures/Earth2_Water_Roughness.png"
dest_files=["res://.godot/imported/Earth2_Water_Roughness.png-b18c4d0abfc494db36920a42508774ae.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cn2wdmm2xiodm"
path.s3tc="res://.godot/imported/panorama_image.png-9f73dc15751376ad3428d34ab0c4c787.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Nikita/textures/panorama_image.png"
dest_files=["res://.godot/imported/panorama_image.png-9f73dc15751376ad3428d34ab0c4c787.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View file

@ -11,5 +11,10 @@ config_version=5
[application]
config/name="AllAroundTheWorld"
run/main_scene="uid://b6kb866y3e4aa"
config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg"
[rendering]
renderer/rendering_method="gl_compatibility"