weirdly if I add smooth to the object within blender , under tools/shading,with all faces intact, the lines disappear, without smooth, or in other words choosing flat,they reappear, would never have guessed that 1, I added it accidently, the code is back to its normal self using cloning of objects:
// Project: Crafter
// Created: 2018-03-27
// set display properties
//#include ".\..\Templates\ShaderPack\Includes\ShaderPack.agc"
#include "keys.agc"
// Show all errors
SetErrorMode(2)
SetWindowSize( 1024, 768, 1 )
// Set some display properties
SetVirtualResolution( 1024, 768 )
SetClearColor( 101, 120, 154 )
SetScissor( 0,0,0,0 )
//SetGenerateMipmaps( 1 )
//SetResolutionMode(1)
//SetImmersiveMode(1)
SetCameraRange( 1, 0.1, 2000 )
SetWindowAllowResize( 1 )
UseNewDefaultFonts( 1 )
SetPrintSize( 20 )
SetPrintColor( 255,0,0 )
setsunactive(1)
SetSkyBoxVisible(1)
//shadowMode = 3 // start with cascade shadow mapping which gives the best quality
//SetShadowMappingMode( shadowMode )
//SetShadowSmoothing( 2 ) // random sampling
//SetShadowMapSize( 512, 512)
//SetShadowRange( -1 ) // use the full camera range
//SetShadowBias( 0.0012 ) // offset shadows slightly to avoid shadow artifacts
// show the sun, not necessary but improves the experience
#constant maxobjects=5000
dx# = -0.3714
dy# = -0.7428
dz# = 0.5571
//SetSunDirection( dx#, dy#, dz# )
//SetAmbientColor( 30,30,30 )
type Tobjects
x as integer
y as integer
z as integer
i as integer
id as integer
sx as integer
sy as integer
sz as integer
shadow as integer
clone as integer
rotx as integer
roty as integer
rotz as integer
group as integer
pb as integer
ps as integer
endtype
dim object[maxobjects] as Tobjects
global sx=60
global sy=60
global sz=60
global scx#=1
global scy#=1
global scz#=1
global cx=0
global cy=0
global cz=0
global CameraDistance#=-100
global cursor=6000
global shadowtype=1
global offset=0
global smooth#=0.01
global wall=1
global level=1
global gametype=0
global objectcounter=0
global currenttexture=12
global clone=1
global rotx=0
global roty=0
global rotz=0
global groupeditbox=1
global rxeditbox=2
global ryeditbox=3
global rzeditbox=4
global pbeditbox=5
global pseditbox=6
global basex#=1
global basey#=10
global xgap#=110
global ygap#=30
global group=0
global pb=1
global ps=2
load_images()
init()
repeat
FrameTime#=GetFrameTime()
//Print( ScreenFPS() )
if GetPointerPressed()=1
PointerStartX#=GetPointerX()
PointerStartY#=GetPointerY()
endif
if GetPointerState()=1
PointerX#=GetPointerX()
PointerY#=GetPointerY()
//calculate the distance the pointer traveled while pressing
PointerDistX#=PointerX#-PointerStartX#
PointerDistY#=PointerY#-PointerStartY#
// here we calculate if we swipe vertically or horizontally
if abs(PointerDistX#)>abs(PointerDistY#)
// change the camera angle in dependence of the frametime
CameraAngleY#=CameraAngleY#-PointerDistX#*1.5*FrameTime#
else
// change the camera distance in dependence of the frametime
CameraDistance#=CameraDistance#-PointerDistY#*1.1*FrameTime#
endif
endif
Sin#=sin(CameraAngleY#)
Cos#=cos(CameraAngleY#)
// calculate the camera position, with curvevalue for the smooth movement
CameraX#=curvevalue(sin(CameraAngleY#),CameraX#,3)
CameraZ#=curvevalue(cos(CameraAngleY#),CameraZ#,3)
control()
if GetRawKeyPressed( key_q )
quit=1
endif
SetObjectPosition(cursor,cx,cy,cz)
setcameraposition(1,cx+CameraDistance#*0.6*CameraX#,cy-CameraDistance#-offset*20,cz-CameraDistance#*0.6*CameraZ#)
SetCameraLookAt(1,cx,cy,cz,0)
Print( ScreenFPS() )
Print( Str(objectcounter) )
Sync()
until quit
function init()
create_my_editbox(groupeditbox,basex#+xgap#,basey#,2,255,0,0,0,40,20,255,str(group))
create_my_editbox(rxeditbox,basex#+xgap#,basey#+ygap#,2,255,0,0,0,40,20,255,"0")
create_my_editbox(ryeditbox,basex#+xgap#,basey#+ygap#*2,2,255,0,0,0,40,20,255,"0")
create_my_editbox(rzeditbox,basex#+xgap#,basey#+ygap#*3,2,255,0,0,0,40,20,255,"0")
create_my_text(groupeditbox,basex#,basey#,25,255,0,0,"Group",0)
create_my_text(rxeditbox,basex#,basey#+ygap#,25,255,0,0,"Rotate X",0)
create_my_text(ryeditbox,basex#,basey#+ygap#*2,25,255,0,0,"Rotate Y",0)
create_my_text(rzeditbox,basex#,basey#+ygap#*3,25,255,0,0,"Rotate Z",0)
create_my_editbox(pbeditbox,basex#+xgap#*2.5,basey#,2,255,0,0,0,40,20,255,"1")
create_my_editbox(pseditbox,basex#+xgap#*2.5,basey#+ygap#,2,255,0,0,0,40,20,255,"2")
wall=loadobject("stonewall2.obj")
SetObjectposition(wall,1000000,1000000,1000000)
//cursor=CreateObjectBox(sx,sy,sz)
cursor=cloneobject(wall)
SetObjectScale(cursor,scx#,scy#,scz#)
SetObjectcolor(cursor,200,0,0,255)
//SetObjectImage(cursor,1,0)
SetObjectTransparency(cursor,1)
SetObjectPosition(cursor,cx,cy,cz)
endfunction
function control()
read_boxes()
if GetRawKeyreleased (key_F1)
load_level(level)
endif
if GetRawKeyreleased (key_F2)
save_level(level)
endif
if GetRawKeyreleased (key_c)
clear_level()
endif
if getrawkeystate(KEY_CONTROL)
div=4
else
div=0
endif
if GetRawKeyPressed( key_left)
if div=0
cx=cx-GetObjectSizeMinX(cursor)
else
cx=cx+smooth#
endif
endif
if GetRawKeyPressed( key_right)
if div=0
cx=cx+GetObjectSizeMinX(cursor)
else
cx=cx-smooth#
endif
endif
if GetRawKeyPressed( key_up)
cz=cz+GetObjectSizeMinz(cursor)
endif
if GetRawKeyPressed( key_down)
cz=cz-GetObjectSizeMinz(cursor)
endif
if GetRawKeyPressed( key_a)
cy=cy-GetObjectSizeMiny(cursor)
endif
if GetRawKeyPressed( key_z)
cy=cy+GetObjectSizeMiny(cursor)
endif
if GetRawKeyreleased (key_space)
obj=cloneobject(wall)
//obj=CreateObjectBox(sx,sy,sz)
SetObjectScale(obj,scx#,scy#,scz#)
SetObjectPosition(obj,cx,cy,cz)
SetObjectRotation(obj,rotx,roty,rotz)
//SetObjectImage(obj,currenttexture,0)
SetObjectcolor(obj,200,0,0,255)
//SetObjectNormalMap(obj,11)
select shadowtype
case 1
//SetObjectreceiveShadow(obj,1)
endcase
endselect
inc objectcounter
set_object_value(objectcounter,obj,currenttexture)
sync()
endif
if GetRawKeyPressed( key_r)
if div=0
rotx=rotx+45
else
rotx=rotx-45
endif
if rotx>270
rotx=0
endif
SetObjectRotation(cursor,rotx,roty,rotz)
endif
endfunction
function load_images()
for n=1 to 200
f$=str(n) + ".png"
if getfileexists(f$)
loadimage (n,f$)
//SetImageWrapU(n,1)
//SetImageWrapV(n,1)
endif
next
endfunction
function curvevalue(Destination#,Current#,Smooth#)
Current#=Current#+((Destination#-Current#)/Smooth#)
endfunction Current#
function PI()
endfunction 3.14159265
function set_object_value(index,id,image)
object[index].id=id
object[index].i=image
object[index].clone=clone
object[index].x=cx
object[index].y=cy
object[index].z=cz
object[index].sx=sx
object[index].sy=sy
object[index].sz=sz
object[index].shadow=shadowtype
object[index].rotx=rotx
object[index].roty=roty
object[index].rotz=rotz
object[index].pb=pb
object[index].ps=ps
object[index].group=group
endfunction
function save_level(level)
select gametype
case 0
f$="fps"
endcase
case 1
f$="roller"
endcase
case 2
f$="pool"
endcase
case 3
f$="advent"
endcase
endselect
f$=f$+str(level)
f$=f$+".lev"
if GetFileExists(f$)
deletefile(f$)
endif
myfile=opentowrite(f$)
writeinteger(myfile,objectcounter)
for n=1 to maxobjects
writeinteger(myfile,object[n].x)
writeinteger(myfile,object[n].y)
writeinteger(myfile,object[n].z)
writeinteger(myfile,object[n].sx)
writeinteger(myfile,object[n].sy)
writeinteger(myfile,object[n].sz)
writeinteger(myfile,object[n].id)
writeinteger(myfile,object[n].i)
writeinteger(myfile,object[n].clone)
writeinteger(myfile,object[n].shadow)
writeinteger(myfile,object[n].rotx)
writeinteger(myfile,object[n].roty)
writeinteger(myfile,object[n].rotz)
writeinteger(myfile,object[n].pb)
writeinteger(myfile,object[n].ps)
writeinteger(myfile,object[n].group)
next n
closefile(myfile)
endfunction
function load_level(level)
clear_level()
select gametype
case 0
f$="fps"
endcase
case 1
f$="roller"
endcase
case 2
f$="pool"
endcase
case 3
f$="advent"
endcase
endselect
f$=f$+str(level)
f$=f$+".lev"
if getfileexists(f$)=1
myfile=opentoread(f$)
objectcounter=readinteger(myfile)
for n=1 to maxobjects
object[n].x =readinteger(myfile)
object[n].y =readinteger(myfile)
object[n].z =readinteger(myfile)
object[n].sx=readfloat(myfile)
object[n].sy=readfloat(myfile)
object[n].sz=readfloat(myfile)
object[n].id=readinteger(myfile)
object[n].i=readinteger(myfile)
object[n].clone=readinteger(myfile)
object[n].shadow=readinteger(myfile)
object[n].rotx=readinteger(myfile)
object[n].roty=readinteger(myfile)
object[n].rotz=readinteger(myfile)
object[n].pb=readinteger(myfile)
object[n].ps=readinteger(myfile)
object[n].group=readinteger(myfile)
next n
closefile(myfile)
endif
for n=1 to maxobjects
if object[n].id>0
//select object[n].Clone
//case 0
object[n].id=cloneobject(wall)
//object[n].id=CreateObjectBox(sx,sy,sz)
//SetObjectNormalMap(object[n].id,11)
//endcase
//endselect
//setobjectscale(object[n].id,object[n].sx#,object[n].sy#,object[n].sz#)
setobjectposition(object[n].id,object[n].x,object[n].y,object[n].z)
SetObjectRotation(object[n].id,object[n].rotx,object[n].roty,object[n].rotz)
//setobjectimage(object[n].id,object[n].i,0)
SetObjectcolor(object[n].id,200,0,0,255)
select object[n].shadow
case 1
//SetObjectreceiveShadow(object[n].id,1)
endcase
endselect
endif
next n
endfunction
function clear_level()
for n=1 to maxobjects
if getobjectexists(object[n].ID)
deleteobject(object[n].ID)
object[n].x =0
object[n].y =0
object[n].z=0
object[n].sx=0
object[n].sy=0
object[n].sz =0
object[n].id=0
object[n].i=0
object[n].clone=0
object[n].pb=0
object[n].ps=0
object[n].group=0
endif
next n
objectcounter=0
endfunction
function create_my_text(number,x#,y#,size,r,g,b,mystring$,depth)
createtext(number,mystring$)
settextsize(number,size)
settextcolor(number,r,g,b,255)
SetTextPosition(number,x#,y#)
FixTextToScreen(number,1)
settextdepth(number,depth)
//SetTextFontImage ( number, 2 )
endfunction
function create_my_editbox(number,x#,y#,bordersize#,r,g,b,backcolor,bsizex#,bsizey#,alpha,box$)
createeditbox(number)
SetEditBoxTextSize( number, 20)
SetEditBoxBorderSize(number,bordersize#)
SetEditBoxTextColor(number,r,g,b)
SetEditBoxBorderColor(number,r,g,b,alpha)
SetEditBoxBackgroundColor( number, 0, 0, 0, alpha )
seteditboxsize(number,bsizex#,bsizey#)
SetEditBoxPosition(number,x#,y#)
FixEditBoxToScreen(number,1)
seteditboxdepth(number,0)
SetEditBoxText(number,box$)
endfunction
function read_boxes()
if getrawkeypressed(KEY_ENTER)
repeat
focus=GetCurrentEditBox()
select focus
case groupeditbox
t$=geteditboxtext(groupeditbox)
group=val(t$)
endcase
case rxeditbox
t$=geteditboxtext(rxeditbox)
rotx=val(t$)
setobjectrotation(cursor,rotx,roty,rotz)
endcase
case ryeditbox
t$=geteditboxtext(ryeditbox)
roty=val(t$)
setobjectrotation(cursor,rotx,roty,rotz)
endcase
case rzeditbox
t$=geteditboxtext(rzeditbox)
rotz=val(t$)
setobjectrotation(cursor,rotx,roty,rotz)
endcase
case pseditbox
t$=geteditboxtext(pseditbox)
ps=val(t$)
//setobjectrotation(curs,rx,ry,rz)
endcase
case pbeditbox
t$=geteditboxtext(pbeditbox)
pb=val(t$)
//setobjectrotation(curs,rx,ry,rz)
endcase
endselect
sync()
until GetRawKeyReleased(KEY_ENTER)
endif
endfunction
I attached the model so you can see this..atm it has smoothing, so no lines, but if you import it into blender, make it flat..export--test .. you will see the lines come back
So for me this is a fix,of course you cannot do such actions as smooth object with the built in primitive commands of AppGameKit, so no use for your minecraft. I had a look at that code once btw for the MineCraft..looked very nice. Wouldn't be that hard to change it into using object cloning like I am doing. But of course using an external model like the one attached with smooth. It just needs the UV's fixing now...
Hail to the king, baby!