Posted: 27th Apr 2021 16:57
[s]the game exe shouldve worked atleast without the shortcuts[/s]
edit oops i was reading page one

my favourite is the tractor
Posted: 28th Apr 2021 7:32
I hope this is ok with you but I built an HTML5 version to test.

https://tvault.itch.io/krazygrandprix
Posted: 28th Apr 2021 12:27
Hi there.... I thought about opening a new thread but I think here it fits . I made some thime ago an aplication to make mi lightmaping just coloring vertex and saving to Dbo or mesh .x . I have translated the Dbpro code to Agk and it works more or less but we can not save the model...this code paint vertex on the fly . I have to say, that object .x must be converted first to fvf 338 convert to diffuse. We can do this manually modifing the .x file and adding MeshVerterColors at the end of the file. I know the that this could be a tedious job, but I just did it for the heck of it . I hope you like it .

the brushes colors change with number 1 to 7


Atached whole project

+ Code Snippet
// Project: Intersector 
// Created: 2019-03-10

// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "Intersector" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
SetRawMouseVisible(0)
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 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

loadobject(1,"cardiffuse.x")
setobjectscale(1,3,3,3)
FixObjectPivot(1)


mesh = CreateMemblockFromObjectMesh(1,1)
verts= GetMemblockInt( mesh, 0 )
 for i= 0 to verts-1
	 x#=GetMeshMemblockVertexX(mesh,i)
	 y#=GetMeshMemblockVertexy(mesh,i)
	 z#=GetMeshMemblockVertexz(mesh,i)
	 SetMeshMemblockVertexColor(mesh,i,255,255,255,0) `painting object white at start
 next i
 DeleteMemblock(1)
SetObjectMeshFromMemblock(1,1,mesh)


setcameraposition(1,-70,80,-70)
SetCameraLookAt(1,0,0,0,0)
CreateObjectSphere(2,6,10,10)
setobjectcolor(2,255,0,0,0)

SetRawMousePosition(500,400)

`sky	
createobjectsphere(1200,3000,10,10)
SetObjectColorEmissive(1200,0,0,150)
SetObjectCullMode(1200,0)

