Hallo guys !
I don´t want to be tiresome with the topic ,but I had been long time trying to find somethig to help me to do what I,m
trying to explain ,with just
Darkbasic pro program.
As everyone knows, We can apply different textures to an object but so far, I haven`t seen any plug in that permit the modification of the texture...I mean, the ability of fitting the texture to the different sides of anf object.
Two days ago...I posted something to do something like ,but now, I´m showing you a better and funny way to understand how
we could do it and not to hard....
I hope not to be boring and you can enjoy.. cheers
autocam off
sync on
// S A V E F I R S T T H E T E X T U R E -----------------
ink rgb(255,0,0),1
box 0,0,20,20
ink rgb(0,255,0),1
box 20,0,40,20
ink rgb(0,0,255),1
box 40,0,60,20
ink rgb(255,255,0),1
box 0,20,20,40
ink rgb(0,255,255),1
box 20,20,40,40
ink rgb(255,0,255),1
box 40,20,60,40
get image 1,0,0,60,40,1
rem save image "textura.jpg",1
//-------------------------------------------------------------------
ink rgb(255,255,255),1
box 0,0,200,200
ink rgb(0,0,0),1
set cursor 0,180:print "CHAFARI"
get image 50,0,0,200,200
a#=45:cam#=45
x=-120:z=60
load image "textura.jpg",1
//-------------------------------------------------------------------
//Creamos el objeto de referencia
//we create the reference object from where take texture of
make object box 1,350,2,250
texture object 1,1
//creamos nuestro cubo
//we make our cube object
make object box 2,98,98,98
texture object 2,1
do
//movemos nuestro objeto
//object movements
if upkey() then z=z+1:sleep 30
if downkey() then z=z-1:sleep 30
if leftkey() then x=x-1:sleep 30
if rightkey() then x=x+1:sleep 30
position object 2,x,50,z
//rotaciones del objeto
//rotations keys
if inkey$()="a" then tn=tn+90 :sleep 300
if inkey$()="s" then rll=rll+90 :sleep 300
xrotate object 2,tn
zrotate object 2,rll
//tomamos color para la cara inferior de nuestro objeto
//fiting colour to the bottom face
if spacekey() then perform csg difference 2,1:rll=rll+180:sleep 100
set light mapping on 1,50
// manejo de la vista de camara
// All camera moving
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
position camera 0,0,0
move camera -400
//nos aceguramos que podemos ver las caras de nuestro objeto
//we ghost base object on to see botton face of our cube
if cam#>0 and cam#<180 then ghost object off 1 else ghost object on 1
//salvamos nuestro cubo como .dbo (o archivo .x)
//we save our object as .dbo (or x file)
if returnkey() then save object "mybox_uv.dbo",2
ink rgb(255,255,255),1
//AYUDA HELP ------------------------------------------------------
set cursor 5,455:print " H AYUDA ( HELP )"
if inkey$()="H" or inkey$()="h"
set text size 12
ink rgb(255,255,255),1
set cursor 5,5
print "A KEY TURN CUBE IN X AXIS"
set cursor 5,25
print "S KEY TURN CUBE IN Z AXIS"
set cursor 5,45:
print "ARROWKEYS POSITION OUR OBJECT "
set cursor 5,65:
print "SPACEKEY TAKE COLOUR TO THE BOTTON FACE AND ROLL IT UP "
set cursor 5,85:
print "MOUSE CONTROL ALL OVER SCENE TO SEE UNDERNEATH"
set cursor 5,105
print "FINALLY ! RETURKEY SAVE OUR OBJECT < MAKE SURE FILE DOESN´T EXIST >"
SET TEXT SIZE 30
ink rgb(200,100,0),1
TEXT 200,360,"ENJOY IT !! "
set text size 12
ENDIF
sync
loop
oh my god