#Shoot rays as a carpet

1 messages · Page 1 of 1 (latest)

stray zephyr
#

What I mean by this is I have a location, which has a direction, if I shoot out a ray, it goes in front, all fine, what I want is to shoot out multiple rays, each with an offset, as to make a sort of "carpet" with the hit points

#

How would I go about doing that?

fossil swallow
#

u could be inefficient

#

and loop from left to right

#

with a spacer of smth like 0.05

stray zephyr
#

Wait I'll make a paint image

fossil swallow
#

and just

#

shoot them

stray zephyr
#

wait

#

no

#

There

fossil swallow
#

well, just shoot all the rays, all of them just slighty more to the left or right

#

with a slight increase

#

maybe 0.25 or 0.125

stray zephyr
#

Trying to figure out how

#

Haven't done anything like this in months

fossil swallow
#

they prob got a vector for the direction

#

and u learned in math how to work with vectors

stray zephyr
#

Yeah, Location#getDirection

fossil swallow
#

yea

#

and u can prob modify that direction

#

to add a bit more

#

in your desired direction

stray zephyr
#

I could... technically use setYaw and setPitch to make the effect

#

so

fossil swallow
#

yes

#

tho u said u only wanted left to right

stray zephyr
#

left to right is because I couldn't really display it in 3D using paint

#

however I just needed the general idea

#
for(double yaw = minYaw; yaw < maxYaw; yaw += step) {
  for(double pitch = minPitch; pitch < maxPitch; pitch += step) {
      Location loc = start.clone();
      loc.setYaw(log.getYaw() + yaw);
      loc.setPitch(loc.getPitch() + pitch);
  }
}
#

that would work, right?

fossil swallow
#

prob <= maxYaw

stray zephyr
#

ye

#

Thanks

fossil swallow
#

will prob work

#

tho

#

for how many rays j have

#

thw slower it will be

stray zephyr
#

ofc

#

It's meant to mostly be quality over efficiency rn

#

Just want to make a nice effect, not really meant to be used

#

Yeah it works

fossil swallow
#

good

#

could u send a vid?

stray zephyr
#

ye ye

#

Getting it to look like I want it to look

#

then I'll send

#

(Spawning particles rn as a placeholder so you can see the rays)

#

Made it short since windows rec makes huge files

#

those 3 seconds where 4.61MB

fossil swallow
#

cool