reepblue Posted November 3, 2023 Share Posted November 3, 2023 When resizing the grid in the editor, I notice that the reported grid sizes go by the following. 5.0mm 1.0 2.0 4.0 8.0 16.0 32.0 64.0 1.3 2.6 5.1 10.2 I dunno if this is just visual but I've ran into an issue with brushes no longer being on the grid when making geometry and I'm under the impression this is the cause. While I'm here, placing models doesn't feel right like it was in Leadwerks. I'm having issues placing models exactly where I want them. This seems to be the issue of the drag and drop system. To guarantee the model is on the grid, I have to set the position to 0,0,0 and then everything seems to work as intended. I should point out that most of my trouble is working with the 2D grid viewports. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted November 3, 2023 Share Posted November 3, 2023 The grid measurements are correct, it's just that the string formatting was rounding off one decimal place. I adjusted it so it allows two decimal spaces when needed. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted November 3, 2023 Author Share Posted November 3, 2023 Ok, thought it was just the string rounding. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Solution Josh Posted November 4, 2023 Solution Share Posted November 4, 2023 There was a problem with the model drag-and-drop. In the 2D viewports the position was not being rounded to the grid units. The dropped coordinate was calculated wrong, and was offset by the window titlebar. With brush editor, the edges are not intended to snap to the grid position if the grid size is bigger than when the brush was created. The grid determines the increments by which things change. The Leadwerks way was the sloppily coded approach, the Ultra way is what I actually wanted. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted November 5, 2023 Author Share Posted November 5, 2023 Was this fixed in Build 201? I set my grid size to 2.56 and released my model exactly on the grid line and it's still off. This doesn't feel good. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted November 6, 2023 Share Posted November 6, 2023 When you drag a model onto the surface it does a pick to see if something is hit, and if so it drops the model in the picked position. If we want the position to be rounded to the grid, then it is probably necessary to take into consideration the picked normal. For example, if that floor does not line up to the grid size vertically, you almost certainly would still want to use the Y component of the pick as the position, without any rounding. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted November 6, 2023 Author Share Posted November 6, 2023 18 minutes ago, Josh said: When you drag a model onto the surface it does a pick to see if something is hit, and if so it drops the model in the picked position. Ok, this makes sense why it's not working as intended. I don't think the AlignToVector/pickinfo.normal on brushes is working as intended. This is my visual result on a model: Same code on the brush All I'm doing is: auto end = LoadModel(GetEntity()->GetWorld(),"Models/Developer/Widgets/normal.gltf"); auto p0 = GetEntity()->GetPosition(true); auto p1 = TransformPoint(0, 0, viewdistance, GetEntity(), NULL); pickinfo = GetEntity()->GetWorld()->Pick(p0, p1, radius, true, InteractionPickFilter); bool lookingatvoid = !pickinfo.success; if (!lookingatvoid) { // Set the end point to the position. end->SetPosition(pickinfo.position); end->SetRotation(0, GetEntity()->GetRotation(true).y, 0); end->AlignToVector(pickinfo.normal); } Edit: Maybe it doesn't have anything to do with it? It's a bug regardless.. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted November 6, 2023 Share Posted November 6, 2023 No, I don't see any connection. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted November 6, 2023 Author Share Posted November 6, 2023 Thought so (It's still a bug tho). 27 minutes ago, Josh said: If we want the position to be rounded to the grid, then it is probably necessary to take into consideration the picked normal. This is why I thought it was the normal messing this up. Read this too fast. While the current system is correct I don't think it feels right. In Leadwerks, placing models in the scene snaps the model to the nearest grid point. This felt great especially when the model's origin accommodated the model. I don't want to manually type in the entity's position to get it back on the grid. This is what I want in the new editor with the option to turn it off for more natural placement of objects for rocks and such. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted November 6, 2023 Share Posted November 6, 2023 Yeah, I basically agree I am just saying it's a design issue and I need to think about it and try some things. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted November 6, 2023 Share Posted November 6, 2023 When dragging a model into the 3D viewport, if it is dropped onto an existing surface, the final position will now be rounded off to the grid size. I am not 100% satisfied with this behavior, but I don't know yet how to round it to the grid size while staying aligned to the plane of the picked position / normal. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted November 6, 2023 Author Share Posted November 6, 2023 Most of the time, I place objects in the 2D view since it's closer to the File Browser panel. Maybe that should be more grid locked than the 3D view port? One of the few reasons I would use the 3D view to place objects would be to place objects on surfaces having the model's align to the surfaces normal which doesn't seem to be in the editor currently afaik. Also one feature (or bug) I don't like is when you place an object on the Top 2D grid view and the item gets placed on it's side. It's like the Top grid viewport is being handled the same way as Back/Side. I'll try to play with your changes tonight and get back to you. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
reepblue Posted November 7, 2023 Author Share Posted November 7, 2023 9 hours ago, Josh said: When dragging a model into the 3D viewport, if it is dropped onto an existing surface, the final position will now be rounded off to the grid size. I am not 100% satisfied with this behavior, but I don't know yet how to round it to the grid size while staying aligned to the plane of the picked position / normal. I got to play with it and my first reaction was: The example models snap right into place where I want it to go. It feels so much better. For uniformed models, this is perfect, but I understand not every model is like this. Making brushes seems much better, but it might be a placebo effect. I'll have to play with it more. But I was the only one complaining about this, I guess let's see if anyone else finds this a step forward or backward. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
IceBurger Posted November 7, 2023 Share Posted November 7, 2023 2 hours ago, reepblue said: But I was the only one complaining about this, I guess let's see if anyone else finds this a step forward or backward. I'm looking forward to trying it out. I noticed the behavior but didn't really think much about it. Quote i now hate love C++ Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.