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 / 3D issues with 15c

Author
Message
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 10th Nov 2015 05:12
Having a few issues. First, if I create a 128 x 128 grid in Blender, and save it as a .blend, the object won't load.

If I save it as an .obj, I can load it and convert it to a memblock. I can manipulate the vertex positions and save it back to the object.

I cannot manipulate the normals...when I try I end up moving the vertex rather than adjusting the normal. I am saving the object from Blender checking the export normals option and they are in the .obj file.

Known issues? Bugs?
Born. Currently living.
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 10th Nov 2015 15:43
So sorry...worst bug report ever?

I'm using Tier 1.

I was using the built in Vertex, Normal, and UV manipulation commands as part of memblock. The normal and UV commands (again, tier 1) appear to move the vertex instead of modifying the other attribs.

Using an index into the memblock itself worked a bit better. I can set the UV of each vertex by writing floats. Using the same method (obviously a different offset) doesn't appear to affect normals as expected.

If I ripple the grid in Blender and save it as an object Tier 1 will load and display it with correct normals. Still can't manipulate them in a way that makes sense. They either appear to be all up or all down no matter what value's i send normalized. Yes, the variables are floats, and I'm using the method that writes a float to the memblock buffer.
Born. Currently living.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Nov 2015 16:27
better make an small example, if it is a issue/bug maybe paul can look at it too.
u can use "Attach files" here.
AGK (Steam) V2.0.15c : Windows 10 Pro 64 Bit : AMD (15.201.1151.0) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Nov 2015 16:53
Quote: "The normal and UV commands (again, tier 1) appear to move the vertex instead of modifying the other attribs."

Thanks, fixed for the next version

Quote: "Still can't manipulate them in a way that makes sense. They either appear to be all up or all down no matter what value's i send normalized"

I can't replicate this, do you have an example?
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 11th Nov 2015 03:58
Well...I have an example of very buggy normal calculations that I'll just keep to myself...back to the drawing board on that. Thanks for the assist on the first issue.
Born. Currently living.
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 11th Nov 2015 16:40
Fixed. Working realtime heightmap/terrain editor with the ability to also paint on the terrain in realtime. Above 60 FPS. Using Tier 1.

Good stuff this AppGameKit thing
Born. Currently living.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Nov 2015 16:43
Quote: "Working realtime heightmap/terrain editor with the ability to also paint on the terrain in realtime. Above 60 FPS. Using Tier 1. "

Source code or it didn't happen! lol
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 11th Nov 2015 16:56
Quote: "Fixed. Working realtime heightmap/terrain editor with the ability to also paint on the terrain in realtime. Above 60 FPS. Using Tier 1. "


Or at least a video, something to inspire the community.
The coffee is lovely dark and deep,and I have code to write before I sleep.
AJCodes
9
Years of Service
User Offline
Joined: 6th Jan 2015
Location:
Posted: 12th Nov 2015 00:19
No source, no video

But. It's actually really easy.

Create a grid in Blender...I used 128x128 for the first test.

Create a .png in whatever you like...GIMP for me. 256x256.

Load them both in AppGameKit, copy them both into memblocks.

Display the object, use raycasting/collision detection to find out where on the mesh the mouse is. Index into the Memblock based on the x,z position and raise/lower vertices as needed (I do it based on "power" which impacts how big an area to raise/lower as well as the falloff of the effect.

When you're editing the mesh, save the Memblock back to the object...this does cause a FPS hit (I go down to around 25FPS)

Index into the image to paint the image. Update the image and update the object image when that changes...this has little impact to my FPS.

Save the memblock and image as desired after editing I'm using an array of 8 sets of these items as well as some tricky code that lets me paint textures onto the image (which is much larger now to get the level of detail I want...start small though).

The hardest part was figuring out how to index into the memblock as the commands seem a bit buggy right now. All of the (x*128+y)*4 etc, lining that up with how the texture is placed over the object...yuck. Oh, and calculating the normals dynamically. Which, by the way, I will admit that I do in a relatively stupid way that still gives me great FPS. I actually do raycasts around each impacted vertex and average the normals returned instead of the purely mathematical methods that one can use.

Born. Currently living.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Nov 2015 11:27
here some easy dark basic code for a surface normal.
(at this time darkbasic did not support return values as udt/type/struct)

the VNORMAL command get 3 points (clockwise) and return the surface up vector.


AGK (Steam) V2.0.15c : Windows 10 Pro 64 Bit : AMD (15.201.1151.0) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-25 15:49:50
Your offset time is: 2024-11-25 15:49:50