Quote: "I can't use seemless textures either, I need one big texture"
The real tree bark, looks somewhat repetitive, so we could use seamless textures. You could use triangle, they are esy to manage, but the most hart, is adjust all UV of all triangles. I'v got my own formula especially when we join many triangles
@JackDawson @Pincho Paxton
Here's my piece of code although I need the function for the union of branches...I'm on it.
rem LOAD A SEAMLESS TEXTURE.
autocam off
sync on
set display mode 1024,768,32
load image "tronco3.jpg",1
ink rgb(100,50,50),0
box 0,0,20,20
get image 2,0,0,20,20,1
`making 64 objects to handle a mesh plain with 64 vertex
for i= 1 to 32
make object box i,0.2,0.2,.2
yrotate object i,i*11.615
move object i,10
clone object i+32,i
move object up i+32,50
move object i+32,-2
next i
`main mesh guide
make object plain 100,10,10,31,1
texture object 100,1
set object cull 100,0:set light mapping on 100,2
lock vertexdata for limb 100,0
for i= 1 to 64
x# = object position x(i)
y# = object position y(i)
z# = object position z(i)
set vertexdata position i-1,x#,y#,z#
next
unlock vertexdata
`controling up/down object to place the ring of objects to handle the mesh
make object box 1000,0.2,50,0.2:color object 1000,rgb(255,0,0)
position object 1000,0,80,0
position camera 0,220,-230
point camera 0,0,0
t#=0
`diameter reference
for i= 1 to 32
make object box i+3000,1,0.2,0.2
set object emissive i+3000,rgb(255,0,0)
next i
diamet#=6 `starting diameter
do
`red ring of reference
for i= 1 to 32
position object i+3000,object position x(1000),object position y(1000),object position z(1000)
yrotate object i+3000,i*11.615
zrotate object i+3000,u#
move object i+3000,diamet#
next i
zrotate object 1000,u# `object direction
set cursor 0,0
ink rgb(255,255,255),0
print "H HELP"
if inkey$()="h" or inkey$()="H" then gosub helpp
if spacekey() then gosub trozz:sleep 800
`camera movements
control camera using arrowkeys 0,0.3,0.3
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
if leftkey() then move camera left 0.1
if rightkey() then move camera right 0.1
`ring movements
if inkey$()="w" then move object up 1000,0.02 :diamet#=diamet#-0.001 `as we go up, the trunk will be thiner
if inkey$()="s" then move object down 1000,0.02
if inkey$()="a" then move object left 1000,0.02
if inkey$()="d" then move object right 1000,0.02
if inkey$()="v" then diamet#=diamet#-0.01 `modifying diameter
if inkey$()="b" then diamet#=diamet#+0.01
if inkey$()="u" then u#=u#+0.1 `turning ring left
if inkey$()="i" then u#=u#-0.1 `turning ring right
`saving tree trunk
if controlkey()
s=s+1
if s=2
make object box 600,0,0,0 `object pivot for the tree
make mesh from object t+1,100 `making a mesh from guide object
t=t+1
`adding all meshes to object to export .dbo
for i= 1 to t
add limb 600,i,i
next i
texture object 600,1
save object "trunk.dbo",600:sleep 1000
s=0
endif
endif
`seting wireframe on/off for all objects
if mouseclick()
run=run+1
if run=2 then v=v+1
if v=2 then v=0
else
run=0
endif
for i= 1 to 2000
if object exist(i)
if v=1
set object wireframe i,1
else
set object wireframe i,0
endif
endif
next i
sync
loop
trozz:
`every time we enter to the lavel, we add a new ring to the tree trunk
t=t+1
`the ring has 64 vertex, 32 uper edge and 32 down edge. We place them to keep a round mesh
for i= 1 to 32
position object i,object position x(i+32),object position y(i+32),object position z(i+32)
position object i+32,object position x(1000),object position y(1000),object position z(1000)
zrotate object i+32,u#
move object i+32,diamet# `udjusting diameter
next i
make mesh from object t,100 `making mesh of every portion as reference and for final object
make object 1000+t,t,1
scale object texture 1000+t,1,object size y(1000+t,1)/100 `scaling texture deppending on ring length
lock vertexdata for limb 100,0
for i= 1 to 64
x# = object position x(i)
y# = object position y(i)
z# = object position z(i)
set vertexdata position i-1,x#,y#,z#
next
unlock vertexdata
return
`help coments
helpp:
ink rgb(80,80,80),0
box 200,200,824,400
ink rgb(255,255,0),0
set cursor 205,205
ink rgb(255,0,0),0
print "SCALE AND MOVE RING TO CORRECT PLACE BEFORE PRESSING SPACEKEY "
ink rgb(255,255,0),0
set cursor 205,221
print "USE ARROWKEY TO MOVE CAMERA"
set cursor 205,237
print "USE A S D W TO PLACE RING"
set cursor 205,254
print "USE V, B TO SCALE RING "
set cursor 205,270
print "USE U, I TO TURN RING "
set cursor 205,286
print "MOUSECLICK SET WIREFRAME ON/OFF"
set cursor 205,302
print "SPACEKEY CREATE TRUNCK PORTION"
set cursor 205,318
print "CONTROLKEY SAVE OBJECT TO <TRUNK.DBO> OBJECT MUST NOT EXIST "return
Cheers.
I'm not a grumpy grandpa
