Lights for car headlight

Hi all. Which lights work best for a car headlights I have created a basic scene where a truck travels on a road… i am struggling in creating lights for headlights… I have tried recArealights … Pointlight and spotlight

Pointlight and spotlight fail… because they don’t point to the new target you set instead they end up pointing to the origin. so you end up with lights pointing in the correct direction before the origin and pointing backwards after the origin

1 Like

This is a problem in your code since you can change the target for SpotLight. Check out In any event, using an instance of SpotLight seems the right approach. Ideal for stuff like headlights or flashlights.

BTW: A PointLight is omnidirectional and has no target.


A spotlight basic example in the collection: there Spotlight

see target at line 42


Made it now just for fun :slight_smile:


Using is a bit hard… But if you attach the light target to the car as a sibling to the light, the light will point at the local position, following the motion of the car.

I did it in (Be careful with cloning SpotLight, though! (even though I do it in that example))

1 Like

That is a nice collection! :+1: Almost all of them seem to work too. I only miss a reference to the original context/question where each example is posted. I think that would be useful.

1 Like

To read there Collection of examples from :

You can try them out immediately and use Ctrl U to view the code.
The source code contains the links and the author.

In addition, extended examples ar aviable.

For example:

line 2: Direction of the SpotLightHelper
line 3:


The effort for this collection must be kept within limits for me, therefore the simple sequential arrangement. :slightly_smiling_face:


Combined with this

Addon to create special / extended geometries - #6 by hofk

that makes a great race! :red_car: :taxi: :police_car: :blue_car:

OK. Then I think that should be stated on the page too. :+1:

On the selection page per year it also says.

As you can see in the index file, I only copy one schema there.


As I wrote, I must absolutely minimize the effort for me. There is still enough work to view all contributions and copy the examples.
That’s why there are some basic examples in the extended ones as well. Copying it was too complex for me for various reasons.
Extended ones are only links. Whether they will work forever is open.

With the copies of the basic examples are perhaps only some resources later no longer available.
I only copy HTML, CSS and JS, replace important external scripts like three.js OrbitControls … by the ones on my server with the appropriate version (which is static then!) and paste

// @author … in the main script.

Enough work.


The example page itself is usually not changed in the layout. Who only looks at it does not need a source, who has interest looks into the source text and finds all information.

Because my English is so weak:
Translated with

1 Like

No worries. I understand that your time is valuable, and that I cannot dictate how you should spend it. I appreciate the collection of the examples, and now also see that you have provided references to the original context, although “hidden” in the sources.