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 / MeshMemblock Function

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Sep 2018 00:05
Im sure there are still plenty watching and trying what you post just most people don't comment
you only have to watch the amount viewed
fubar
puzzler2018
User Banned
Posted: 28th Sep 2018 00:06
Thanks
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 28th Sep 2018 00:16 Edited at: 28th Sep 2018 00:17
I'm loving the progress of this. It does look quite promising when it can result in a much larger worlds, which are loaded much faster. edit: auto correction in browsers are so bad

Quote: "
I loved - LBA 2 anyone remember that beast "


If you mean Little Big Adventure 2, then yes I absolutely do remember. Awesome game even today actually.
puzzler2018
User Banned
Posted: 28th Sep 2018 00:31
Thank you
puzzler2018
User Banned
Posted: 28th Sep 2018 00:46
I hope a manual soon for the beginners for the world creations

Im still trying to work on it

What we all think
puzzler2018
User Banned
Posted: 28th Sep 2018 00:49 Edited at: 28th Sep 2018 00:50
Beginners dont be shy as to what you like to do with AGK

Shout up you shy people
puzzler2018
User Banned
Posted: 29th Sep 2018 13:02 Edited at: 29th Sep 2018 13:26
Hi,

I have converted the types so that we can have individual objects now that can be re-used over an over to build a mesh up



Can be setup via something like this



This loads 3 pre-defined objects that i created for this example - ico.obj, cube.obj, torus.obj

See it all in action



As you will notice that the vertexes are not quiet right either now.

Shall fix this...

But this is what my idea is to be able to build 3D world apps

EDIT:- The dont load fully cause objects sometimes have 4 f's for polygoon construction , for exxample



I have only coded it for x 3 faces - triangles

eg


Time to construct a pologon creation function

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 29th Sep 2018 14:20
Wow - Polygons are now fixed



Use the attached OBJs for testing

Enjoy and will catch up for more soon

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 29th Sep 2018 15:13 Edited at: 29th Sep 2018 15:14
Something like this looks cool for a mesh world



Again use the cube/ico/torus.OBJs

See how its coming alive with this style of work?

Now time to think about been able to move / roatete individual objects on the mesh maybe perhaps a little bit of mesh collidar work

Ill stop wittering on now lol
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Sep 2018 16:34
Looks really impressive
fubar
puzzler2018
User Banned
Posted: 29th Sep 2018 19:10 Edited at: 29th Sep 2018 19:55
Thanks

I have been working on been able to remove individual objects from a mesh, you choose an object and voia - its gone without upsetting any other things on the mesh!

The way to do this is to remeber vertex indexes for the main mesh , by using something like



and in the InstanceObject function, have something like



Al of the above code doesnt work, but its by way of having a reference to the true vertex location on the main mesh, so to allow an object either to be deleted, moved, rotated, etc

I have it working, but its not removing all of the vertexes for the object and i think i know why, we have to think that each object will need to have too

- object mesh header info = x, y#, z#, nx#,ny#,nz#,u,v,volor info on each
- object mesh data itself = <how ever many bytes>
- object mesh indices which is at the end <how ever many bytes> (im missing this)

Im currently working out this, i maybe clutching at sttraws thinking this mybe the cause of not removing object fully
puzzler2018
User Banned
Posted: 29th Sep 2018 22:36
Anyone like to contribute to my fault - all would be welcomed greatly
puzzler2018
User Banned
Posted: 30th Sep 2018 10:19 Edited at: 30th Sep 2018 10:27
Fixed the indices and now removes individual objects no matter where on the mesh



Press space to start deleting them

You may find a hog on the mesh re-creation, this is because the mesh is always been rebuilt on deleting the object

We can remedy this by not doing such thing and only concentrate on the object vertex location "from" and "to" via the "SetMemblockFloat" I think!

this is to try for the next job
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Sep 2018 11:36
works well
fubar
puzzler2018
User Banned
Posted: 30th Sep 2018 14:23 Edited at: 30th Sep 2018 14:25
Thanks

