Posted: 23rd Jul 2022 21:22
Hello. I use CANVAS program for modeling. Darkbasicpro sees textures but AppGameKit doesn't see what to do?
He does not want to apply textures in any way.

+ Code Snippet
// Project: Interceptors 
// Created: 2022-07-23

// show all errors
SetErrorMode(2)

Global GlobalHeight
GlobalHeight=GetMaxDeviceHeight ()
Global GlobalWidth
GlobalWidth=GetMaxDeviceWidth ()

// set window properties
SetWindowTitle( "Interceptors" )

SetWindowSize( GlobalWidth, GlobalHeight, 1 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
 
// set display properties
SetVirtualResolution( GlobalWidth, GlobalHeight ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
 
 loadimage(2,"ufo.png")
 loadobject(2,"ufo01.x")
 setobjectposition(2,0,0,450)
 loadimage (1,"plasma.png")
 
 CreateObjectCylinder( 1,1000,100, 100)
setobjectimage(1,1,0)
 SetObjectCullMode( 1, 0)
 setobjectposition(1,0,0,0)
 setcameraposition(1,0,0,500)
 SetCameraLookAt( 1, 0, 0, 0, 0 )
RotateObjectLocalX( 1, 90 )
SetObjectImage( 2, 2, 1 )
do
    
zxc#=zxc#+0.03
if zxc#>1.0 then zxc#=0.01
SetImageWrapU( 1, 1 )
SetImageWrapV( 1, 1 )
SetObjectImage( 1, 1, 0 )
SetObjectUVScale( 1, 0, 1, 1 )
SetObjectUVOffset(1,0,0,zxc#)

    
    ix= GetDeviceWidth()
    iy= GetDeviceHeight()
 
    print("X: "+str(ix))
    print("Y: "+str(iy))
 
    Print( ScreenFPS() )
    Sync()
loop
Posted: 23rd Jul 2022 23:04
that's such a non-distinct texture but SetObjectImage( 2, 2, 1 ) should be SetObjectImage( 2, 2, 0 ) ?

i moved the camera a bit closer and it's applying the image when setting it to 0 but there may be an issue with the UV mapping?
Posted: 23rd Jul 2022 23:26
The fact is that the plate without texture.
The plate is made in a graphic editor.
So the program does not want to apply the texture to the plate.



I need to try a normal texture.
Posted: 24th Jul 2022 9:09
should upload a obj file or stl most 3d applications will not open or import a.x
Posted: 24th Jul 2022 10:27
The problem is that it accepts a different texture. and ufo.png is not. the plate just turns gray.
Why is it not clear. I'll have to look for another texture.
Posted: 25th Jul 2022 7:48
Soo.. Let me break it down to you real fast. a 3d object has uv data . If u can imagine ur object split in half and spread flat on an image. the parts of the image the object is on will be what is mapped to the object. The object can be unwrapped aka uv mapped to the image in anyway you wish. If u do not have uv data it is possible the object will not be mapped at all in some rare circumstances. There are also normals. if a normal is facing inside the object instead of outside the object the texture will be applied to the inside of the object and all you will see is a gray model. also if you are using setimagetexture(stage0) it does not matter that the file image name is at all. file name has nothing to do with the ability to texture an object. If you want it to automatically load and texture the object using a specific file name im not sure agk will actually do that other then on some fbx objects. It is possible it might work on .x files but i think the file has to be exported a very specific way and the exporter has to be 100% compatible. there is always the option to open the .x file in notepad and change the file name and see if it works. .x files can be manipulated greatly inside of notepad. If u would upload the .x as an obj or mtl id be happy to look at the mtl for you but in the mean times u should try to texture ur object in stage zero. Additionally if u set culling to on and your object disappears ull know ur normals are broken
Posted: 25th Jul 2022 12:58
the model is made in 3DCrafter 10

+ Code Snippet
// Project: Interceptors 
// Created: 2022-07-23

// show all errors
SetErrorMode(2)

Global GlobalHeight
GlobalHeight=GetMaxDeviceHeight ()
Global GlobalWidth
GlobalWidth=GetMaxDeviceWidth ()

// set window properties
SetWindowTitle( "Interceptors" )

SetWindowSize( GlobalWidth, GlobalHeight, 1 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
 
// set display properties
SetVirtualResolution( GlobalWidth, GlobalHeight ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
 
 loadimage(100,"ufo1.png")
 loadobject(2,"ufo.x")
 
 setobjectposition(2,0,0,490)
 loadimage (2,"plasma.png")
 SetObjectLightMode( 2, 0 )
 CreateObjectCylinder( 1,1000,100, 100)
setobjectimage(1,2,0)
 SetObjectCullMode( 1, 0)
 setobjectposition(1,0,0,0)
 setcameraposition(1,0,0,500)
 SetCameraLookAt( 1, 0, 0, 0, 0 )
RotateObjectLocalX( 1, 90 )
SetObjectImage( 2, 100,0 )
 `SetObjectCullMode( 2, 0)

do
 remstart   
zxc#=zxc#+0.03
if zxc#>1.0 then zxc#=0.01
SetImageWrapU( 2, 1 )
SetImageWrapV( 2, 1 )
SetObjectImage( 1, 2, 0 )
SetObjectUVScale( 1, 0, 1, 1 )
SetObjectUVOffset(1,0,0,zxc#)
SetObjectImage( 2, 1,0 )
remend
    ix= GetDeviceWidth()
    iy= GetDeviceHeight()
 
    print("X: "+str(ix))
    print("Y: "+str(iy))
 
    Print( ScreenFPS() )
    Sync()
loop


The object has no map. the object was drawn without textures. what is most interesting in darkbasicpro everything works, but the app game kit does not want to texture.

and the app game kit is buggy.


this is what the model looks like in the editor.


where to send a bug report?
Posted: 26th Jul 2022 5:53
Your models uv map looks like this;


In order for that to map you need to make your texture wrap by add these lines after you load the texture.


+ Code Snippet
SetImageWrapU( 2, 1 )
SetImageWrapV( 2, 1 )
Posted: 26th Jul 2022 9:49
Yes thank you. This is exactly what I found when I dug into the settings of another editor. Already a blender. We'll have to draw all the models in a 3D blender. Now it is clear why all the models were painted in gray.
Thanks for the help.