From e685ef73884108face0120c6e371a2d80677e99a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 27 Sep 2023 15:01:18 -0700 Subject: [PATCH] implement roblox Texture class texture coordinate transformation --- src/load_roblox.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/load_roblox.rs b/src/load_roblox.rs index dce2f37..c2064eb 100644 --- a/src/load_roblox.rs +++ b/src/load_roblox.rs @@ -186,11 +186,19 @@ pub fn generate_modeldatas_roblox(dom:rbx_dom_weak::WeakDom) -> Result<(Vec(size.z,size.y),//right + 1=>(size.x,size.z),//top + 2=>(size.x,size.y),//back + 3=>(size.z,size.y),//left + 4=>(size.x,size.z),//bottom + 5=>(size.x,size.y),//front + _=>(1.,1.), + }; roblox_texture_transform=RobloxTextureTransform{ - offset_u:*ox/size.x,offset_v:*oy/size.y, - scale_u:*sx/size.x,scale_v:*sy/size.y, - } + offset_u:*ox/(*sx),offset_v:*oy/(*sy), + scale_u:size_u/(*sx),scale_v:size_v/(*sy), + }; } } //I can alos put the color into here and generate the vertices with the color