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 / Lego Bricks

Author
Message
puzzler2018
User Banned
Posted: 3rd Feb 2019 12:00
Hello

Anyone thought about Lego



chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 12:29
Hey ... that looks really nice ...could be a good chanllenge
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 12:54 Edited at: 3rd Feb 2019 12:54
Thanks

Yeah would be a good challange one month



They will need to be converted to meshmemblocks though but should be ok to do

Catch up soon with this months challenge
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Feb 2019 16:29
looks good
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Feb 2019 18:15 Edited at: 3rd Feb 2019 18:17
would be very good for your own version of Minecraft,

Not sure if you want to go down that path but if you convert to obj
i could load into blender and remove duplicate and close vertices
for you, saving on vertice count.

Easily enough done if you would prefer to do your own blending lol (see what i did there)
load into blender select object go into edit mode make sure all
vertices selected and click remove doubles in the box menu on
the left of screen and select an ammount ie .5 or perhaps .1 and
tap enter key the top of the windows title it shows you how many
vertices it has removed. Place 0 back in the box if you want to restore
fubar
puzzler2018
User Banned
Posted: 3rd Feb 2019 18:36
Hi

Thanks - I was just loading YouTube and saw advert on Lego Movie 2 - and thought YEP! would be interesting..

And this could be for one of the months.

Yeah the conversion into a Minecrafty style app would be interesting enough - but will need to be its own App but built on a Minecraft world engine style

And thanks for your help in the blender works - my skills with anything like that is very basic - thats why i prefer to inbuild the objects.. the parts are all different shapes and sizes, plus hollow too But can work on that later.
and export the final constructed lego brick into an OBJ which shouldnt be too much of an issue either as we have learnt how to this now.

Thanks for your help.

Would be good to have someone nearby to give an helping hand from time to time.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 18:50 Edited at: 3rd Feb 2019 18:54
Quote: "Would be good to have someone nearby to give an helping hand from time to time."


Somehow we are all here trying to help when necesary in our free time

