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 / Sprite Modeller and Animation System

Author
Message
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Dec 2018 21:51
Ok mate, take your time !
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 26th Dec 2018 11:29 Edited at: 26th Dec 2018 11:30
OK cool, here is the first draft of the Save Object

Hopefully it will create an OBJ file for an object thats loaded with LoadObject command




Now shall work on the MTL format, for textures and colouring

Be weary that i put a RAW: statemment in there, just change that to what you need
puzzler2018
User Banned
Posted: 26th Dec 2018 12:16
OK cool

Color added via using the MTL, just make sure you apply a color before saving it



Be back soon with texture
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Dec 2018 13:03
Hi puzzler .

I had to make a little change ...
Quote: "
for facecount=1 to vc-3
WriteLine(fw,"f " + str(facecount) + "//" + str(facecount) + " " + str(facecount+1) + "//" + str(facecount+1)+ " " + str(facecount+2) + "//" + str(facecount+2))

next
"


What I did...instead of for facecount=1 to vc-3 I wrotte for facecount=1 to vc to avoid lossing a face .
And I had to reverse vertex order to make face look outside ...
like this :


Now it works ok here.
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 26th Dec 2018 13:09 Edited at: 26th Dec 2018 13:10
Wow thanks i was fumbled with the faces

Here is a multiple of objects creating their own individual OBJ and MTLs

Its in debug = 1 mode, so need to press space to go through each one



You may notice on some objects that faces are completely gone to whack.. ill work on this and also tweak the changes you found too

This also applies a texture - so place this texture into where your saving the OBJ files, so for my example - it will be raw:C:\data folder

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 26th Dec 2018 13:22
Im just curious if the Index data at the end as some meaningful data to order the faces correctly?

Any ideas if this maybe the case?
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Dec 2018 13:27
Works well guys

The issue I found was the cylinder was missing a face and the sphere a couple
Not far off a proper obj exporter
fubar
puzzler2018
User Banned
Posted: 26th Dec 2018 13:30
Thanks, but Im not sure ive done it right cause the Sphere for me looks like attached pic

Have I missed something?

Ill try loading it in Blender

Attachments

Login to view attachments
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Dec 2018 13:33
Quote: "Im just curious if the Index data at the end as some meaningful data to order the faces correctly?

Any ideas if this maybe the case?
"


That's what I ask me here
https://forum.thegamecreators.com/thread/223401


Quote: "The issue I found was the cylinder was missing a face "


@fubarpk I gave a solution to the lost face .


About the sphere, it has a different index order...... that's why we need a comand like GETINDEXDATA in Dbpro to guess which vertex make the triangle ....I have not found any equivalent in AppGameKit
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 26th Dec 2018 13:36 Edited at: 26th Dec 2018 13:37
Thanks.... Ill take a look at the Index data next to see if i can recreate the DBPro command as such
puzzler2018
User Banned
Posted: 26th Dec 2018 15:13
Yes its the Index Data at the end

If it has Index Data then it could potentially have 4 and indeed 3 faces.

Like

f 1/1/1 2/2/2 3/3/3 4/4/4
f 5/5/5 6/6/6 7/7/7
f 8/8/8 9/9/9 10/10/10 11/11/11

Its building a cube with this nature but just not 100% yet - getting there slowly though,

This is tough to figure what the index data is doing out so bear with me

puzzler2018
User Banned
Posted: 26th Dec 2018 19:38 Edited at: 26th Dec 2018 19:39
Jeeesus - I think we have cracked it...



AGK Cube and Sphere as index data so these have a different method

The other primative dont so those are straight forward

Will need to do the texture and normals - but thats enough for today...
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 26th Dec 2018 20:53 Edited at: 26th Dec 2018 20:55
Definitely getting there

Off the topic but didn't you start a thread somewhere on classics
I been trying to work out what il do next and thought ide have a brows on the thread have a few ideas too
fubar
puzzler2018
User Banned
Posted: 26th Dec 2018 20:58
Yeah - my mind tends to take me off a completely different tangent...

Just one more - an example of multiple objects together



Now that we getting there with this, shall head to the lemmings thread and crack on with this, this has been on my to do for while
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Dec 2018 22:06
Hi there . That's nice ....have you find out texture ? ...lol that's like a chanllenge to get the first premium ...
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 27th Dec 2018 09:59
Will work on the textures VTs and VNs this morning and then start back on the classics
puzzler2018
User Banned
Posted: 27th Dec 2018 10:40
A bit like this




puzzler2018
User Banned
Posted: 27th Dec 2018 11:42
a rocky Dragster racing track anyone?



Enough on this for now..
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 27th Dec 2018 12:12
Quote: "a rocky Dragster racing track anyone?"