We can still achieve the same thing but this version can import your own OBJ files to your liking.





Shall do the texture imports next

Enjoy and catch up soon
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Sep 2018 17:56
now that's very handy
fubar
puzzler2018
User Banned
Posted: 30th Sep 2018 18:15 Edited at: 30th Sep 2018 18:16
I have now added frustrum to far distant objects (all main mesh objects behind the camera dont get shown) and alpha transparency on distance ones



It doesnt have to be exactly like minecraft - but say like you have a goal to achieve on the first chunk and then sail over the seven seas to the next chunk where it will become more focussed
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Sep 2018 19:11
I like it
1>Not sure about the alpha transparency maybe its just the amount of transparency being set to demonstrate
2>This thread didn't have a link to the tree.obj which was easy enough for me to find on the Minecraft thread but maybe not for others

Il have to try it with my own objects next, the first time I tried it with my own cube obj it got an error with the number of faces which makes
sense as you had only coded it for 3 faces then and still not sure if the cube object is still used in that method but il have to try one of the other
placed objects with my own such as a tree etc. But definately the code is leaps and bounds ahead for the minecraft project. The final product
should achieve great frame rates on low end machines without the use of shaders and maybe even mobiles. Which is a real plus for the AppGameKit
community and developers

Keep up the great Memblock Work
fubar
puzzler2018
User Banned
Posted: 30th Sep 2018 19:54
Thanks for comments and a bit unnerving to here about your cube not loading.

Could you possibly attach your obj that throwing the error and see if i can dissassemble it as to why.

Maybe there are 4 and 3 faces (Fs) in there - i havent accounted for that scinerio yet
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Sep 2018 22:53
The Error "Array index out of bounds Index -1 Array Length:7 in main.agc at line 335"

cube.obj
fubar
puzzler2018
User Banned
Posted: 1st Oct 2018 07:10
Thanks -

Ill give this a bash tonight and correct what I find

puzzler2018
User Banned
Posted: 1st Oct 2018 07:13
I see the f's having 3 here - this is for

Vertexes / Texture UV / Normals

I haven't done the Textures yet..

This will work when I have implemented UV mapping


All good!

puzzler2018
User Banned
Posted: 1st Oct 2018 19:29 Edited at: 1st Oct 2018 19:36
I have now imported texturing for the OBJ



Used your OBJ data as an example and testing

Let me know how you get on

I just used a bog standard image and doesnt look right - but your material that you used to create the object maybe just slightly "spriteysheet" style / organised better to acheive the best result

I shall now tidy code up a bit and apply the texture to polygon x 4 objects

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Oct 2018 22:41
The texture worked fine

cube.png http://users.tpg.com.au/subarpk/cube.png PS you wont see it on a white webpage
but each box section represents the cubes face ie it can have six different colors applied to it with the mapping
on that object ie perfect for a die


fubar
puzzler2018
User Banned
Posted: 1st Oct 2018 22:58 Edited at: 1st Oct 2018 23:03
Cheers

Now thats for individual objects.

But as this is for ultimately many objects onto a mesh, then these individual textures will need to be programically joined together in someway and UV automatic calculation for different textures to be potentially added different objects

OUCH!!

Example of a spritesheet image per mesh is attached

im more building a 3D creation package, like blender arent i

Its all good learning experience

It wont stop here and have this been a showstopper - but more of a challenge

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 1st Oct 2018 23:16
Unless we make use of meshmemblock indexes - we have 1 - 255 possibles indexes possible for multi image texturing

Ill test this option
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Oct 2018 23:22
Quote: "Its all good learning experience"


Sure is and when you have the textures sorted people will be able to use any object add to a mesh object and have several of those
meshobjects appear as their world

