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 / Create mesh of surfaces in 3D

Author
Message
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 2nd Apr 2018 07:20
I have a list of a few hundred points with normals that I have read into AppGameKit and converted into a type containing x,y,z,dx,dy,dz. I would now like to represent these points as a grid of surfaces with given size in 3D with right position and angle. I thought I use CreateObjectPlane but I can not figure out how to position and rotate the surfaces based upon the vectors and x,y,z. Any help would be useful.

Sincerely,
Max Tillberg
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Apr 2018 07:35
I hope this helps

If you are trying to create a landscape it is far easier to use a free program like Wilber and use
CreateObjectFromHeightMap( objID, szImageFile, width, height, length, smoothing, split )
http://www.fracterra.com/wilbur.html

if you are trying to modify a mesh to create a terrain mesh it requires you to make the use
of memblocks. The minecraft thread is trying to do this https://forum.thegamecreators.com/thread/221407
fubar
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 2nd Apr 2018 07:51 Edited at: 2nd Apr 2018 07:53
The reason I want to create each surface is that I want to be able to set the color individually based upon a value that is also imported from a text file. I am trying to create a result visualizer for 3D data. Actually I have color coded grids in Rhino but I do not think it is possible to export them and import them into AppGameKit with color. The final result should look like this https://m.youtube.com/watch?v=eEpOCuiDcLM
Sincerely,
Max Tillberg
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Apr 2018 07:58
the minecraft thread should be quite helpful as it makes 1 mesh from a section of blocks. coloring blocks separately
and when complete will show adding and removing of blocks but it uses memblocks to do this
fubar
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 2nd Apr 2018 08:21
That was a long thread, any idea where I should start looking?
Sincerely,
Max Tillberg
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Apr 2018 08:58 Edited at: 2nd Apr 2018 09:12
start at the end and work back
https://forum.thegamecreators.com/thread/221407?page=13

A much more complex version of this shader may be able to color individual vertices
as it only does the whole object atm



and Santman has a landscape editor which creates the land and texture by modifying a plane
https://forum.thegamecreators.com/thread/221599?page=2 his last post on page 2
but no code
fubar
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Apr 2018 12:30 Edited at: 2nd Apr 2018 12:31
What I think you want is dead easy. Create a plain solid black square the size you want your mesh - so it it needs to be 1000x1000 vertices create your image as 1000 x 1000 pixels. Then use AppGameKit to generate a terrain using that as a height map (agk will create one vertex for every pixel). Once done, create a memblock from that mesh (make sure your subdivisions in the terrain are 0) and you can use the memblock mesh commands to set the positions and normals of every vertices from your data file.

Easy peasy agreeable mesh, and what's best is AppGameKit sets up indices for you too. I love AGK. Lol.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 2nd Apr 2018 13:36 Edited at: 2nd Apr 2018 13:36
@Santman: I couldn't imagine such a nice idea.
puzzler2018
User Banned
Posted: 2nd Apr 2018 13:43
Im on it via memblocks - keep posted on Minecraft thread on occasions for future updates
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 2nd Apr 2018 18:55
I could not use the proposed idea since I do not know where the grids will be positioned, this is generated by an external program. I tried the following code. The position works fine but the rotation is not properly aligned and also causes problems since I divide with 0.

Sincerely,
Max Tillberg
Santman
12
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 2nd Apr 2018 19:26
I'm not sure I follow what you are trying to do, my answer was based on creating a mesh. Is it landscape you are creating?
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 2nd Apr 2018 20:00 Edited at: 2nd Apr 2018 20:03
Just align your plane objects using the LookAt command

SetObjectPosition( i, ResultGrid[i].X0, ResultGrid[i].Y0, ResultGrid[i].Z0 )
SetObjectLookAt( i, ResultGrid[i].X0+ResultGrid[i].dX, ResultGrid[i].Y0+ResultGrid[i].dY, ResultGrid[i].Z0+ResultGrid[i].dZ, 0)




EDIT: Ohhh....and Rhino can export many formats that AppGameKit can load (.fbx, obj and a few others) so you might be able to get your models straight into AppGameKit without any real work.
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 3rd Apr 2018 11:45
Thanks a lot, SetObjectLookAt was so simple and workt perfectly.
Sincerely,
Max Tillberg

Login to post a reply

Server time is: 2024-04-20 08:53:45
Your offset time is: 2024-04-20 08:53:45