#Arch / Wave effect using sin

1 messages ยท Page 1 of 1 (latest)

tribal zephyr
#

Hey, so I'm gonna try using sin to see what's possible

sand nova
#

ok look this

#

this is the sin function

tribal zephyr
#

Oh right, yeah that's the sort of effect I want

#

Is it worth me learning more about the Math class?

sand nova
#

idk

#

I am in a similar position than you

tribal zephyr
sand nova
#

try using that function @tribal zephyr

#

experiment a bit with it and try understanding it

tribal zephyr
#

I mean that's with the sin function

sand nova
#

you can also do stuff like this

#

to change the degree of the slope

sand nova
#

:p

tribal zephyr
#

I wish finnbon was on, they know everything ๐Ÿ˜›

sand nova
#

lol

#

why the A B C and D?

#

what do they do

tribal zephyr
#

Looks like I want y = sin(1 x 0.5) but I gotta somehow put that into maths

sand nova
#

so for example

#

you say

#

I want to draw a wave from x = 0 to x = 10

#

you do a for loop

#
for (int x = 0; x <= 10; x++) {
  y = sin(x * 0,5)
  // set block at x, y with those values
}
#

@vital mauve how could you make so it starts the wave at one point and it ends at another instead of having it continuing?

tribal zephyr
#

Ok I got some progress

sand nova
#

show it

tribal zephyr
sand nova
#

yep

tribal zephyr
sand nova
#

you only want so they go up?

tribal zephyr
#

yeah

tribal zephyr
#

Oh yeah my bad ๐Ÿคฆโ€โ™‚๏ธ

#

new blocks?

sand nova
#

let me search the name

#

I haven't experimented with them

tribal zephyr
#

They use a pack to do that I know that for sure

#

I just remembered how they do it btw, they use trapdoors

sand nova
#

idk the blocks name

#

you could also use floating blocks without gravity

tribal zephyr
sand nova
#

but that's just a stair

tribal zephyr
#

They use trap doors I'm pretty sure

sand nova
#

search for floating blocks

tribal zephyr
#

I mean spawning a bunch of floating blocks with cause performance issues no?

strong fiber
#

not that much

tribal zephyr
strong fiber
#

sth like this?

#
for (int x = 0; x <= 10; x++) {
            double y = Math.sin(x * 0.5);
            Location loc = new Location(world,x,y,z);
            BlockDisplay bd = (BlockDisplay) world.spawnEntity(loc, EntityType.BLOCK_DISPLAY);
            bd.setBlock(Bukkit.createBlockData(Material.STONE));
        }
#

@tribal zephyr

tribal zephyr
#

What's a BlockDisplay ๐Ÿค”

strong fiber
#

new feature in 1.19.4 that allows block and item displays

#

they can change size, rotation and so on

tribal zephyr
#

size ๐Ÿค”

#

this ain't gonna end well, lol

strong fiber
#

u need to modify the block they displaying

tribal zephyr
#

I tried that and it caused a lot of performance issues