i think if you texturemap it the way you have shown in the attachments it will work great. i think with your pervious work with the texturing
in minecraft they should come into play here but the added objects would need appending somehow. I think the main calculations now
would be that it would have to calculate the texturing in a power of 2 based on objects for example a cube might take up 6 spots on your grid
for example while petrhaps other objects just take up one for each object that method may work for the minecraft thread. But trying to workout
the texture mapping of each object so as you could map as tho for example a ide might have 6 sides and a a pyramid 5 sides might be a much
harder calculation but you do already know the number of faces an object has so still quite achieveable that way aswell. Ideally a square on the
texture for each face would be ideal and work really well with low poly objects but with your man object object it would have too many faces

fubar
puzzler2018
User Banned
Posted: 2nd Oct 2018 18:17 Edited at: 2nd Oct 2018 18:25
Thanks Fubarpk - ill have a read and digest your comments.

I will have a night off tonight cause im exhausted with programming with doing it constantly all day at work too.

Just out of curiosity though, I made a construction to create individual objects again - just to see if any better before I ever started with memblocks back in Feb/Mar time, but this time creating them via code im writing



This making a 60 x 60 - 3600 objects - non starter - booooomed my pc

and making it size=8... Which is 16 x 16 then FPS is very poor indeed

nope - this technique still dramatically crashes or rubbish fps.

So this memblock work is definately the way to go with no shadow of a doubt!!
puzzler2018
User Banned
Posted: 3rd Oct 2018 22:42 Edited at: 3rd Oct 2018 22:43
Been thinking about single OBJ animation - i beleive Blender does this feature.

Does anyone know when we finished with animation - what capabilities (file extensions) possible to make the animations come to life.

For example - can we export from say Blender to an OBJ
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Oct 2018 22:45
Quote: "what capabilities (file extensions) possible to make the animations come to life."

3DS and the animation to work in AppGameKit is one object animated not several objects to make one object animation
fubar
puzzler2018
User Banned
Posted: 3rd Oct 2018 22:54
be good to make use of it... thanks... ill have a think
puzzler2018
User Banned
Posted: 3rd Oct 2018 23:18 Edited at: 3rd Oct 2018 23:20
3DS - the top market for 3d engineering.. Autodesk... They will never leave this software field

Any other formats. OBJ for example
puzzler2018
User Banned
Posted: 3rd Oct 2018 23:34
One step at a time with this Puzzler... Time to look at potential collision data - thats another Type command on the way im afraid

There is too many type data going on, but with meaningful expectations.

puzzler2018
User Banned
Posted: 3rd Oct 2018 23:48
What on earth have i got myself into.

amazing challenges awaits
puzzler2018
User Banned
Posted: 3rd Oct 2018 23:53
Maybe to what AppGameKit should really be about. with help x
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Oct 2018 22:03 Edited at: 5th Oct 2018 22:15
Quote: "Maybe to what AppGameKit should really be about. with help x"

What I love about programming is the problem solving. Which can prove quite difficult at times but the more difficult the greater achievement

The forums are here to help and all the people who contribute to the helping of one and other make many projects achievable and in a shorter length of time
the problem is the more difficult the problem the less people want to help. I was right with you through the development of memblocks for sound etc but
the Minecraft thread got huge and the work on the how to do all of that memblock manipulation and creation of objects im kinda only half with you. Taking
a step back and working on loading obj files and understanding the workings of the obj files is great and I really need to examine more closely the code you have
achieved already, other than just compiling and seeing what it does lol

Quote: "Been thinking about single OBJ animation"

As nice as animation would be and perhaps a change from single objects I think there is much more that can be achieved before learning of other animated formats

The rotating barrels, hearts etc in Blocklifter rotate in code. There is advantages of doing this as you can with a little vector math only rotate them as they are within
a certain distance

The vector mathroutine to get the distance an object is to another object is as follows
fubar
puzzler2018
User Banned
Posted: 6th Oct 2018 09:55 Edited at: 6th Oct 2018 09:59
Thanks for your comments and little distance tip, im sure this will be very useful.

This weekend if I can get chance, is to work on rotation / transform / rescale objects dynamically on a mesh.

I know for the moment that for a very large mesh with the objects on, will have to be recreated on every frame - unless Paul could code a function up to do this

