-
Notifications
You must be signed in to change notification settings - Fork 23
Add 3D objects to terminal glasses #106
Add 3D objects to terminal glasses #106
Conversation
|
@zeroeightysix how will this work exactly? Is there a coordinate system centered around the player, so that there can be a "virtual reality"? If this already (partially) works, can you maybe make a small video to showcase it? |
|
@redfast00 Methods are (currently) just all added onto the canvas object. (e.g. |
|
@zeroeightysix yes! That's exactly what I need, thanks. Are the virtual blocks visible through real blocks? |
|
@redfast00 That you can choose yourself. Take a look at Box.java, most notably the depth testing field. It's defined when you create the box. |
|
Ah, just saw it. This is really cool, is there anything blocking merging? |
This is still very much in a "discuss the implementation" phase. One of the things which stopped my initial implementation of this, and I'm still not sure about is how you handle the player moving. You probably don't want objects to move with you, but then how do I'd really appreciate some other opinions on this, as I've enumerated several possibilities and none of them seem especially enticing. The obvious bodge would be to limit this to static blocks (i.e. the manipulator), but that's not exactly ideal. I'd also like to see some support for 2D objects, suck as text, though that's less of priority. |
|
Here's what I think might work, please point out inconsistencies: there could be a |
|
Hrmrm, I do actually like the idea of creating a new canvas each time with its own coordinate system. I'd need to do some work on child groups (like #39 mentions) before having a crack at this, but it's definitely the best solution I've seen so far. |
|
I really like @redfast00's idea of being able to draw things tied to world coordinates, but it feels a little bit black-box-y, if that makes sense. On the other hand, it would make the usage much smoother by not having to constantly redraw as the user moves around. I don't think it should disappear or fire an event if the user leaves the area, however. |
|
@apemanzilla I considered non-disappearing boxes, but I think users would put way too much boxes everywhere and not remove them (because they aren't in the area anymore). A potential solution would be to either limit the amount of boxes to a fixed number, or to make keeping boxes alive also have a cost in the built-in system. Let me know if you have any more ideas, the more, the better. |
|
@redfast00 What's the issue with having "too many boxes"? Only the user themselves gets to see them, so it'll only bother them aswell. Or are you trying to say it's too powerful and needs balancing? |
|
It does seem a bit too powerful, and it would seem that it would hurt performance, but I haven't tested it. |
|
Honestly, if there's any limits, it should be generalised over the entire glasses rather than just 3D objects. The better solution is probably to limit network traffic (so the number of changes in a tick) rather than some hard limit. |
Every object now keeps track of its parent ID (with the glasses having an ID of 0). The canvas(es) keep a mapping of parent -> children IDs, so when removing an object we can (recursively) remove all its children. This implementation may seem a little indirect, but allows us to keep the objects as plain as possible - which is incredibly useful as we need to (de)serialise them in order to sync with the client. Closes #141
One creates a new "3d canvas", which is centred on the player at that given moment in time. Any objects added to that canvas exist relative to the creation point. We also add some base interfaces for 3D objects, as well as a box and line object.
This PR aims to fully implement 3D objects to plethora's terminal glasses.
Contributors may want to reference #51 and the currently open issue #39
Task list