You have to set the deadline .
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 27th Dec 2018 12:16 Edited at: 27th Dec 2018 12:19
Yeah - but a deadline on this Object thingy thing or the dragster road?

Im not planning on doing a dragster app - just showing some examples on been able to create other non primative OBJs.

This OBJ been on my task list for a long while whilst in 2018 as part of my MeshMemblock thread work.

Can we safely say this Obj exporter works and be useful for future projects?

EDIT - indeed if there is anything more you like me to try and challenge myself over to achieve with memory management then would love to give it a shot.

Like, is anyone missing a vital AppGameKit tool/feature to be able to acheive anything?
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 27th Dec 2018 12:22
Quote: "Can we safely say this Obj exporter works and be useful for future projects?"


For sure ! . About the dragster road ...I was just kiding

I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 27th Dec 2018 12:26
Who knows I might make Power Drift revisited with this method in one of the months of 2019 on my classics

If i can think of any useful mesh memory tools too , ill share them out

puzzler2018
User Banned
Posted: 27th Dec 2018 13:23
Example of creating a power drift map would be something like



The hardest part would be to interpret those into objects - but thats for another time...
puzzler2018
User Banned
Posted: 10th Jan 2019 12:46
Going to have a go at 3d modeller now I know how to get 2d coords on a 3d object... The end vertices we can put a small circle sprite on each of the corners so that can pull them around or add new points to any given starting object. Let's start with a cube and then aim to be able to change other primitives. Even our own models and export it back to obj once happy with the final results
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Jan 2019 14:05
Cheer up , don't give up now .
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 10th Jan 2019 17:36
Lol - I always try to be cheery as best i can

Here is a starter



The BuildAGKCubeIntoMesh takes an AppGameKit primitives proper object and gets all the verts (as an example from yourself Chafari some time ago... But try changing the ObjectBox to something else like ObjectCylinder.
it goes messy - cause not thought about the indicides

But the vector points work
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Jan 2019 18:53
Getting there
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Jan 2019 19:37
@puzzler it isn't question of indices...the vertex are where it shows they are no matter the objecy we use
I'm not a grumpy grandpa
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Jan 2019 19:37 Edited at: 10th Jan 2019 19:39
@puzzler it isn't question of indices...the vertex are where it shows they are no matter the object we use
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 10th Jan 2019 19:56
Yes i agree on that one - as AGKs commands, GetMeshMmblockVertexX , Y, and Z will always grab that info for ever vertex number in the vertex count

But something just not quite right, as it is currently try changing the Box to a Sphere, you will see what i mean

Unless we have the faces incorrect.

The function accepts to build 4 vertexes to make a plane (for a box)

But other objects will just require 3 to make a triangle and x2 to make the face.

Beer on me if you understand what mean lol

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Jan 2019 20:04
MY 2 Cents worth
the problem may be that each face has four vertexes
but when you join them you've effectively doubled up the vertexs total

Well ateast thats what i find with mesh creating i had double up on vertexs not necesarely faces
fubar
puzzler2018
User Banned
Posted: 10th Jan 2019 20:07 Edited at: 10th Jan 2019 20:11
To me - it will be an IF

If an object has Indices data by the use of (getmemblockint(mesh, 4)

Then make quads (like the function does now) otherwise make triangles


Will be sorted tomorrow

EDIT-Thanks Fubarpk and Chafari for your time and inputs, most welcoming
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Jan 2019 20:11
Now I'm out ....i'll have a look later
I'm not a grumpy grandpa
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Jan 2019 20:12
your a good programmer and you like to challenge yourself with the hard stuff
I like to challenge myself that way too but im a little different if the problem seems overwhelming nowadays
I get too anxious to even challenge my problem lol Its just something im finding with age but I admire how you
can take on such heavy problems, think chafari is another one that likes to challenge himself too. I guess that's
why we all like to program but a little different from the ones who only take on much smaller problems in their
learning curve

Think you both need a pat on the back for work achieved so far
fubar
puzzler2018
User Banned
Posted: 10th Jan 2019 20:19
Aww thats quite welcoming too, Im exactly same but not with Programming... Programming is my life so if I face a challenge in that - then love to try and solve something.

I am more anxious with challenges in the real world - so I have a set routine and if anything breaks that routine, I shy away.

But programming...bring it on....
puzzler2018
User Banned
Posted: 10th Jan 2019 20:58
We are all great programmers here in our own way shape or form. Mine just happens to be in memblock work and problem solving.

How about you guys and (if any on) girls
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 10th Jan 2019 21:35
I know that at this point I will not reinvent the wheel but for me, challenges are what I like the most . Anyone can take a free 3D program and make wonderful objects . That's not what I'm looking for, I prefer to do it all by myself .
I'm not a grumpy grandpa

Login to post a reply

Server time is: 2024-11-23 12:36:23
Your offset time is: 2024-11-23 12:36:23