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.

DarkBASIC Professional Discussion / Projected coordinates in memblock terrains

Author
Message
thyr
17
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 27th Mar 2008 14:28 Edited at: 27th Mar 2008 14:30
hello,

I've been learning about memblock terrains with Kevin Verbeek's code

http://darkbasic.thegamecreators.com/?m=codebase_view&i=ff622260deaf05fa7890237516f9147f

from the codebase. It's extremely useful for those who want to learn this stuff.
Now I'm trying to modify the terrain using the mouse, like a terrain editor, but I don't know how to project the mouse to 3d coordinates. I've found kevil's post
http://forum.thegamecreators.com/?m=forum_view&t=24582&b=6
about extended functions of memblock matrix, I think it's what I'm searching for, but the link to the sourcecode isn't working anymore.
Can anybody tell me where to find these functions, or how to solve the problem?


Thanks!

I am a Maverick hunter. Never know when they're acting against you.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Mar 2008 14:37
That's a great source, 'tis how I learned memblock matrices.

Pick Screen or Pick Object are what your after, very handy, but I suggest you download Tersculpt and look for the Pick Object code in that, as it does pretty much exactly what your trying to do. You can find it in the Program Announcements section, first post has the latest version.


less is more, but if less is more how you keeping score?
thyr
17
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 27th Mar 2008 18:15
Thanks Van B!

It really worked for me!

I never thought it was as simple as



Ok, so now Van, if you don't mind I'm gonna trying some stuff in your soruce code, it looks great and I think I'll learn a lot.

Cheers,

I am a Maverick hunter. Never know when they're acting against you.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Mar 2008 22:04
No problem, That's what it's there for . It's actually a free source terrain editor, so it's there for people to adopt in their own project or even just pick useful bits out.


less is more, but if less is more how you keeping score?
thyr
17
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 28th Mar 2008 17:28
I've been making some experiments with kevin's code, but I've realized that it doesn't use all the functions it has. Anyone that had tried this code can tell me how the functions "prepare_matrix_texture" and "set_matrix_tile" can be used?

Thanks!

I am a Maverick hunter. Never know when they're acting against you.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Mar 2008 19:11
thyr - I recommend you take a closer look at making meshes from memblocks, what FVF formats are, what "Vertex Normals" are and how they work with hardware lighting - (or can be used by shaders) - because you are starting to get into "pro" territory

AT LEAST by knowing more about these things, his code might make more sense and not only will you enjoy that code possibly more - you will start having an idea how to write such things yourself if so inclined.

thyr
17
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 29th Mar 2008 13:03
Ok, you're right jason, I think now I'll look for some tutorials. Byt he way, do you know any useful?

Thanks!

I am a Maverick hunter. Never know when they're acting against you.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Mar 2008 13:58
No I Don't but - SOMEWHERE in these forums - someone made a Pseudo "Code Snippet" that was LESS about the commands and more about how you go about it. This started me down the road of understanding - but note - it took awhile to get ... well... never mastered .. I'm still learning but it took awhile to get decent with it but I WAS VERY HAPPY I took the time to understand it!

(borrowed from another thread - not my creation)


Another Snippet I took for reference


And then you can use set object smoothing if you want the normals to be more even. Of course you would not create and delete the 3 vectors for each poly. For some reason creating and deleting vectors is quite slow. I just create all the ones I will be needing at the top of my code and delete them at the very end.

Also about the Frustum port ... alot of that was added due to DBP being wicked slow at alot of stuff. You may be able to do away with alot of it fo the DGDK without much notice in speed.
[/code]

FVF - Evolved


Welding Verts - Visigoth


(Welding verts I only understand why its beneficial - and the concept - I never dug into the code enough to understand the "process" of making them out of an uwelded mesh.

Hope this is helpful
Jason

calcyman
16
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 29th Mar 2008 14:18
I made this code which did exactly that, but I forgot how to use it:



The optomist's right, The pessimist's right.

Login to post a reply

Server time is: 2024-05-20 00:06:08
Your offset time is: 2024-05-20 00:06:08