THREE.Terrain | procedural terrain generation engine for use | Graphics library
kandi X-RAY | THREE.Terrain Summary
kandi X-RAY | THREE.Terrain Summary
THREE.Terrain is a procedural terrain generation engine for use with the Three.js 3D graphics library for the web.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of THREE.Terrain
THREE.Terrain Key Features
THREE.Terrain Examples and Code Snippets
Community Discussions
Trending Discussions on THREE.Terrain
QUESTION
I have a terrain which was generated using the THREE.Terrain library. I'd like to be able to click and drag out a marquee and select objects that are on the surface of the Terrain Mesh.
Currently I am detecting the start and end of the drag, and drawing out a rectangle in the global XZ plane, but I'd prefer it to be flush with the surface.
Currently it looks like this;
However what I am aiming for is something more like this;
I am wondering if I have missed some obvious way of doing that with the Core three.js features.
There is always the brute force method of casting rays at intervals around the perimeter of the rectangle, and creating a series of line segments to approximate the projected rectangle, but I was wondering if there was a native method.
(I only just started looking at three.js this week, so I might have missed something obvious... though I've spent the last day experimenting, and haven't had much luck)
Update
Based on @prisoner849's suggestion, I mashed up his code with the Terrain demo and that seems to be working pretty well.
...ANSWER
Answered 2018-Jul-04 at 02:07Right after I posted my comment, I had a thought exactly like Don McCurdy (cheers, Don :) ). Quick search on https://www.shadertoy.com gave me that shader https://www.shadertoy.com/view/XlsBRB (look at the awesome comments from FabriceNeyret2 there). So I just adapted that fragment shader for this very rough concept.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install THREE.Terrain
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page