For example



Deletes an object from a mesh, but if it is 100,000,000 in size say, then the recreation will be very poor and laggy.

So a Function like



Which could only change the vertexes VertexFrom and VertexTo without rebuilding the whole object

Unless we make much smaller meshes to build a world up then maybe this may help a lot in the recreations using SetObjectMeshFromMemblock

So this style programming maybe better to build static objects, buildings, bridges, statues, churches, roads and such like

Let me see what i can achieve
puzzler2018
User Banned
Posted: 7th Oct 2018 14:16 Edited at: 7th Oct 2018 14:19
I have now added

function moveobjectYonmesh(mesh,id, y#)
function moveobjectXonmesh(mesh,id, x#)
function moveobjectZonmesh(mesh,id, z#)

Which will move an object (id) thats allocated on the mesh (mesh) by so many coords

For example


I tried posting the full example - but i got "An error occured"

Is there a byte size limit on the size that we can post at any 1 time?

Is my code too big now that wont accept it -- I wouldnt say it was a "snippet" anymore.

Would it still work if I attached the main.agc file instead going forward

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 7th Oct 2018 14:46 Edited at: 7th Oct 2018 14:59
Ive now added a scale capaibility on instancing a cube.obj

Attached is the current main.agc

use cube.obj

dont have to use cube.png for the minute

City View anyone

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th Oct 2018 16:00
Quote: "I tried posting the full example - but i got "An error occured""

There is a size limitation I had this issue with book of portals

fubar
puzzler2018
User Banned
Posted: 7th Oct 2018 16:02 Edited at: 7th Oct 2018 16:02
Thanks - Ill add the main.agc as an attachment instead

works now with a texture - so use cube.png and cube.obj too (these are on previous posts


Here is the latest

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th Oct 2018 16:16
an impressive amount of objects
fubar
puzzler2018
User Banned
Posted: 7th Oct 2018 16:48 Edited at: 7th Oct 2018 16:56
Thanks

I think a new idea as developed that would compliment this style of coding very well, and this is a map editor to where we want buildings or other fixtures, sizes and heights of them

The data file could be coded up to something like this

3DMap.DAT which contaiins something like



This could make it more look and feel like something real rather than just scattered objects around the place
I hope you get my meaning

1 Step at a time though

Catch up soon
puzzler2018
User Banned
Posted: 7th Oct 2018 19:18
Guess what..

You are now inside an inverted cone - textured on the inside

This could be a new way of doing skyboxes - even though skyboxes aer spheres (we can resolve that soon. - but at least can have your own textured clouds.png for example

Main.agc attached and cone.png too

Let me know if any errors




Attachments

Login to view attachments
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Oct 2018 21:12
Sky boxes aren't spheres......they are boxes.

And actually, spheres and boxes both make bad ones I reckon
puzzler2018
User Banned
Posted: 7th Oct 2018 21:15 Edited at: 7th Oct 2018 21:16
strange as it may seem AGKs skyboxes is a sphere - promise

ok, we can always make an inverted box

Whats you opinion on your best choice of a skybox?
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Oct 2018 21:52 Edited at: 7th Oct 2018 21:53
I actually made my own, though fairly simple. Make an EPIC sphere in any modelling program, then cut the top off - You keep that part and that's your sky. Let's you scroll textures and it curves without looking too round.

Which I believe is called a sky dome.
puzzler2018
User Banned
Posted: 7th Oct 2018 21:55
thank you - most intuative - this will be remembered.

Thanks Santman
puzzler2018
User Banned
Posted: 7th Oct 2018 21:58 Edited at: 7th Oct 2018 22:00
A dome - this would be half of a spherical sphere ?

Like an half ICO-Sphere
puzzler2018
User Banned
Posted: 7th Oct 2018 22:44
I really hope Jambo is ok - havent heard for a long while

Login to post a reply

Server time is: 2024-04-28 18:16:43
Your offset time is: 2024-04-28 18:16:43