Curve on surface using P5.js - p5.js

I'm learning how to plot a sphere and other geometries like a torus using P5.js and was wondering if is possible to draw curves on these surfaces and how to do it. If someone could help me I would be glad.
Honestly I'm such a begineer that I don't even know how to start.

Related

Drag an object along a bezier curve using ThreeJs

Using threesJs. I'm trying to move an object along a bezier curve (idealy beziercurve3).
My purpose is to move a little point by mouse and then after use this point to cut this curve in two,
or start an other curve3 attached to this point.
From what I search before I suppose I should use something like clamp_to_curve function.
I saw that Line3 got closestPointTPoint Is it a good idea to do the same with a bezier curve?
Maybe getPoint and getPointAt from curve can help but I don't know how to use them. After searching for a while I fill a little bite lost.
What is the best way to start this ?

How to render reflections of emissive material of another object in react-three-fiber?

My scene is pretty simple. I have a (Ground) Plane and a sphere on top of it. I am setting an emissive material to the sphere. Now, I want reflection of the emitted light by the sphere on the plane.
Looks like that is not possible in a straight-forward way. (I totally wish THREE.js was like Maya or Blender). And from what I have looked around, point lights were suggested. But I am having a gradient emission map. So a point light will not satisfy my needs here.
Some other answers have suggested something on the lines of capturing the scene by a reflection surface and other have pointed me to cube camera rendering....I do not totally understand what they mean - am quite new to THREE.js and this low a level of graphics. Especially this answer to a beginner like me looks daunting (I am just starting to mess with shaders). Emissive ligth and reflection in Three.js
If anyone can explain the method or provide resources where I can learn about them, I would be grateful.

Clipping Geometry with a Plane in Three.js

I'm hoping to do simple collision detection with a Geometry/BufferGeometry against some planes and I was wondering if Three.js contains a way to return only the part of a BufferGeometry that's on one side of a Plane, as another BufferGeometry?
I know that you can use Three.js to clip meshes with Planes when rendering, however I can't spot a way to do the clipping outside of the GPU.
I know CSG.js could be used, but this seems overly heavyweight for what I need.

Light 2D and Performance issues

I want to make a 2D game that will use 2 kinds of lights (Spotlight and Point Light). I need the game to be completly dark unless there is a light in the area and the light to not pass through walls. I tried lots of stuff and plugins to try and make this possible but nothing worked for me.
So I thought I would try to add 3D walls with an Orthographic camera so that I would have the light stop at the walls and cast shadows and make it look 2D at the same time. (Top-down View)
My questions are:
Is there a better way to do this without needing the 3D stuff?
I believe that I will probably have some performance issues if I keep the 3D stuff. Is there a way to fix that since the final output from the orthographic camera is 2D? Like maybe an option to render it as 2D and not having the game process all those triangles? (I want it as light as possible because I also want to port on phones)

Creating arbitrary concave shapes in XNA/WP7 using sprites/polygons?

What's the best way to draw arbitrary textured shapes in WP7/XNA? I'm thinking I'm going to have to use polygons in orthographic projection but if there is a method to do this using textures I would much prefer that.
The best way is with textured polygons in an orthographic projection :)
You could pre-compute textures for sprites in the shapes you want - but that has its own problems. The first two I can think of are: 1) having to implement it! and 2) burning through a whole lot of texture-fetch, fill-rate and texture memory to draw a lot of blank space.

Resources