Edit.
I spend one our trying to do my best . What I did instead of fixing object to object, was just ...
AddObjectMeshFromMemblock(obj,mesh) and
SetMeshMemblockVertexPosition(mesh,i, x#+xx#,y#+yy#,z#+zz#)

But somehow the next mesh we add have a different x/y/z that we need to guess
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: 3rd Feb 2019 18:52
Quote: "And thanks for your help in the blender works "

no worries i dont use it much so im always googling how to do stuff, just was thinking even if you
only save a couple of vertices a brick that would work out allot when you consider the ammount
of blocks in a minecraft world. And most the work done for the minecraft engine to get the basic
setup with lego blocks so might be cool to see as it would be your own variant

Quote: "Would be good to have someone nearby to give an helping hand from time to time."

Think we all could do with that at times because we never stop learning. I still havent got the c
version setup proper or ide convert what i have to that. Atm when i try i have to keep changing
the template to the code i want to compile and no idea how im supposed to get that to a mobile
app yet. but all in time and havent figured out the broadcast ability to my phone yet. lol

fubar
puzzler2018
User Banned
Posted: 3rd Feb 2019 19:13
Thanks Guys much appreciated.


Have we done the OBJ to meshmemblock yet. I just cannot remember.

As it would be useful if create a plane full of these things, say a 500x500 plane but of lego structure, and this would be the land to start building on.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 19:42
Quote: "Have we done the OBJ to meshmemblock yet. I just cannot remember."

I'm not sure either . I think you can design the pieces first and then some algorithm for the creation and placement of the objects ....remember...pieces must plug one to another
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 20:09 Edited at: 3rd Feb 2019 20:11
Yeah - will have to do a SNAP code or some description which im sure is not too difficult

Ill think about doing a multiple FixObjectToObject object to go into an OBJ and then bring back into a mesh memblock (for bigger world / constructions)

EDIT

Just seen your addobjecttomeshmemblock idea - interesting and worth a checkout
puzzler2018
User Banned
Posted: 3rd Feb 2019 21:16
I think we be ok with this. but FPS is rubbish.



Meshmemblocking on the way
puzzler2018
User Banned
Posted: 3rd Feb 2019 21:17
Must admit it is a bit like minecraft but with a nobble on top - Amazing - didnt think of it sooner

Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 3rd Feb 2019 21:30
Looking good indeed.
I love Lego since the 70's so have collected a fair bit of bricks.
Been out of it for while, last thing built was Millennium Falcon for/with my nephew. Was hard to let him keep it though.


Apparently Lego Minecraft is/was a thing(nephew loved it). https://www.lego.com/en-us/themes/minecraft
But I do not see any Lego Mincraft games here: https://www.lego.com/en-us/kids/games

So you guys might be on to something, unless Minecraft is heavily copyrighted? I believe Lego lost it's own years ago.
Perhaps call it BrickCraft?
puzzler2018
User Banned
Posted: 3rd Feb 2019 21:38
Thank you

Thought it maybe interesting to follow up on a nice little project.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 21:48
Hi there
Quote: "Thought it maybe interesting to follow up on a nice little project."


I agree, but sometimes little project are like a pain in the neck . I been thinking for a couple of ours about an engine for lego and I'm with a cloudy mind
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 21:49 Edited at: 3rd Feb 2019 21:52
Maybe an OBJ like a plane of x=1, z=1 with a cylinder top in middle would do as an OBJ then can we make the front, back, left, right as simple single sinded planes

That would help

This way adjoining legos / blocks can be occluded as normal

Just a top with a cylinder top needed

EDIT

We can develop the engine like minecraft

Double EDIT - ok, this could turn into a long project - nothing is simple

Treble EDIT - How long did Rockstar develop Red Dead Redemption

chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 21:52 Edited at: 3rd Feb 2019 21:53
You are going to have much more vertex with five planes than a complete box ..... a box has in total 24 vertex ...a plane has 12 vertex
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 21:53
A single plane would be 6 - 12 is a double one.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 22:01
I didn't know we could make planes with six vertex....if we export to Obj we can even make planes with just four vertex
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 22:04
A plane is a rectangle - we need to work in triangles with shared vertices.

triangle 1

topleft vertex 1
topright vertex 2
bottomleft vertex 3

triangle 2
bottomleft vertex 4 (shared)
topright vertex 5 (shared)
bottom right vertex 6


AGK plane is double sided

We have to create this using meshmemblocks - ill show you in a bit how

chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 22:10 Edited at: 3rd Feb 2019 22:16
Quote: "A plane is a rectangle - we need to work in triangles with shared vertices."


Yes I know....that is how I made the icoshedron, using just the first three vertex of a plane and forgeting the rest


Edit.
We just need the vertex position to export to .Obj we just need to use the vertex we need .


Edit2

Exporting planes with just 4 vertex

I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 22:15
Single plane



chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 3rd Feb 2019 22:17
Ok ....I will study this thanks
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 3rd Feb 2019 22:17
Im sure we will work it out
puzzler2018
User Banned
Posted: 3rd Feb 2019 22:28
Added polies and triangles drawn



Catch up tomoz
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Feb 2019 22:47 Edited at: 6th Feb 2019 13:19
heres some blocks I whipped up that have been texture mapped with textures
http://users.tpg.com.au/subarpk/legoblocks.zip

Edited removed the rar file and replaced with zip
fubar
puzzler2018
User Banned
Posted: 3rd Feb 2019 22:52
Wow - thanks Fubarpk - very helpful

Chafari - you have to use IE to download them but they work in 32bit

Cheers Fubarpk...
puzzler2018
User Banned
Posted: 3rd Feb 2019 23:08
Nice

Download all the OBJs from Fubarpk

and



fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Feb 2019 23:27 Edited at: 3rd Feb 2019 23:34
your welcome I just noticed I stuffed up block8 slightly with the positioning ohwell will fix later
and the pivot points may be wrong easy enuff to fix the long short cut in blender fixes those
shit + ctrl + alt + c
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 00:18 Edited at: 4th Feb 2019 06:42
fixed the objects and textures already uploaded

PS if you colour the textures in a nice greyscale the setobjectcolor commands will work well
fubar
puzzler2018
User Banned
Posted: 4th Feb 2019 06:42
Hiya - thanks yeah that would be helpful - will may need to figure out which vertexes belong to the bottom, front, back, left and right - so not to display them if they adjoining others

but cool

Catch up later - heading off to work now
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 06:47
Quote: "will may need to figure out which vertexes belong to the bottom, front, back, left and right - so not to display them if they adjoining others"

Chafari has the perfect piece of code for that somewhere

Quote: "Catch up later - heading off to work now"

Have a good day at work, here its dinner time TC
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Feb 2019 09:30
Hi there.

Quote: "Chafari has the perfect piece of code for that somewhere"


Yeah ...here it is just in case .


I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 4th Feb 2019 12:45 Edited at: 4th Feb 2019 12:46
Perfect.

Thanks Chafari



will come back to this a little later.

Shall see to get these OBJs into a meshmemblock too and create some Lego lands with OBJ back face culling as the first task..
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 12:59 Edited at: 4th Feb 2019 13:01
Thanks Chafari
btw how did you go with the download this time? same gobly gook ?

Quote: "Shall see to get these OBJs into a meshmemblock too and create some Lego lands with OBJ back face culling as the first task.."

Cool looking forward to see what you can do with it

by the way I uploaded with fixed models and inverted textures in other words white models with black outlines which should work well
combined with setobjectcolor to show the outline in black. Showing where there holes etc in bottom would be etc

PS The models are yours to do with as you please


I kinda like the name LegoCraft but its prob taken
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Feb 2019 13:44 Edited at: 4th Feb 2019 13:46
@ puzzler / fubarpk You are welcome !

Quote: "btw how did you go with the download this time? same gobly gook ?"

Yeah exactly the same ...I did what puzzler suggested to use IE but downloading is ok in both but can`t extract files
I'm not a grumpy grandpa
puzzler2018
User Banned
Posted: 4th Feb 2019 13:50
Is it the 32 bit issue again. Bear with me me. I'll see what I can do without no one looking lol.
puzzler2018
User Banned
Posted: 4th Feb 2019 13:59
Hope this works

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 14:08
Quote: "I'll see what I can do without no one looking lol. "

beat me to it lol just uploaded as a zip myself
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Feb 2019 17:17
Thanks puzzler and fubarpk for the legoblock.zip.
I have to say about double vertex as I have been working with Blender from the begining of Blender . We can reduce vertex quantity but sometimes this is not the best solution, instead what we could do is just delete hidden faces . Here's an example I exported to .Obj from Agk and then loaded into Bender and deleting double vertex .
What happens with this tecnic sometimes give us undesirable results as we loose the object normals in the best of the cases as we can even loos aswell the Uv'S . What I like most in my programming games is to go at night with the minimum light and a flashlight . When we loos the normals of the object, In most cases the objects won't receive correctly the light and lowering the quality of the shadows .

The object with double vertex is 7,09KB the object without doubles is just 2,63KB . And now look the difference.



Take a look to the atached rar . There are lots of instances of the same object down and lots of instances above with reduces vertex
I'm not a grumpy grandpa

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 4th Feb 2019 17:34
Wow thanks Chafari, ill take a close look at the OBJs and see how its acheived.

I seen somewhere that can recalculate the Normals on any given face in rebuild processing time for the blocks.

Cause we working with cubes the normals will either be a straight -1, 0 or 1 for each face.

Illl take a good look at your inputs here

Cheers
puzzler2018
User Banned
Posted: 4th Feb 2019 18:56
Who knows - it could work



Just using one obj at the moment.

But FPS still this could be heavily increased with culling and / or maybe even mesh memblocks

Ill still have a look at your work Chafari, thanks

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 19:24
@Chafari I didn't remove normals on the blocks they are just cylinders and boxes joined
When i remove doubles its like with my vertex extruder then i remove the double faces
which cuts back a 70mb object to like 5mb becuase it joins the faces. Maybe blender has
improved this process not sure but i was always taught welding vertices was good modelling

@puzzler looks great and i still get a good frame rate it didnt drop until i zoomed right out
and was still acceptable with all the heavy resource hungry apps in the background



fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Feb 2019 19:51
@ fubarpk sorry ....I didn't mean exactly you . I have done it myself, but the true is that when we reduce vertex we can have this issue. Imagine a sinple cube....it has 24 vertex , 24 normals...we could do it with just 8 vertex, but each triangle needs at least three normals ...so we are using somehow only two normals per face to have something desent....if we set the first four vertex ...how can we set correctly the next face as they use the same vertex?...that is what I mean...a box should have always 24 vertex and 24 normals and not 8 vertex 8 normals....sorry if there was a misunderstandig
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: 4th Feb 2019 19:56
All good wasn't worried, just thought ide make a mention I never did that with the lego blocks
I do understand what you mean tho but welding vertexs is a good solution when you have
two sets next to each other and not sure if the remove doubles is the same as weld vertex
in 3ds max
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Feb 2019 20:03
anyway when I load into uvunwrap to texture that is meant to fix faces and normals etc
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Feb 2019 20:09 Edited at: 4th Feb 2019 20:10
Welding vertex is a good thig to reduce the last object, but there's an algorithm tha do that and in Blender for example, there is a set up for that so be sure what you want to reduce . I normally don't do it if the object is going to be use in a game with low ambient light . With a good ambient light the problem is greatly reduced .
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: 4th Feb 2019 20:12
Thanks sounds like back to blender tutorials for me lol

sorry taking over your thread here puzzler so il go back to being quiet
fubar
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 4th Feb 2019 20:25 Edited at: 4th Feb 2019 20:25
My bad.
Sorry Fubarpk ...perhaps I jumped the gun here....just test your object in Blender , and I think I know what happens. We can set smooth or flat..where smooth kill shadows ....something like when we reduce vertex .

I'm not a grumpy grandpa

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 05:50:45
Your offset time is: 2024-11-23 05:50:45