https://www.youtube.com/watch?v=iL4IN-DxXyI&feature=youtu.be
Please watch the video ^^
Ok, I'm currently working on a 3D model creator and I've come across something strange. In the example I've textured a limb, then I rotated that limb. All of the new limb rotation data is being stored to an array. Then when I go to scale the limb texture the mesh of the limb gets changed to one of the same primitive shape, then it gets resized and rotated using data from the arrays. Then the new scaled limb texture is applied over the top of the new limb mesh. But as you can see in the video, the shape of the limb is no longer that of a primitive shape, the vertices are also changing. I have no code in my program to alter vertices.
I don't know if this is a bug or I have accidentally coded something way beyond my knowledge of programming. Maybe it's taking on a life of its own?
The code for this particular feature is here:
rem scale limb texture
texscaleX=gettrackbarposition(scalebarx)
texscaleY=gettrackbarposition(scalebary)
if texscaleX<>oldtexscaleX
//change limb mesh to new one
scale object selectedlimb*100,100,100,100
make mesh from object 1,selectedlimb*100
change mesh 2,selectedlimb,1
scale object selectedlimb*100,limbscale#(selectedlimb,1),limbscale#(selectedlimb,1,1),limbscale#(selectedlimb,1,1,1)
texture limb 2,selectedlimb,texture //texture limb
oldtexscaleX=texscaleX
scale limb texture 2,selectedlimb,texscaleX,texscaleY
texscale(selectedlimb,1)=texscaleX
texscale(selectedlimb,1,1)=texscaleY
setgadget preview,200,430,200,200
paintgadget preview
endif
if texscaleY<>oldtexscaleY
//delete limb and create exact copy
scale object selectedlimb*100,100,100,100
make mesh from object 1,selectedlimb*100
change mesh 2,selectedlimb,1
scale object selectedlimb*100,limbscale#(selectedlimb,1),limbscale#(selectedlimb,1,1),limbscale#(selectedlimb,1,1,1)
texture limb 2,selectedlimb,texture //texture limb
oldtexscaleY=texscaleY
scale limb texture 2,selectedlimb,texscaleX,texscaleY
texscale(selectedlimb,1)=texscaleX
texscale(selectedlimb,1,1)=texscaleY
setgadget preview,200,430,200,200
paintgadget preview
endif
EDIT:
I've managed to fix this by adding this to the above code.
rotate object selectedlimb*100,0,0,0
(then change mesh)
rotate limb 2,selectedlimb,limbrotate(selectedlimb,1),limbrotate(selectedlimb,1,1),limbrotate(selectedlimb,1,1,1)
rotate object selectedlimb*100,limbrotate(selectedlimb,1),limbrotate(selectedlimb,1,1),limbrotate(selectedlimb,1,1,1)
www.liambradburymusic.com - professional music for your games.