Vertx » up

Unity – Improved SceneView Camera

Overview: The FreeCamera solution comes with two modes for operating the scene-view camera in Unity: Free (Trackball) and 6Axis. Free (Trackball): Inspired by Modo’s trackball camera I took a day to write a Unity solution. The trackball should override Unity’s scene camera rotation when enabled. Describing how it works is a little hard; there’s a cross centred in the middle of the viewport that gets weaker the closer to the corners you go. If you’re in the middle of the vertical part you can rotate over and under by dragging down and up. If you’re in the middle of the horizontal part you can rotate left and right. Dragging around the edges will roll the camera. All these work in tandem, increasing and decreasing based on the distances from the cross lines and edges. 6Axis: Six-axis mode realigns the scene-view’s “up” to an appropriate axis when the camera tilts over 90 degrees. This effectively creates a default scene camera that can view the scene from any direction. Still incapable of rolling the camera in use, but able to roll when you look “too far” up or down. Interestingly when changing axes close to 45degrees you may feel like there’s issues of intention vs reality, this is […]
Read More ›

Unity – Line Rendering Alternative

After admiring the graphics of my Tunnel I wanted to mirror the aesthetics in a ‘real’ world, instead of an abstract visual. I used GL.Lines in the Tunnel, manually positioning them on the CPU; seeing as I had the positional data already from the Tunnel itself, I wasn’t worried about this. But for a large scene this is infeasible. Luckily Unity has different mesh topologies I can use to hold this information. A normal mesh doesn’t purely preserve a silhouette in its geometry; there’s edges of quads and triangles that aren’t what I would like to see. A method to generate silhouette edges that I use for a simpler game I’m making (one who’s only geometry is cubes and tetrahedrons) is to extrude the edges I want to draw towards the origin. Then in script I can just ask which edges don’t share a vertex on the origin, and add them to the indices array. But having to frequently revisit a modelling tool to make edits to wireframes seemed daunting, so I spent a day making a quick tool to bake the right edges to be created before or after runtime. I can now manually allocate edges where a line will be created. […]
Read More ›