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 / Vertex moving of 3d primitive objects

Author
Message
NoteJam
20
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 25th Apr 2005 14:20
Is there anyway we can move vertexs of 3d primitives around in dark basic? I would like to do such a thing under program control in a game.

This would just be one more light show type entertainment graphic.

Seems like it would be a good thing to do at random and figure out how to do it symetrical, as such a program could be factory for creating 3d objects to use for other things.
Tomu
21
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Block C Flat 2 Room 8
Posted: 25th Apr 2005 14:23
look at memblocks

make memblock from mesh

then press f1 to get the help

tomu


Vote "None of the Above" force a re-election!
- 3.4Ghz - 2048MB RAM - RADEON X800SE -
Mike P
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: England
Posted: 25th Apr 2005 16:13
In 5.8 Didn't TGC add some vertex commands? Not sure what they are though...

[center]
Worship Me OR DIE - http://www.ibse.r8.org
Alkoran
20
Years of Service
User Offline
Joined: 19th Nov 2004
Location:
Posted: 26th Apr 2005 03:16
Dunno how it'll be in your version, my version's quite old, I'd use this bit of code to create a FVF338 memblock of the object.

FVF stands for flexible vertex format and is a way in which the vaious information associated with the vertecies can be stored. 338 is a a good one to use as it deals with the information that you're most likely to want to play with and is the one covered in the help files
IIRC the help files layout quite well how an fvf 338 memblock is organised but just incase this is how to read (and write) one.

offset:type:meaning:value
header
0 : DWORD : FVFformat : 338
4 : DWORD : FVFsize the size in bites of each vertex : 36(for fvf338)
8 : DWORD : number of vertices in mesh : 36 for a cube
next comes the vertex elements, each one is constructed as follows, each group of three vertices makes up a poly
NB. this info only applies to FVF 338
+0 : FLOAT : X position
+4 : FLOAT : Y position
+8 : FLOAT : Z position
+12 : FLOAT : X component of normal vector
+16 : FLOAT : Y component of normal vector
+20 : FLOAT : Z component of normal vector
+24 : DWORD : colour of vertex (diffuse) - I'm not too hot on lighting dunno how this works
+28 : FLOAT : U texturing coord
+32 : FLOAT : V texturing coord
NoteJam
20
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 26th Apr 2005 06:14
look at memblocks

make memblock from mesh

then press f1 to get the help

Would you please elaborate on how does one look at a memblock make memblock from mesh?
Think I can manage the f1 key, lol.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Apr 2005 06:20
Quote: "+24 : DWORD : colour of vertex (diffuse) - I'm not too hot on lighting dunno how this works"


You just fill it with the colour from an RGB command. You can also include alpha information in the hi byte if you want to.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
kkzgreen
21
Years of Service
User Offline
Joined: 12th Apr 2004
Location: Nashville, TN
Posted: 26th Apr 2005 08:25 Edited at: 26th Apr 2005 09:10
hey guys

I'm just starting on memblocks.

What is the default FVF format in DBP primitives?

EDIT: Never mind, I figured it out.
Avan Madisen
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: The Castle Anthrax
Posted: 26th Apr 2005 08:46
Update 5.8 DOES have vertex manipulation using what's called a vertex buffer, haven't played with it yet but it should allow very fast real-time vertex manipulation! There's info in the help file for the commands, but no instructions on how to use them, most are fairly self-explanatory.

I don't suffer from insanity - I enjoy every minute of it!
Current Project:
Lemmings Remake
kkzgreen
21
Years of Service
User Offline
Joined: 12th Apr 2004
Location: Nashville, TN
Posted: 26th Apr 2005 10:28
Do any of you know what would be in a memblock made from a mesh that contains limbs?

Would it simply contain the usual data w/o even mentioning the limbs? or would there be a new header?
Avan Madisen
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: The Castle Anthrax
Posted: 27th Apr 2005 07:25 Edited at: 27th Apr 2005 07:25
Converting a limbed object into a memblock loses all limb data, this is because you have to convert the object into a mesh first. Memblocks cannot be used to create limbed objects, only seperate meshes.

I don't suffer from insanity - I enjoy every minute of it!
Current Project:
Lemmings Remake
kkzgreen
21
Years of Service
User Offline
Joined: 12th Apr 2004
Location: Nashville, TN
Posted: 27th Apr 2005 08:06
Thanks
HenriqueLuna
22
Years of Service
User Offline
Joined: 28th Sep 2002
Location:
Posted: 29th Apr 2005 09:54
FVF_XYZRHW = 0x004 : R. W. H. = abbreviation of ?

FVF_XYZB1 = 0x006 : which difference among B1 and B5 ?
FVF_XYZB2 = 0x008
FVF_XYZB3 = 0x00a
FVF_XYZB4 = 0x00c
FVF_XYZB5 = 0x00e

FVF_PSIZE = 0x020 : size of what ?

I am with bugs in the head = ( * ) * Bugs =
does anybody know how to explain this?

Happy Christmas !
Signed : Animallll
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th Apr 2005 21:42
FVF_PSIZE = point size. It only means something when working with point-sprites, which you cannot do with DBPro.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
HenriqueLuna
22
Years of Service
User Offline
Joined: 28th Sep 2002
Location:
Posted: 29th Apr 2005 23:53
OBG P/ AJUDA IanM = Thx
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 30th Apr 2005 00:05
U5.8's vertex manipulation commands are pretty easy to understand.

I 'think' you may have to recalculate normals if you orient faces in different direction, but this example does not do that.



Boo!
Cryptoman
21
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 30th Apr 2005 00:16 Edited at: 30th Apr 2005 00:25
I don't know why, but that program crashes with my 5.8.


Edit: Hmmm, it seems everything doesn't work. I'm going to reinstall.


Cryptoman
21
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Utah Mountains
Posted: 30th Apr 2005 00:38
Tis the oddist thing. None of the new commands work in 5.8 anymore with two reinstalls.


NoteJam
20
Years of Service
User Offline
Joined: 11th Apr 2005
Location:
Posted: 6th May 2005 03:43
Quote: "look at memblocks
make memblock from mesh
then press f1 to get the help
tomu"


I finally figured out what tomu was saying. If you type in your dark basic editor any command, such as memblock,or do this in a listing, and then push the f1 key while cursor is on the command you jump to help on that command.
If more than one command is on the line, hold down left mouse button and drag to highlight just one command, then press the f1 key.
Cool trick Tomu!
Raven
20
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 6th May 2005 04:52
Quote: "FVF_XYZRHW = 0x004 : R. W. H. = abbreviation of ?

FVF_XYZB1 = 0x006 : which difference among B1 and B5 ?
FVF_XYZB2 = 0x008
FVF_XYZB3 = 0x00a
FVF_XYZB4 = 0x00c
FVF_XYZB5 = 0x00e

FVF_PSIZE = 0x020 : size of what ?"


RHW .. can't remember what the RH stand for, it's something weird to do with the name of who created it in Math; but it just means a 4 Positional Vector which is Position + Normal Length.

B1 = XYZB
B2 = XYZBB
B3 = XYZBBB (see the pattern?)

They're used purely for vertex shaders, for carrying additional data. Doubt they work in DBP though.

PSize = Point Size. Typically your Points (Vertex Points) aren't rendered. If you add them though you can change thier size. No idea what you'd use it for, and again I doubt DBP is capable of using them... but fun to know eh?

Login to post a reply

Server time is: 2025-06-04 19:15:45
Your offset time is: 2025-06-04 19:15:45