Hello! i'm working on a 3rd person perspectiv game and I just want to add some nice graphical details but I need some help.
My 3D terrain is made of an bmp file
Code:
make object terrain 1 ` create the terrain object
set terrain heightmap 1, "C:\Lost Island\Textures\map.bmp" ` set the heightmap
set terrain scale 1, 12, 0.5, 12 ` set the scale
set terrain split 1, 4 ` split value by 16 * 16
set terrain tiling 1, 4 ` detail map tiling
set terrain light 1, 1, -0.25, 0, 1, 1, 0.75, 0.5 ` light - xdir, ydir, zdir, red, green, blue, intensity
set terrain texture 1, 1, 2 ` base and detail texture
build terrain 1 ` finally build the terrain
I want to add some nice grass to it

.
Here's the grass code:
hide mouse
sync on: sync rate 0
autocam on
`rem camera properties
set camera range 1,3000000
set ambient light 100
`make matrx and texture it
make matrix 1,5000,5000,20,20
load image "grass1.jpg",1
prepare matrix texture 1,1,1,1
`set global variable
global grassmade
`Beggining of loop
do
`print screen fps()
set cursor 1,1
print screen fps()
`do function
makegrass(0,0,0,5000,5000,200,160,3000)
`Control Camera
if upkey()=1 then cx#=newxvalue(cx#,a#,30):cz#=newzvalue(cz#,a#,30)
if leftkey()=1 then a#=wrapvalue(a#-1)
if rightkey()=1 then a#=wrapvalue(a#+1)
position camera cx#,cy#+200,cz#
yrotate camera a#
`syncronization
sync
`End of loop
loop
`function make grass
function makegrass(x#,y#,z#,sectionwidth#,sectionlength#,grasswidth#,grassheight#,amount)
if grassmade=0
make object plain 10000,grasswidth#,grassheight#
load image "grass.png",2
texture object 10000,2
set object transparency 10000,4
position object 10000,x#+rnd(sectionwidth#),y#+(grassheight#/2),z#+rnd(sectionlength#)
yrotate object 10000,rnd(360)
for t=10001 to amount+10001
instance object t,10000
yrotate object t,rnd(360)
position object t,x#+rnd(sectionwidth#),y#+(grassheight#/2),z#+rnd(sectionlength#)
grassmade=1
next t
endif
endfunction
It seems like that code only works on a matrix and if I add it to the terrain they are gigantic and doesn't follow the ground as I want it to. Is there some way I can fix that or should I use another grass code? Please help me!
-BlackRetroBox-
-Square eyes is the only thing