Mandala-3D | Dynamically drawing 3D Mandala patterns | Animation library
kandi X-RAY | Mandala-3D Summary
kandi X-RAY | Mandala-3D Summary
:cherry_blossom: Dynamically drawing 3D Mandala patterns. Made with three.js and GSAP tweenmax.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Init scene .
- PUBLIC FUNCT constructor
- handle mouse down
- creates a new buffer for a new group
- handle touchstart events
- Handle touch move events .
- Handle mouse move
- Pan the keydown
- touch move handle
- Handle point move .
Mandala-3D Key Features
Mandala-3D Examples and Code Snippets
Community Discussions
Trending Discussions on Mandala-3D
QUESTION
I"m not exactly sure how I can do this. I read a lot about raycasting and that seems to be good for finding points that intersect with something, but in this case I just want it to interpolate the 2d mouse coordinates to the 3d point exactly where the mouse clicks, regardless of scale, rotation, whether or not there's an object there, etc.
One method I've thought of but not approached would be making an invisible plane that is parallel to the camera, always oriented upright and always intersecting the y axis. Then use a raycaster to hit the plane, draw as needed, then delete the plane. Seems like a silly way to do this though.
At the moment I have a method that works pretty well but it has some issues when the line gets further away from the origin, or the camera gets zoomed
In this photo I drew two lines from two different perspectives. The vertical line what it looks like when the camera is level with the x and z axis, and I draw a straight line down the y axis, while the horizontal line is what happens when i scribble with the camera facing down. https://i.imgur.com/f8qw5xV.png
As you can see, it seems to use the distance to the camera to make this calculation, so the further the distance from the camera, the more distortion is in the calculation. How can get rid of this distortion?
source: https://github.com/AskAlice/mandala-3d-threejs live demo: https://askalice.me/mandala/
Here is the relevant code:
js/content.js@112
...ANSWER
Answered 2017-Dec-07 at 13:02That option with THREE.Plane()
and THREE.Raycaster().ray.intersectPlane()
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Mandala-3D
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