procedural mesh from picture

Everything related to 3D programming
User avatar
A.D.
User
User
Posts: 98
Joined: Tue Oct 06, 2009 9:11 pm

procedural mesh from picture

Post by A.D. »

Hi!

i wrote a little procedure that creates a mesh from a picture to create for e.g. objects like you know from minecraft. Well the procedure works
but it generates much too many vertices and i want to optimize it. I achieved to generate in the new version a optimal amount of vertices by
checking the vertexes if the already exist but i don't have an idea how to apply the proper faces to the mesh now. This is what the code looks like:

Code: Select all

Global CamSpeed = 0.6 , CamMode = 0 , RenderMode = 0, FullScreen = 0
Global KeyX, KeyY, RollZ, RotX, RotY, MouseX, MouseY, FPS, VSync = 1

Structure Vertex
  x.f
  y.f
  z.f
EndStructure

Global NewList VertexList.Vertex()
Global Dim Mask.Vertex(8)

Declare InitWorld()
Declare Keyboard()
Declare MakeMeshFromPicture(picture.s, le)
Declare IsVertex(x.f, y.f, z.f)

Procedure InitWorld()
  
InitEngine3D() 
InitSprite()
InitKeyboard()
InitMouse()

Add3DArchive("\", #PB_3DArchive_FileSystem) 
AntialiasingMode(#PB_AntialiasingMode_x6)
;Parse3DScripts()

If Not FullScreen
  OpenWindow(0,0,0,1280,960,"Stryder",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
  OpenWindowedScreen(WindowID(0),0,0,1280,960,0,0,0,VSync) 
 Else
  ExamineDesktops()
  OpenScreen(DesktopWidth(0),DesktopHeight(0),32,"",VSync)
EndIf

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, -30, 30,-40,#PB_Absolute)
RotateCamera(0,-90,0, 180)

CreateLight(0,$FFFFFF,0,30,0,#PB_Light_Point)
;Sun(0,500,0,$FFFFFF)
;SpotLightRange(0,0, 90)
AmbientColor($FFFFFF)

LoadTexture(0,"plane.jpg") 
CreateMaterial(0, TextureID(0))
CreatePlane(0, 20, 20, 10, 10, 10, 10)
CreateEntity(0,MeshID(0), MaterialID(0), 0, 0, 0)

EndProcedure

Procedure Keyboard()
  
ExamineKeyboard()
     
If KeyboardPushed(#PB_Key_A)
  keyx = -1
 ElseIf KeyboardPushed(#PB_Key_D)
   keyx = 1 
 Else
  keyx = 0
EndIf

If KeyboardReleased(#PB_Key_A)
 
ElseIf KeyboardReleased(#PB_Key_D)
 
EndIf

If KeyboardPushed(#PB_Key_W)
  keyy = -1 
ElseIf KeyboardPushed(#PB_Key_S)
  keyy = 1 
Else
  keyy = 0
EndIf

If KeyboardReleased(#PB_Key_PageUp)
  rollz = 1 
ElseIf KeyboardReleased(#PB_Key_PageDown)
 rollz = 0
EndIf

If KeyboardReleased(#PB_Key_Space)
 
EndIf

If KeyboardReleased(#PB_Key_F1)
 
EndIf

If KeyboardReleased(#PB_Key_F2) 
 Rendermode = Rendermode + 1 
 Select Rendermode
   Case 0 : CameraRenderMode(0, #PB_Camera_Textured)
   Case 1 : CameraRenderMode(0, #PB_Camera_Wireframe)
   Case 2 : CameraRenderMode(0, #PB_Camera_Plot)
 EndSelect
 If Rendermode = 2 : Rendermode = -1 : EndIf
EndIf
 
 If KeyboardReleased(#PB_Key_F3)
   ;If CamMode = #True : CamMode = #False : Else : CamMode = #True : EndIf
 EndIf
      
ExamineMouse()
     
rotx = 0 : roty = 0
mousex = -MouseDeltaX()
mousey = -MouseDeltaY()
     
If MouseButton(#PB_MouseButton_Right)
 rotx = mousey
 roty = mousex
 mousex = 0
 mousey = 0
EndIf
     
EndProcedure

Procedure IsVertex(x.f, y.f, z.f)
 
 ForEach VertexList()
  If VertexList()\x = x And VertexList()\y = y And VertexList()\z = z : ProcedureReturn #True : EndIf
 Next
 
 ProcedureReturn #False
 
EndProcedure

Procedure MakeMeshFromPicture(picture.s, le)

Define n,v

UsePNGImageDecoder()
UseJPEGImageDecoder()

Img      = LoadImage(#PB_Any, picture)
Width  = ImageWidth(img)
Height = ImageHeight(img)

Mesh = CreateMesh(#PB_Any);,#PB_Mesh_PointList) 
 l = 1 : tu.f = 1 / Width : tv.f = 1 / Height

StartDrawing(ImageOutput(Img))

For y = 0 To Height-1
For x = 0 To Width-1
Pixel = Point(x,y)
If Pixel <> 0

Mask(1)\x = x*l 
Mask(1)\y = y*l+1
Mask(1)\z = 0
If Not IsVertex(Mask(1)\x, Mask(1)\y, Mask(1)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(1)\x
VertexList()\y = Mask(1)\y
VertexList()\z = Mask(1)\z
MeshVertexPosition(x*l,y*l+1, 0) 
MeshVertexTextureCoordinate(tu*x,tv*y) 
v + 1
EndIf

Mask(2)\x = x*l +1
Mask(2)\y = y*l+1
Mask(2)\z = 0
If Not IsVertex(Mask(2)\x, Mask(2)\y, Mask(2)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(2)\x
VertexList()\y = Mask(2)\y
VertexList()\z = Mask(2)\z
MeshVertexPosition(x*l+1,y*l+1, 0)
MeshVertexTextureCoordinate(tu*x,tv*y)  
v + 1
EndIf

Mask(3)\x = x*l+1
Mask(3)\y = y*l+0
Mask(3)\z = 0
If Not IsVertex(Mask(3)\x, Mask(3)\y, Mask(3)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(3)\x
VertexList()\y = Mask(3)\y
VertexList()\z = Mask(3)\z
MeshVertexPosition(x*l+1,y*l+0, 0) 
MeshVertexTextureCoordinate(tu*x,tv*y)   
v + 1
EndIf

Mask(4)\x = x*l+0
Mask(4)\y = y*l+0
Mask(4)\z = 0
If Not IsVertex(Mask(4)\x, Mask(4)\y, Mask(4)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(4)\x
VertexList()\y = Mask(4)\y
VertexList()\z = Mask(4)\z
MeshVertexPosition(x*l+0,y*l+0, 0) 
MeshVertexTextureCoordinate(tu*x,tv*y)  
v + 1
EndIf

Mask(5)\x = x*l+0
Mask(5)\y = y*l+1
Mask(5)\z = le
If Not IsVertex(Mask(5)\x, Mask(5)\y, Mask(5)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(5)\x
VertexList()\y = Mask(5)\y
VertexList()\z = Mask(5)\z
MeshVertexPosition(x*l+0,y*l+1, le)
MeshVertexTextureCoordinate(tu*x,tv*y)  
v + 1
EndIf

Mask(6)\x = x*l+1
Mask(6)\y = y*l+1
Mask(6)\z = le
If Not IsVertex(Mask(6)\x, Mask(6)\y, Mask(6)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(6)\x
VertexList()\y = Mask(6)\y
VertexList()\z = Mask(6)\z
MeshVertexPosition(x*l+1,y*l+1, le) 
MeshVertexTextureCoordinate(tu*x,tv*y)  
v + 1
EndIf

Mask(7)\x = x*l+1
Mask(7)\y = y*l+0
Mask(7)\z = le
If Not IsVertex(Mask(7)\x, Mask(7)\y, Mask(7)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(7)\x
VertexList()\y = Mask(7)\y
VertexList()\z = Mask(7)\z
MeshVertexPosition(x*l+1,y*l+0, le)
MeshVertexTextureCoordinate(tu*x,tv*y)  
v + 1
EndIf

Mask(8)\x = x*l+0
Mask(8)\y = y*l+0
Mask(8)\z = le
If Not IsVertex(Mask(8)\x, Mask(8)\y, Mask(8)\z)
AddElement(VertexList()) 
VertexList()\x = Mask(8)\x
VertexList()\y = Mask(8)\y
VertexList()\z = Mask(8)\z
MeshVertexPosition(x*l+0,y*l+0, le)
MeshVertexTextureCoordinate(tu*x,tv*y)  
v + 1
EndIf

EndIf
Next x
Next y
StopDrawing()


StartDrawing(ImageOutput(Img))
For y = 0 To Height-1
For x = 0 To Width-1

pixel = Point(x,y)
If pixel <> 0

n = (x+1)*(y+1)
MeshFace(n+0, n+2, n+3);Vorderseite
MeshFace(n+0, n+1, n+2)
MeshFace(n+4, n+5, n+6);Rückseite
MeshFace(n+6, n+7, n+8)
 MeshFace(n+1, n+4, n+5);Oberseite
 MeshFace(n+1, n+0, n+4)
 MeshFace(n+3, n+2, n+7);Unterseite
 MeshFace(n+2, n+6, n+7)
 MeshFace(n+7, n+4, n+0);vorne
 MeshFace(n+3, n+7, n+0)
 MeshFace(n+1, n+5, n+6);hinten
 MeshFace(n+2, n+1, n+6)
EndIf

Next x
Next y

; MeshFace(n+0, n+2, n+3);Vorderseite
; MeshFace(n+0, n+1, n+2)
; MeshFace(n+7, n+6, n+4);Rückseite
; MeshFace(n+4, n+6, n+5)
; MeshFace(n+1, n+4, n+5);Oberseite
; MeshFace(n+1, n+0, n+4)
; MeshFace(n+3, n+2, n+7);Unterseite
; MeshFace(n+2, n+6, n+7)
; MeshFace(n+7, n+4, n+0);vorne
; MeshFace(n+3, n+7, n+0)
; MeshFace(n+1, n+5, n+6);hinten
; MeshFace(n+2, n+1, n+6)

StopDrawing()
 
FinishMesh(1)

Debug MeshVertexCount(mesh)

;TransformMesh(Mesh,(MeshRadius(Mesh)/2)*-1,0,0,1,1,1,180,0,0)
;NormalizeMesh(Mesh)
;Debug MeshVertexCount(mesh)
ProcedureReturn Mesh
    
EndProcedure


InitWorld()

png.s="test.png"
Mesh = MakeMeshFromPicture(png.s,1)
tex = LoadTexture(#PB_Any, png.s)
mat = CreateMaterial(#PB_Any, TextureID(tex))
CreateEntity(1, MeshID(Mesh), MaterialID(mat),0,20,0)
CameraLookAt(0,EntityX(1),EntityY(1),EntityZ(1))

;CameraRenderMode(0, #PB_Camera_Wireframe)
;Debug MeshVertexCount(mesh)


Repeat  
  
 If Not Fullscreen
 Select WaitWindowEvent(1) 
 Case #PB_Event_CloseWindow 
 Quit = #True 
 EndSelect 
 EndIf
 
 Keyboard()
 RotateEntity(1, 0, 1.6, 0, #PB_Relative)
 RotateCamera(0, mousey, mousex, 0,#PB_Relative)
 MoveCamera  (0, keyx*CamSpeed, 0, keyy*CamSpeed)  

 FPS = Engine3DFrameRate(#PB_Engine3D_Current)
 RenderWorld() 
 
 FlipBuffers()
 
Until KeyboardPushed(#PB_Key_Escape) Or Quit = #True
Here are all files including the old procedure which isn't optimized but its working.

https://dl.dropboxusercontent.com/u/791 ... c2Mesh.zip

I hope that somebody has an good idea how to solve this problem. :idea: Making manual meshes means real pain to me :?

Good Night
Repeat
PureBasic
ForEver
User avatar
A.D.
User
User
Posts: 98
Joined: Tue Oct 06, 2009 9:11 pm

Re: procedural mesh from picture

Post by A.D. »

I'm asking myself how 3d modelling programs do calculate the face sides of a mesh. There must be an algorythm for this. Does anybody have a clue?
Repeat
PureBasic
ForEver
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: procedural mesh from picture

Post by applePi »

Hi
the following are not usefull if you want a description of an algorithm which are mathematical by nature, but it is a practical approximate approach
here http://lcni.uoregon.edu/~dow/Projects/B ... _mesh.html a subject "Point cloud to mesh" it seems a very difficult mathematics task he describe "Marching cubes" "Delaunay triangulation" "Marching triangles" "Ball-pivoting" "Poisson Surface Reconstruction" "Moving least-squares (MLS)" methods inside the environment of MeshLab from http://meshlab.sourceforge.net/ . i have applied the instructions blindly to make an approxomate body from 3D mandelbrot set points cloud,
if you want to try look my posts here
Plotting in 3D _ Biomorphs: converting einstein picture to points cloud
http://www.purebasic.fr/english/viewtop ... 59#p402796

now how to connect those points this is the approximate task done by MeshLab : look "models from point clouds" http://www.forums.purebasic.com/english ... 36&t=54708 the 3d mandelbrot set points cloud converted to approximate model which can have physics.
so first convert your picture to points cloud, using the method i have posted in the Plotting in 3D _ Biomorphs, then proceed as the description in the links.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: procedural mesh from picture

Post by Comtois »

I don't know if that's what you try to do, but here's a solution

Code: Select all

Global CamSpeed = 0.6 , CamMode = 0 , RenderMode = 0, FullScreen = 0
Global KeyX, KeyY, RollZ, RotX, RotY, MouseX, MouseY, FPS, VSync = 1

Structure Vertex
  x.f
  y.f
  z.f
EndStructure

Global NewList VertexList.Vertex()
Global Dim Mask.Vertex(8)

Declare InitWorld()
Declare Keyboard()
Declare MakeMeshFromPicture(picture.s, le)
Declare IsVertex(x.f, y.f, z.f)

Procedure InitWorld()
  
  InitEngine3D() 
  InitSprite()
  InitKeyboard()
  InitMouse()
  
  Add3DArchive("\", #PB_3DArchive_FileSystem) 
  AntialiasingMode(#PB_AntialiasingMode_x6)
  ;Parse3DScripts()
  
  If Not FullScreen
    OpenWindow(0,0,0,1280,960,"Stryder",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
    OpenWindowedScreen(WindowID(0),0,0,1280,960,0,0,0,VSync) 
  Else
    ExamineDesktops()
    OpenScreen(DesktopWidth(0),DesktopHeight(0),32,"",VSync)
  EndIf
  
  CreateCamera(0, 0, 0, 100, 100)
  MoveCamera(0, -30, 30,-40,#PB_Absolute)
  RotateCamera(0,-90,0, 180)
  
  ;CreateLight(0,RGB(255, 255, 255),0,30,50)
  ;Sun(0,500,0,$FFFFFF)
  ;SpotLightRange(0,0, 90)
  AmbientColor(RGB(180,180,180))
  
  LoadTexture(0,"plane.jpg") 
  CreateMaterial(0, TextureID(0))
  CreatePlane(0, 20, 20, 10, 10, 10, 10)
  CreateEntity(0,MeshID(0), MaterialID(0), 0, 0, 0)
  
EndProcedure

Procedure Keyboard()
  
  ExamineKeyboard()
  
  If KeyboardPushed(#PB_Key_A)
    keyx = -1
  ElseIf KeyboardPushed(#PB_Key_D)
    keyx = 1 
  Else
    keyx = 0
  EndIf
  
  If KeyboardReleased(#PB_Key_A)
    
  ElseIf KeyboardReleased(#PB_Key_D)
    
  EndIf
  
  If KeyboardPushed(#PB_Key_W)
    keyy = -1 
  ElseIf KeyboardPushed(#PB_Key_S)
    keyy = 1 
  Else
    keyy = 0
  EndIf
  
  If KeyboardReleased(#PB_Key_PageUp)
    rollz = 1 
  ElseIf KeyboardReleased(#PB_Key_PageDown)
    rollz = 0
  EndIf
  
  If KeyboardReleased(#PB_Key_Space)
    
  EndIf
  
  If KeyboardReleased(#PB_Key_F1)
    
  EndIf
  
  If KeyboardReleased(#PB_Key_F2) 
    Rendermode = Rendermode + 1 
    Select Rendermode
      Case 0 : CameraRenderMode(0, #PB_Camera_Textured)
      Case 1 : CameraRenderMode(0, #PB_Camera_Wireframe)
      Case 2 : CameraRenderMode(0, #PB_Camera_Plot)
    EndSelect
    If Rendermode = 2 : Rendermode = -1 : EndIf
  EndIf
  
  If KeyboardReleased(#PB_Key_F3)
    ;If CamMode = #True : CamMode = #False : Else : CamMode = #True : EndIf
  EndIf
  
  ExamineMouse()
  
  rotx = 0 : roty = 0
  mousex = -MouseDeltaX() * 0.5
  mousey = -MouseDeltaY() * 0.5
  
  If MouseButton(#PB_MouseButton_Right)
    rotx = mousey
    roty = mousex
    mousex = 0
    mousey = 0
  EndIf
  
EndProcedure

Procedure IsVertex(x.f, y.f, z.f)
  
  ForEach VertexList()
    If VertexList()\x = x And VertexList()\y = y And VertexList()\z = z : ProcedureReturn #True : EndIf
  Next
  
  ProcedureReturn #False
  
EndProcedure

Procedure Add(x, z, u.f, v.f, cl, cr, cu, cd)
  Protected.f size = 2
  Static offset = 0
  MeshVertexPosition(size* (x - 1/2), size/2, size* (z - 1/2))
  MeshVertexNormal(0, 1, 0)
  MeshVertexTextureCoordinate(u, v)
  MeshVertexPosition(size* (x + 1/2), size/2, size* (z - 1/2)) 
  MeshVertexNormal(0, 1, 0)
  MeshVertexTextureCoordinate(u, v)  
  MeshVertexPosition(size* (x + 1/2), size/2, size* (z + 1/2)) 
  MeshVertexNormal(0, 1, 0)
  MeshVertexTextureCoordinate(u, v)  
  MeshVertexPosition(size* (x - 1/2), size/2, size* (z + 1/2)) 
  MeshVertexNormal(0, 1, 0)
  MeshVertexTextureCoordinate(u, v)  
  MeshFace(offset+1, offset, offset + 3)
  MeshFace(offset+3, offset + 2, offset + 1)
  offset + 4
  MeshVertexPosition(size* (x - 1/2), -size/2, size* (z - 1/2))
  MeshVertexNormal(0, -1, 0)
  MeshVertexTextureCoordinate(u, v)   
  MeshVertexPosition(size* (x + 1/2), -size/2, size* (z - 1/2)) 
  MeshVertexNormal(0, -1, 0)
  MeshVertexTextureCoordinate(u, v)   
  MeshVertexPosition(size* (x + 1/2), -size/2, size* (z + 1/2)) 
  MeshVertexNormal(0, -1, 0)
  MeshVertexTextureCoordinate(u, v) 
  MeshVertexPosition(size* (x - 1/2), -size/2, size* (z + 1/2)) 
  MeshVertexNormal(0, -1, 0)
  MeshVertexTextureCoordinate(u, v) 
  MeshFace(offset, offset+1, offset + 3)
  MeshFace(offset+1, offset + 2, offset + 3)
  offset + 4  
  If cl ; Close left
    ofl = offset-8
    MeshFace(ofl+3, ofl, ofl + 4)
    MeshFace(ofl+3,ofl+4, ofl+7)
  EndIf
  If cr ; Close right
    ofr = offset-8
    MeshFace(ofr+2, ofr+1, ofr + 5)
    MeshFace(ofr+2,ofr+5, ofr+6)
  EndIf  
  If cu ; Close up
    ofu = offset-8
    MeshFace(ofu, ofu+1, ofu+4)
    MeshFace(ofu+5,ofu+4, ofu+1)
  EndIf
  If cd ; Close down
    ofd = offset-8
    MeshFace(ofd+2, ofd+3, ofd + 7)
    MeshFace(ofd+2,ofd+7, ofd+6)
  EndIf   
EndProcedure

Procedure MakeMeshFromPicture(picture.s, le)
  
  Define n,v
  
  UsePNGImageDecoder()
  UseJPEGImageDecoder()
  
  Img    = LoadImage(#PB_Any, picture)
  Width  = ImageWidth(img)
  Height = ImageHeight(img)
  
  Mesh = CreateMesh(#PB_Any) 
  l = 1 : tu.f = 1 / Width : tv.f = 1 / Height
  
  StartDrawing(ImageOutput(Img))
  
  For y = 0 To Height-1
    
    
    For x = 0 To Width-1
      cl = 0
      cr = 0
      cu = 0
      cd = 0
      pixel_L = -1
      pixel_R = -1
      pixel_U = -1
      pixel_D = -1
      Pixel = Point(x,y)
      If x > 0
        pixel_L = Point(x-1,y)
      EndIf
      If x < Width-1
        pixel_R = Point(x+1,y)
      EndIf
      If y > 0
        pixel_U = Point(x,y-1)
      EndIf
      If y < Height-1
        pixel_D = Point(x,y+1)
      EndIf      
      
      If Pixel <> 0
        If x = 0 Or pixel_L = 0
          cl=1 ; close left
        EndIf
        If x = Width-1 Or pixel_R = 0
          cr=1 ; close right
        EndIf 
        If y = 0 Or pixel_Y = 0
          cu=1 ; close up
        EndIf
        If y = Height-1 Or pixel_D = 0
          cd=1 ; close down
        EndIf         
        Add(x, y, x/Width, y/Height, cl, cr, cu, cd) 
      EndIf
    Next
  Next    
  StopDrawing()
  
  FinishMesh(1)
  UpdateMeshBoundingBox(0)
  
  Debug MeshVertexCount(mesh)
  
  
  ProcedureReturn Mesh
  
EndProcedure


InitWorld()

png.s="a.png"
Mesh = MakeMeshFromPicture(png.s,1)
tex = LoadTexture(#PB_Any, png.s)
; tex = CreateTexture(#PB_Any, 256, 256)
; StartDrawing(TextureOutput(tex))
; Box(0,0, 256, 256, RGB(255, 255, 255))
; StopDrawing()

mat = CreateMaterial(#PB_Any, TextureID(tex))
MaterialCullingMode(mat, #PB_Material_NoCulling)
SetMaterialColor(mat, #PB_Material_SelfIlluminationColor, RGB(255, 255, 255))
CreateEntity(1, MeshID(Mesh), MaterialID(mat),0,1,0)
CameraLookAt(0,EntityX(1),EntityY(1),EntityZ(1))

;CameraRenderMode(0, #PB_Camera_Wireframe)
;Debug MeshVertexCount(mesh)


Repeat  
  
  If Not Fullscreen
    Select WaitWindowEvent(1) 
      Case #PB_Event_CloseWindow 
        Quit = #True 
    EndSelect 
  EndIf
  
  Keyboard()
  ;RotateEntity(1, 0, 1.6, 0, #PB_Relative)
  RotateCamera(0, mousey, mousex, 0,#PB_Relative)
  MoveCamera  (0, keyx*CamSpeed, 0, keyy*CamSpeed)  
  RotateEntity(1, 0.5, 0.5, 0.5, #PB_Relative)
  FPS = Engine3DFrameRate(#PB_Engine3D_Current)
  RenderWorld() 
  
  FlipBuffers()
  
Until KeyboardPushed(#PB_Key_Escape) Or Quit = #True
Please correct my english
http://purebasic.developpez.com/
User avatar
A.D.
User
User
Posts: 98
Joined: Tue Oct 06, 2009 9:11 pm

Re: procedural mesh from picture

Post by A.D. »

Thank you both for the answers. Mesh generation is very interesting and complex too. Thanks, Comtois, for your code. I compared it with a optimized procedure i made month ago.
They generate nearly the same number of vertices but in mine there were some faces still not set up correctly, so thank you that i don't have to look up for them anymore.
Another problem is when using the picture as texture: not all triangles are textured well when sharing a specific vertex. The meshes would need more than one
uv coordinate per vertex. I know there's a thread somewhere in the pureboard about it, i don't know where anymore. Using vertex colors instead could be a solution for this
problem or use more uv coordinates for each vertex.

Greets
A.D:
Repeat
PureBasic
ForEver
Post Reply