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.

DLL Talk / The Matrix1Utils plugins collection

Author
Message
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 8th Apr 2009 23:49
You could call it a function reference instead of a pointer, and make the set/get functions set and get the name of the function.

Another function I thought of would be to make the entire program event based instead of programmatic. The user would assign different functions to different events, and then would call a command which would take over control completely.
There would be callbacks for mouse movement, clicking, key presses, and also callbacks which execute every 'n' milliseconds.

While no functions need to be executed, the command would run a 'nice sleep'.

It would be especially useful for applications where you want to get maximum speed when you need it, but not hog the CPU when you don't.

A command to set the window shape would be good too.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Apr 2009 00:22
Quote: "You could call it a function reference instead of a pointer, and make the set/get functions set and get the name of the function."

So don't allow function pointers at all, just allow DBPro function names and DLL+Function names instead - that's not a bad idea.

Quote: "make the entire program event based instead of programmatic"

You can do all that right now. In fact, I already have code for most of what you've suggested already as I've been writing an experimental game for demoing these plug-ins, although it's really turning into a function pointer showcase.

Keyboard is handled with two layers - keys are set to a certain detection mode (key down, on key press, on key release, toggle key). Once the mode for the key is triggered, that in turn triggers an event (eg, both the W key and the up key could trigger a 'move forward' event), and recently I added the ability to call a function pointer on the event trigger. It needs a little more, but the basics are there.

There are pre-sync and post-sync function calls, with priorities attached:


The only moving objects right now are bullets, which are currently triggered by a timer and a key event:


... The AddBullet function call is a little verbose right now, but the idea is that the method of movement is specified as a string (eg, Standard, CurveLeft, CurveRight), and that causes the appropriate functions to be called:


You can see the pre-sync setup for calling UpdateBulletsEvent, which calls UpdateBullets, which calls the function related to the current bullet - all happening automatically every SYNC without needing any code wrapped around the SYNC.

cguy
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: In my Computer!
Posted: 11th Apr 2009 22:44
What exactly does the open console command do? What is it used for?

Do we all have to put stupid jokes here?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Apr 2009 00:18
What happened when you tried it?

Basically it opens a console text window that you can display text on. Itcan be used as a fairly primitive debug option (primitive in that there are better options available in these plug-ins), or a primitive text display.

cguy
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: In my Computer!
Posted: 12th Apr 2009 01:23
Thanks, I figured that just by the other commands in that section. Just not making any assumptions!

Do we all have to put stupid jokes here?
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 15th Apr 2009 09:38 Edited at: 15th Apr 2009 21:17
Hey IanM, two ideas for your excellent utilities.

1) On the object grouping, I've worked out a little modified version that allows objects to be assigned to each other, as in a parent-child style relationship. This is very useful for managing dependent groups of objects. One example would be stars-->planets-->satellites. There are far more uses - such as buildings-->furniture-->smallStuff, perhaps for un-excluding objects within the building when the building is entered. Below is a little demo of this coded in DBPro. It works pretty fast (it's the 2D lines that are slowing things down - rem them out to see).




2) Based on the above work, it seems that the Split String could be expanded to include a form of data-storage. As you can see in the above code, string data was used to store the variable length array of data of children and parents for each object. This, of course, all came from your post a few back when you talked about storing data in strings and how fast your string manipulation is. So, here it is in a little more formal format. The ability to add data, modify data, and read data (I have not included a delete function). I have not tested this yet, but I expect this is slow and may ultimately have memory leak issues. But this code should be enough to demo what the heck I am talking about.




Open MMORPG: It's your game!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Apr 2009 19:34
If you remove those restrictions from your source code (either by switching to a more permissive licence such as MIT or new BSD, or by explicitly allowing people to statically link to your library code instead of dynamical linking), I'll take a serious look at what you've written.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 15th Apr 2009 21:20
I thought the LGPL from GNU was pretty permissive. I removed it - I don't really care myself, I just wanted folks that contributed to the OMMORPG project to receive credit if they so desired. That export is my own source (based soundly on advice you gave me ), so no problems in removing it.


Open MMORPG: It's your game!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Apr 2009 21:33
Either of those licenses I suggested allow you to claim credit for the code and require the copyright notice to stay with the source code forever, even if someone later includes the code in one of the GPL licenses.

