Houla. Deux choses.
- Je suis déçu. Je m'attendais à une voiture avec plusieurs jointures. Et bien non. une seule jointure.

- Utiliser Animator pour modéliser une voiture pourquoi pas. Par contre pour la faire rouler comme une voiture ça va pas le faire.

Tu ne pourras pas créer une animation pour faire tourner les roues avec un angle variable.
■ Revenons à ton code. J'ai modifié quelques trucs légers.
Quand tu attaches un mesh à une jointure tu ne dois pas indiquer l'emplacement du mesh.
J'ai remplacé
Code : Tout sélectionner
AttachJoinEntity(Caisse(), "assets\mesh\caisse.mesh", "rgb(255,0,0)", 0,0,0)
par
Code : Tout sélectionner
AttachJoinEntity(Mavoiture(), "caisse.mesh", "rgb(255,0,0)", 0,0,0)
Ton code devient
Code : Tout sélectionner
EnableExplicit
XIncludeFile "Animator120.pbi" : UseModule Animator
; Initialisation de ta voiture
Define NewList Mavoiture.NewSkeleton()
; Ajout de la jointure qui supportera la caisse
Define j0 = AddJoin(Mavoiture(), "Caisse", 0, 0, 0)
; Le joint est crée. Ajout du mesh représentant la caisse
;AttachJoinEntity(Caisse(), "assets\mesh\caisse.mesh", "rgb(255,0,0)", 0,0,0)
AttachJoinEntity(Mavoiture(), "caisse.mesh", "rgb(255,0,0)", 0,0,0)
; Création d'une animation
If CreateJoinAnimation(j0, "run")
AddJoinKey(j0, "run", 0,90,0, 0,1,0)
EndIf
SaveSkeleton(Mavoiture(), "MaVoiture.json")
■ Passons à l'aperçue de cette caisse en forme de savon

.
J'ai ajouté le path à tes meshs.
Ton code
Code : Tout sélectionner
; ___ _ _
; / _ \ (_) | |
;/ /_\ \_ __ _ _ __ ___ __ _| |_ ___ _ __
;| _ | '_ \| | '_ ` _ \ / _` | __/ _ \| '__|
;| | | | | | | | | | | | | (_| | || (_) | |
;\_| |_/_| |_|_|_| |_| |_|\__,_|\__\___/|_| By falsam
;
;http://falsam.com/animator/doku.php?id=start
;///////////////////////////////////////////////////////
; Car Projet
; by venom
;///////////////////////////////////////////////////////
EnableExplicit
IncludeFile "Animator120.pbi"
UseModule Animator
; DPI Resolution
Global drx.f, dry.f
; Caméra
Global Camera
; Entités divers
Global Mesh, Material, Entity
; Delta Time
Global dt.f
; Initialisation de l'objet ou avatar animé
Define NewList Caisse.NewSkeleton()
; Download du skeleton
LoadSkeleton(Caisse(), "run.json")
; Initialisation de l'environnement 3D
; Création de la fenetre 3D
InitEngine3D(#PB_Engine3D_DebugLog) : InitSprite() : InitKeyboard()
drx = DesktopResolutionX()
dry = DesktopResolutionY()
ExamineDesktops()
InitEngine3D(#PB_Engine3D_DebugLog) : InitSprite() : InitKeyboard() : InitMouse()
OpenWindow(0, 0, 0, DesktopWidth(0), DesktopHeight(0), "", #PB_Window_Maximize | #PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0),0, 0, WindowWidth(0)*drx , WindowHeight(0)*dry, 0, 0, 0, #PB_Screen_WaitSynchronization)
;WorldDebug(#PB_World_DebugBody)
KeyboardMode(#PB_Keyboard_International | #PB_Keyboard_AllowSystemKeys)
EnableWorldPhysics(#True)
; Localisation des assets
Add3DArchive("assets/skybox/Early_morning.zip", #PB_3DArchive_Zip)
Add3DArchive("assets/textures", #PB_3DArchive_FileSystem)
Add3DArchive("assets/material", #PB_3DArchive_FileSystem)
Add3DArchive("assets/mesh", #PB_3DArchive_FileSystem)
Parse3DScripts()
; Caméra
Camera = CreateCamera(#PB_Any, 0, 0, 100, 100)
MoveCamera(Camera, 0, 10, 40)
; Lumiére et ombre
CreateLight(#PB_Any, RGB(255, 255, 255), 0, 100, 100)
AmbientColor(RGB(184, 184, 184))
WorldShadows(#PB_Shadow_Additive)
; Ciel
SkyBox("Early_morning.jpg")
;- Sol
MaterialFilteringMode(#PB_Default, #PB_Material_Trilinear)
Mesh = CreatePlane(#PB_Any, 100, 100, 100, 100, 20, 20)
Material = CreateMaterial(#PB_Any, TextureID(LoadTexture(#PB_Any, "grass.png")))
Entity = CreateEntity(#PB_Any, MeshID(Mesh), MaterialID(Material))
CreateEntityBody(Entity, #PB_Entity_StaticBody, 1, 0.1, 0.1)
;- Chargement de la voiture
Define NewList Mavoiture.NewSkeleton()
LoadSkeleton(MaVoiture(), "mavoiture.json")
CreateAvatar(Mavoiture())
Repeat
While WindowEvent() : Wend
ExamineKeyboard()
; Jouer l'animation "run"
; framerate de 120 images pour chaque clé de l'animation
;Playanimation(Caisse(), "run", 120)
CameraLookAt(Camera, 0, 0, 0)
dt = RenderWorld()/1000
FlipBuffers()
Until KeyboardReleased(#PB_Key_Escape)
Si tu veux vraiment une voiture qui roule comme une vrai voiture (ou presque) n'utilise pas Animator. Utilise les fonctions natives de PureBasic liées à la création de véhicules
https://www.purebasic.com/french/docume ... index.html