Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / new 3d matrix command

Author
Message
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Sep 2014 00:08 Edited at: 2nd Sep 2014 07:16
i've been converting some darkbasic code around and i have come up with some matrix commands that will now work with agk.

download the source to demo it out and change parameters as you wish.




commands added:
-creatematrix(object1,sizex,sizez,gridx,gridz,imgx,imgz,img)
-setmatrixtile(tx,tz,tl)
-setmatrixheight(tx,tz,tl#)
-updatematrix()
-matrixsaveobject2(filename$,flag) //this will save it as an obj file much faster to load back in


and some info on how it works...
first you can create a matrix choosing a size eg... 1000,1000 would be the total size of the object matrix. gridx,gridz are how many square tiles you would like the area divided up to. imgx,imgz are to set the atlas texture ... maybe you have a texture with 10x10 image tiles to split out of that single texture image. last of all is to let the app know what image you want to use for it.

after you have created the initial matrix you can now edit it with the other 2 commands.

once finished editting you can update it so it updates the object with the latest changes. updatematrix()

thats it and if you want to adjust the trim of the texture it can be found in the matrix.agc include file.

Attachments

Login to view attachments
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Sep 2014 00:15
oh yeah.... if you have a joystick it is much easier to navigate scene

xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 2nd Sep 2014 06:01
Man you're great at this 3D stuff! I have never gotten around to even trying the 3D in AppGameKit, but this is a cool addition. Related, DBP has the wonderfully simple command "Set Camera To Follow Object" which eradicates any sophisticated math to create a nice 3rd person camera view or other uses. Does something exist like this yet for AGK--if not would be awesome to have it ported into a similarly structured function.



Original DBP code snippet:

SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 2nd Sep 2014 07:13 Edited at: 2nd Sep 2014 07:15
Quote: "Man you're great at this 3D stuff!"

hehe thanks... its mostly me trying to push agk for what i want it to be able to do.

yeah that set camera to follow would be a great addition... such a command does not exist in agk but like most things...it could be done with code. I'll look into that also.

Login to post a reply

Server time is: 2024-04-20 15:08:51
Your offset time is: 2024-04-20 15:08:51