Personally, I don't have a problem with the LGPL license - it's just that it requires people who use your code to give out their code too or avoid using your code altogether (at least with DBPro code, which can only statically link). In fact, it may still be a good idea to use it in your OMMORPG project for that very reason.

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 15th Apr 2009 22:45
Quote: "it's just that it requires people who use your code to give out their code too"


I used the Lesser GPL (LGPL), which excludes the requirements of the GPL to continue using the same license with derivative works and give out their work for free. Maybe that's been the issue causing folks to steer clear? Hmmm...


Open MMORPG: It's your game!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Apr 2009 22:58
You need to read that license again. It allows you to link dynamically, which isn't possible in DBPro.

Read paragraph 3 of the 'differences' section of this page: http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Differences_from_the_GPL

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 16th Apr 2009 04:37
http://www.gnu.org/licenses/gpl-howto.html

It's on Wikipedia - I see that. But I don't see it on GNU's site, which is probably the one that counts. I will have to study this more. But I will likely switch to something that is a little less ambiguous anyway. For now, to get this back on topic, the copyright/copyleft is released, so have at it.


Open MMORPG: It's your game!
Uechi
18
Years of Service
User Offline
Joined: 2nd Sep 2006
Location:
Posted: 17th Apr 2009 03:37
I get the message "Could not understand command" for the
set array format command from the sample program
I installed the latest Matrix1 utilities -what should I do?

` Here's the format string definition for the above type - 0 is integer, 2 is string
` See the help for SET ARRAY FORMAT for a full list of the types
global MyData_format as string = "020"