SetCameraRange(1,1,5000)
global red=0
global green=0
global blue=0
do
	if ( GetRawKeyState( 27) ) then  end 
	movecameralocalz(1,(GetRawKeyState( 38 )*5)-GetRawKeyState( 40 )*5)
	movecameralocalx(1,(GetRawKeyState( 39 )*5)-GetRawKeyState( 37 )*5)
	setcamerarotation(1,getpointery(),-80+getpointerx(),0)
    `Palette ...this shoud be done better :(
	if GetRawKeyState(49) then setobjectcolor(2,255,0,0,255)
	if GetRawKeyState(50) then setobjectcolor(2,255,255,0,255)
	if GetRawKeyState(51) then setobjectcolor(2,0,255,0,255)
	if GetRawKeyState(52) then setobjectcolor(2,255,0,255,255)	
	if GetRawKeyState(53) then setobjectcolor(2,0,0,255,255)
	if GetRawKeyState(54) then setobjectcolor(2,160,140,0,255)
	if GetRawKeyState(55) then setobjectcolor(2,10,10,10,255)
						
mesh = CreateMemblockFromObjectMesh(1,1)
verts= GetMemblockInt( mesh, 0 )
 for i= 0 to verts-1
	 x#=GetMeshMemblockVertexX(mesh,i)
	 y#=GetMeshMemblockVertexy(mesh,i)
	 z#=GetMeshMemblockVertexz(mesh,i)

     dx#=getobjectx(2)-x#
     dz#=getobjectz(2)-z#
     dy#=getobjecty(2)-y#
     dist#=sqrt((dx#*dx#)+(dz#*dz#)+(dy#*dy#))
    brush=10
	if dist#<brush
		if GetRawMouseLeftState()
			rr=GetobjectColorRed(2)
			gg=getobjectcolorgreen(2)
			bb=getobjectcolorblue(2)
		    SetMeshMemblockVertexColor(mesh,i,rr,gg,bb,255)
  		 endif
	endif
 next i
 DeleteMemblock(1)
 SetObjectMeshFromMemblock(1,1,mesh)
		
	`getting start camera coords
    lx#=getcamerax(1)
    ly#=getcameray(1)
    lz#=getcameraz(1)
    
    MoveCameraLocalZ(1,2000)
    
    `getting end camera coords
    nx#=getcamerax(1)
    ny#=getcameray(1)
    nz#=getcameraz(1)   
    
    MoveCameraLocalZ (1,-2000)   `camera back to it's place
    
    if ObjectRayCast(1,lx#,ly#,lz#,nx#,ny#,nz#) = 1
		fx# = GetObjectRayCastX(0)
		fy# = GetObjectRayCastY(0)
		fz# = GetObjectRayCastZ(0)
		setobjectposition(2,fx#,fy#,fz#)
		else 
		setobjectposition(2,0,0,0)
	endif
	
    Print( ScreenFPS() )
    Sync()
loop
Posted: 28th Apr 2021 12:35
Thats quite clever chafari
thanks for sharing


ive been reading up on blender instructions
ive got an animated 3d version of smoke but its offsett is off by 1200 but if you see the pic
its attached to dummy objects which if i centre it with code that still dont help as it would
only pivot between the dummy object and the animated object

sometimes nomatter what people try you hit brick walls the frustating part is knowing theres ways
to fix but I just dont know. well i think i can but i have to modify 61 frames nd im stubborn and lazy
there must be a better way lol
Posted: 28th Apr 2021 12:57
Can't you center animation pivot?

Edit:
Can you post your 3D object?
Posted: 28th Apr 2021 13:23
here ive attached sorry had head in dvds


its just because of how its animated i have difficulty with the offset

its was a parent child problem

The attached video shows what i was trying to achieve
so if i go with that approach i still have not use a custom shader in game
only tledit5 has one. And being an animated model it may use less cpu than
a shader or particles
Posted: 28th Apr 2021 14:09
Ok I will have a look at it later. Thanks
Posted: 29th Apr 2021 8:24
Hi there....I have seen the 3D objetct animation and tried to modify in Blender....as you say it is hard to adjust pivot with code.....what about using animated sprites?
Posted: 29th Apr 2021 9:26
oh sorry i edited the post i shouldve did another i got the animation working just not sure if il go down that path or use the anim one which uses a shader

I just had to adjust the parent dang children lol

I think the 2d sprite animation was cleaner if that makes sence
Posted: 29th Apr 2021 9:58
Perhaps a bit more transparency helps
Posted: 29th Apr 2021 11:26
i like parts about both but leaning towards the 2d shader version which looks better now i feel
Posted: 29th Apr 2021 12:08
That looks good
Posted: 3rd May 2021 10:20
Thanks Chafari

A preview of things to come
Posted: 4th May 2021 13:24
I created an fbx flag animation (see attached)
but can anyone tell me why its just not visible that i can see in AGK

In blender it load and is fine
just not visible in agk

altho it reports 2 child objects
6 bones
and 4 animations

any insight would be greatly appreciated
Posted: 4th May 2021 14:29
I haven't read the rest of this thread and only quickly took a look at your flag fbx model...in AppGameKit I see a plane where the cloth should be with no culling applied ie 1 sided. it is laid flat in the xz direction rather than being upright in the y direction, with no animation when played. In blender there are no weights applied to any of the verts on either flag or pole - so the bones are not used for animation at all. So I assume it is animated with a different mesh each frame within blender and AppGameKit does not pick up on this - morphing perhaps based on a shape key or some other method. If this was DBP I would see the same result - I have never been able to get animations done this way(morphing) from blender to DBP and have always assumed this is because DBP does not support this way of animating. Key word here is assume lol, also it's been a while to say the least since I played with blender, the version i have used was newer than I am used to, menus have changed so the normal way i would rig is no longer the same. I know Ortu had a fair amount of experience with blender animations, maybe you should consider PM'ing him to gain any insight he may have. I am though leaning towards the lack of support for this method of animation - I guess it could be like many a blender issue where it is a case of outside of blender the method has limited use or of no use at all to any application other than blender. That is about as much information as I can offer I 'm afraid. So at this point I would say your bones aren't of any use currently, if it was your intention to animate with bones then you will definitely have to weight paint it and then animate the bones themselves.(I have no clue of your experience here so forgive me if I sound like i am treating you otherwise - I am certainly no expert and in fact barely know the basics).
Posted: 4th May 2021 15:26
Thanks
Definately food for thought
the model was a cloth one but one of the tutorials i did suggested exporting as an mdd then importing back into blender which i did i removed the wind etc as that was no longer
being used so i think its left as vertex manipulation but not sure whats left after the mdd exporting but i did similar with another model someone else created and it worked well
so im missing some point why i wont use that model its 17mb and too many verts and tris's just thought ide try my hand at one myself obviously did something wrong.

but it may just be that the agk 3d model view isnt grabbing the object close enough and with it on its side may be the issue i dont know but def i can try rotating again
Posted: 4th May 2021 21:40
Hi there....I don't know the problem with your object, but the one that you said that works and is 17mb. you could use the Decimate modifier to optimize the mesh and it should preserve the verter animation

Edit: My last Blender 2.79 doesn't load any thing when I import the object myFlag3.fbx....what version are you using ?
Posted: 5th May 2021 16:42
i use both 2.79 and 2.8 i know i have similar problem when i export from 2.8 sometimes but its more reliable with the fbx files
just i cant save as a blend file from 2.8 if i plan to use 2.79 if that makes sense
Posted: 5th May 2021 18:55
I made some test here... I can't make it work but you could use one of my tricks if you want really use the flag animation, you could export to a serie of Obj and use this method to make animation.

+ Code Snippet
// Project: Loading .Obj animation 
// Created: 2020-01-26

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "Loading .Obj animation" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 0, 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(1,"gnomo.png")
`Loading all meshes
for i= 1 to 20
	loadobject(i ,str(i)+".obj")
	CreateMemblockFromObjectMesh(i,i,1) 
	deleteobject( i )
next
	
`Loading our object
loadobject(1,"1.obj")
SetObjectMeshImage(1,1,1,0)


`Adding the rest of meshes to the main object
for i= 2 to 20
	 AddObjectMeshFromMemblock(1,i)
	 SetObjectMeshImage(1,i,1,0)
next

`hiding all meshes at start  
for i= 1 to 20
   setObjectMeshVisible(1,i,0)
next

`sky	
createobjectsphere(1200,3500,5,5)
SetObjectColorEmissive(1200,0,0,150)
SetObjectCullMode(1200,0)
	
setcameraposition(1,-25,20,-25)
SetCameraLookAt(1,0,0,0,0)
SetCameraRange(1,1,5000)
do
 `keeping all meshes invisible to show only the one we need
    for i= 1 to 20
		SetObjectMeshVisible(1,i,0)
	next

`Animation speed		
	frame=frame+1
	if frame>5 then frame=0
	if frame=1 then ms=ms+1
	if ms>20 then ms=1
	SetObjectMeshVisible(1,ms,1)	

    g#=g#+0.1
    setobjectrotation(1,0,g#,0)


    Print( ScreenFPS() )
    Sync()
loop


I attach the whole project

Edit . Every flag mesh is only 8kb so 100 frames is less than 1 MB
Posted: 5th May 2021 19:24
Looks good
what i was thinking tho if i used the flag animation ide i could attach it to a mixamo lady model and have her wave the flag around but i guess
it doesnt need to be animated for that and there is an addon that can be added to blender in its preferences i believe its called animall or something
and allows modifying the vertexs during an animation il see if agk can support that when i try