` Define the array, and set its format
dim MyData(ROWCOUNT) as MyData_t
set array format MyData(), MyData_format
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Apr 2009 14:25
You don't need to use 'set array format' any more, the plugin works it out by itself

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Apr 2009 15:04
Yep, just remove the command altogether. The array format is now determined entirely automatically due to changes that Lee made in 7.1 that I requested at the last convention.

@RiiDii,
I took a copy of each piece of code last night and I'm currently giving the code a good working over.

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 19th Apr 2009 11:59
Is there any way to do the below array alteration with your plugin?


Second question:
Quote: "Matrix1Util_18 - 1.1.0.6
- Addition of multi-limbed planes.
-- Current design is to allow 1 texture per limb - this may not be what's generally needed and may change later.
-- In addition, width and depth must be positive values.
- Internal reorganisation of code."


I dont see the command for multi-limbed planes in the help files, how is it done?

There is always one more imbecile than you counted on.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Apr 2009 18:13
Quote: "Is there any way to do the below array alteration with your plugin?"

Here's the nearest you can get:


Quote: "I dont see the command for multi-limbed planes in the help files, how is it done?"

I forgot to add the help for it, that's why

The command is MAKE OBJECT PLAIN (don't use the alternate spelling of PLANE - I forgot to add that too!), it has the same arguments as the commands of the same name in my plug-ins, with the addition of two more for the number of limbs across and down which appear either at the end of the argument list, or just prior to the FVF argument.

MAKE OBJECT PLAIN Object No, Width, Depth, Row Count, Column Count, Limbs X, Limbs Z
MAKE OBJECT PLAIN Object No, Width, Depth, Row Count, Column Count, Limbs X, Limbs Z, Fvf

This command isn't yet as flexible as the others - All arguments must be positive values.

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 19th Apr 2009 19:21
Awesome, the array thing really is a short cut.

And the new plain is really great.

thank you

There is always one more imbecile than you counted on.
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 22nd Apr 2009 23:53
@ IanM,

With the Limb commands could you make a nice and easier command to change the mesh of one of the limbs in an object? perhaps by name as an option?

Just a thought.

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Apr 2009 00:36
The DBPro CHANGE MESH command already allows you to change an existing mesh. I did add an alternate form of that command that also allows you to change the name of the limb at the same time if you wish.

Combining that with the GET LIMB BY NAME function should be fairly easy.

I can't combine the two any further, because it's possible for you to have multiple limbs of the same name with an object - do you change the first one that matches, or all matches? That's why there are several forms of the GET LIMB BY NAME function that also include a parameter for a starting limb number.

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 25th Apr 2009 13:02 Edited at: 25th Apr 2009 13:03
I dont think if this is possible, but is there anyway we can do the following with your fantastic DLL?



There is always one more imbecile than you counted on.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Apr 2009 19:33
In general, no. In DBPro, all types are static (ie, fixed at compile time), however arrays themselves are a strange mixture of both static and dynamic type.

What I mean is that although the type is fixed within the compiled code, there's nothing to really stop you linking an array of type x to an array of type y - you have to ensure that the fields you access are both in the same position in both types for meaningful access and to avoid potential crashes, but apart from that it will work just fine.



In addition, my plug-ins use the underlying type of the array, not the static type, so they will operate correctly when for example sorting a multi-field array, even if linked as an integer array.

BTW, the 'if 0 then dim...' is a performance enhancement - DIM itself will allocate memory for the array, then the LINK ARRAY will deallocate that memory before it links in the array pointer. That's all a waste of time. If you set up the code in the way shown, the array exists as an entity within the code, but never gets executed at runtime, which despite the extra IF and comparison, is faster, especially if you are linking a lot of arrays.

There's also no need to UNDIM an array that's been unlinked either.

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 25th Apr 2009 19:57
Nice.
But in my case, the types im using are more complicated than this. So it wont work i suppose.

Anyways, thank you

There is always one more imbecile than you counted on.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th Apr 2009 20:07
It's possible for me to write some commands that will allow setting of arrays by field numbers rather than name - that way they're set within the more dynamic environment for arrays.

In the shorter term though, there's nothing to stop you doing this yourself. You have:
- the number of fields (GET ARRAY FIELD COUNT)
- the field types (GET ARRAY FIELD TYPE) so you know the type and size
- the offset of each of the fields within the UDT (GET ARRAY FIELD OFFSET)
- you know the address of the UDT (GET ARRAY ITEM PTR)
- you can peek & poke raw memory (eg PEEK INTEGER, POKE INTEGER)

With all of that you can manipulate the contents of the UDT within an array in any way you want, no matter what UDT the array is based on.

Anything I write for this (if I do) will use exactly the same techniques and will work in the same way, except that it will be faster.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Apr 2009 02:44
Quote: "except that it will be faster"


And that is why we all keep coming back here - we can all write slow, ponderous, inefficient code - but we can't all write clean efficient code.

Now I'm off to find your latest version so I can install it on my Vista machine.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 30th Apr 2009 11:39 Edited at: 30th Apr 2009 14:01
Agreed, I love the whole set

I do have one question though ... I am really needing to use your new make object command for an open source project (the .3dw importer for DBP to create terrains and brushes with welded verts) but there is also a port to DGDK and will be one to DGDK.net when finished. Can the DGDK and DGDK.net folks use your plugins? If not I need to find a way to make my own make object command to mimic yours. Right now I'm using the make object plane with rows and columns to give me all the indexs and vertexs I need then removing the excess. But sometimes the objects don't display right like they do when I use your command 0_o

[edit] Well NM I found a typo in my code ... but it still would be nice to know if these will ever be accessable to the other products in case I ever move up in the world.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Apr 2009 15:31
Maybe. Jason P Sage asked the same kind of question back at the beginning of the year.

The biggest issue with doing it is finding the time and enthusiasm to do it - When things are light at work, it's easy, but when things are a little more busy (as they are now) it's difficult to do more coding in the evening after doing it all day (hence the relative lack of updates lately).

Also, I don't want to end up with two different copies of the source code - one for GDK and one for plug-ins. Plus it might actually be much better go give access to objects I use internally rather than force access through a set of standard C-type functions using id numbers. I may also need to replace the build system so that it works correctly for both plug-ins and .lib files.

So, the 'lowered' enthusiasm, the extra thought needed in the design, all the possible code changes needed and the alternate build system just to give equivalent utility are all conspiring against things here.

So, maybe.

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 30th Apr 2009 16:58 Edited at: 30th Apr 2009 16:59
I guess I'll cross that bridge when I get there But for now man the plugins rock. I use them in my personal projects all the time. Thanks a million. The fast string commands you added really boosted all my load times I use them in my open source stuff if it is in a nonessential way so the codes can still be ported.

On a side note ... I am however extremely dissappointed in welding verts. It took me 3 days of every bit of my spare time to get it working properly ... and there was no performance boost LOL. I even lost 1 FPS.

42,626 poly terrain with 127,878 verts runs at 41FPS
42,626 poly terrain welded with 26,343 verts and 127,878 indexs runs at 40FPS *eye twitches*

But anyway Thanks for the awesome plugins

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th Apr 2009 19:40
@IanM
Couldn't you just use some #defines to check whether it is GDK or DBP for the bits that need to change?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Apr 2009 19:56
It's not quite that simple.

All of my plug-ins interface with DBPro using my original interface library, for example:


I could wrap that in defines:

... but to do that everywhere for every DBPro function would be a nightmare both to do initially, and to maintain from that point on.

So what I think I'll do instead is create a DBPro namespace with inline functions for every GDK function I need to access so that it will convert from my naming convention to the GDK naming convention, pop all that into a file, and include the correct file:


It won't be too hard, just time consuming and boring - and that's just a very small part of what needs to be done.

So rather than just rush in, I'll be thinking about it a bit and (hopefully) doing the whole job right first time. From my point of view, there's absolutely no need to rush as I still don't use the GDK all that much.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st May 2009 20:14 Edited at: 1st May 2009 20:15
@IanM



IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st May 2009 23:05
Fine, except:
- the naming conventions are different between GDK and my interface library. What you've suggested requires that they are identical.
- in means trawling through all of my code changing every DBPro call. That's just an invitation to introduce problems.

My ideal aim will be to use the existing code, unchanged, and simply switch compilation settings when needed.

Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Australia except on Tuesdays
Posted: 11th May 2009 15:03
Hi
Just discovered your collection looks great I believe I have installed everything correctly the problem is I get 2 conflicts when I try to compile anything.

1) GET ARRAY TYPE in Matrix1Util_29.dll and dbprocore.dll
2) TRIM$ Matrix1Util_16.dll and StyxCore.dll

What have I done wronge
Can you help me resolve this

Thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th May 2009 15:29
1. You must be using an older version of my plug-ins with a newer version of DBPro. Lee implemented his own GET ARRAY TYPE function so that I no longer needed to.

You should ensure that you have downloaded the 7.1 version for DBPro 7.1 and above, or the 7.0 version for DBPro 7.0 or prior.

2. Sorry, but I'm not going to fix that one. You'll need to pick one to keep and move the other one to one side.

If there's something in STYX you are using that I have no equivalent for, then kiip STYX. Otherwise, you should keep mine because its string handling is far faster.

Ratall
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location: Australia except on Tuesdays
Posted: 11th May 2009 15:51
Thanks Ian
I some how picked up the 20080420 version of you utils Corrected now have 20090328 as for the conflict with STYX it has help Me make up my mind on droping it(STYX). My new pc runs VISTA(64) and the few of STYXs commands that I use crash halve the time anyway. Hopefully yours are more resilent

The closer I look at your command set the better it looks great your hard work really appreciated.

Rick
Overdroid
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 21st May 2009 20:17
I would like to add my voice to the many others offering kudos for this plugin. Great work!

Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 23rd May 2009 21:50
LOW priority command requests, because I might be the only one affected:

1. In Matrix1Util_15 (Input Options), a slightly expanded version of the DBP "POSITION MOUSE" command with a third argument, namely the Z (wheel) position. You can use the current DBP command to reset the mouse X,Y position without physically moving the mouse. However, there appears to be no way to reset the wheel value without physically spinning the wheel back to the point where it was when you first moved it, which is really annoying. There are workarounds with separate variables, but they are also annoying.

2. In Matrix1Util_07 (General Functions), alternatives for the DBP hyperbolic functions HSIN, HCOS, HTAN, and which correctly take the argument as a distance. DBP thinks that the argument for hyperbolic functions is an angle, although I do not believe that anyone else does. Consequently, DBP expects what would normally be a distance to be converted ahead of time into degrees as if the distance were a radian. So, the value DBP returns for HSIN(x#), for example, does not equal the correct value that DBP would return for the more complicated definition of the hyperbolic sine, namely (EXP(x#)-EXP(-x#))/2. I griped about this for awhile, but the furthest I got was provoking an addition to the help files which explain the strange DBP requirement (rather than correct it). Maybe call them HSINc (c for "correct"), etc.
Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 5th Jun 2009 20:30
Ok, so I'm switching over to darkGDK and wonder how I will read the binary files created with your file I/O plugin? I'm not planning on converting my editor that creates these files to GDK as I only have this one life.

This message was brought to you by Grandma industries.

Making yesterdays games, today!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Jun 2009 20:43
Just use binary reads/writes using either the C file I/O, the C++ file I/O classes, or even Windows file I/O API - there's nothing special about the files created using that plug-in.

Grandma
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location: Norway, Guiding the New World Order
Posted: 5th Jun 2009 20:57
Yes I'm trying out the "fstream" library and see how that goes, but as I'm fresh to C++, I don't know the steps involved in reading a string. I'm sure I can figure out byte, float etc, but strings aren't a fixed size? fstream wants me to input a certain number of bytes to read/write.

This message was brought to you by Grandma industries.

Making yesterdays games, today!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Jun 2009 22:11
Reading of strings depends on how you wrote them out.

If you wrote them using the default settings or any of the delimited modes (0 to 3), then you could use the std::getline() function, and where relevant, include the third parameter that specifies the line delimiter.

If you wrote them using modes 4, 5 or 6 then you can read the length first (as an unsigned byte, word or dword) followed by the string data itself.

Given a little time, I'm willing to write you a function that when given a ifstream, a mode and an std::string parameter, will read the string from a file written using the file plug-in

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 12th Jun 2009 16:25
Hey IanM,

There are Function pointers and arguments commands in matrix_20
Can you elaborate on the usage of these please.

I need to find the total arguments number in a function and the type of each argument (string, integer..etc.)

Also if the function returns something, i would like to know what it is as well.

Whether user made function or a plugin function.

Also, Arglist String() command is borked, the compiler doesnt recognise the command.

There is always one more imbecile than you counted on.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Jun 2009 19:42 Edited at: 12th Jun 2009 19:43
Quote: "I need to find the total arguments number in a function and the type of each argument (string, integer..etc.)"

Then you will have to look elsewhere I'm afraid. To get these functions to work, you have to do exactly the opposite - you need to tell your function what types to look for.

Here's an incomplete DBPro version of the printf function as an example:


(Could be made faster by searching for % signs rather than dealing with everything on character at a time, but this is only an example.)

Quote: "Also if the function returns something"

The arglists are input only, and functions can only return one type of value.

You might want to take a look back in this thread for variant types - I'm sure it was you I discussed it with. [EDIT - Actually, it was RiiDii]

You could return a double integer that encodes the type and a value or address to find the value. Or you could return a pointer to the data and type.

There are a few possible variations that will allow you to get past the fact that DBPro is a statically typed language.

Quote: "Arglist String() command is borked"

Typo in the help - that should be ARGLIST STRING$()

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 15th Jun 2009 14:51 Edited at: 15th Jun 2009 14:55
Could you help alittle with the blend mapping commands please.

Below code lerps 2 textures(i suppose) according to the light in scene.



But i want it to blend according to the gradient map instead.

Also, neither dbpro's own help files, nor any developer of dbpro has explained the correct usage of blend mapping yet. The new beta update has a snippet but its not very explaining either.

Maybe you can elaborate on this topic alittle bit and enlighten us?

1-I would like to be able to blend 2 textures according to an alpha map.
2-I would like to do the above for 2 uv texture stages individually and then blend the 2 outcome with a 3rd alpha map and meanwhile i can scroll or scale the 2 individual uv stages differently.

Thanks in advance.

There is always one more imbecile than you counted on.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Jun 2009 03:25 Edited at: 18th Jun 2009 03:26
First of all I would like to say that your plugin is great-- no DBP coder should be without it . However, I have one small request-- could you possibly allow the WRAP command to work with floats? It doesn't seem to right now...


<-- Spell based team dueling game!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 18th Jun 2009 10:31
Do you really need a plugin to wrap a float? Why dont you just do this?



There is always one more imbecile than you counted on.
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 18th Jun 2009 13:28
Your code is wrong, Cucumber: first of all, if n is 361, it should return 1 and not 0. Moreover, it doesn't take the negative numbers in account.
Phjon
18
Years of Service
User Offline
Joined: 28th Nov 2005
Location:
Posted: 18th Jun 2009 15:02 Edited at: 18th Jun 2009 15:04
Sixty Squares,

If you re-write your code like this...



...then it will work.

If you are working with floats in DBPro, and a literal value in the calculation is not a float (i.e. a value is written as "1" instead of "1.0"), then DBPro will assume integers throughout, thereby generating the unexpected results.

It also seems that the "Wrap()" command doesn't automatically convert integers to floats, even if at least one float is present in its argument list. This however might be an intended behaviour.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Jun 2009 15:22
The problem (if it is a problem) is with DBPro's selection of the correct function depending on the parameter types. It sometimes comes up with unexpected selections, which is probably my fault for trying to get it to do something it wasn't designed to do.

Quote: "Do you really need a plugin to wrap a float?"

No, not unless you are doing it a lot

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Jun 2009 18:35
Got it thanks guys

<-- Spell based team dueling game!

Login to post a reply

Server time is: 2024-11-22 04:56:10
Your offset time is: 2024-11-22 04:56:10