DreiDe - 3D Engine

BlitzMax Forums/BlitzMax Programming/DreiDe - 3D Engine

Vertex(Posted 2005) [#1]
I have worked last days on a new version of DreiDe. "DreiDe" is german and the written out version of "3D".

The engine based ob OpenGL, so it will work on Linux and MacOS. It is structed out as Blitz3D, but not compatible. Its fully object orientaded.

Features:
- Entitysystem with parent/child
- Materialsystem
- Alphablending(depth sorting comming soon)
- MIPMapping
- Multitetxuring(work yet not perfekt)
- Dot3 Bumpmapping(not tested)
- Spheremapping
- Cubemapping
- Fog
- Orthogonal rendering(not tested)
- Surfacesystem based on highspeed VertexObjectBuffers
- Object orientaded
- License: Public Domain
- Platform independently
- Nice code I thing :)

Planned:
- Lightsystem
- Terrainsystem with LOD
- Spritesystem
- Animationsystem
- Any loaders for 3DS, X, MDS, MDC and so on
- Shader for materials
- Documentation
- and so on ..

Screenshot:


Download:
Version 2.11 http://vertex.art-fx.org/dreide221.zip includes the example you have seen bellow.

mfg olli


Picklesworth(Posted 2005) [#2]
Win32 too, right?
Looks nice :)


nawi(Posted 2005) [#3]
neat


Vertex(Posted 2005) [#4]
Mr. Picklesworth: Yes ;)

http://vertex.art-fx.org/dreide222.zip <- new version with 3DS-Loader.

The loader support ambient-, diffuse- and specularcolor, shininess, uv-offset, uv-scale, rotation(texture) and multitexturing. It does not support smoothinggroup/normals and animation. So planned support for this and maskmaps, reflectionmaps and bumpmaps.



cu olli


Robert(Posted 2005) [#5]
Hi Vertex,

The textures supplied with your model make the 3DS Loader very slow because they have to be resized.

- Resize the original textures to power-of-two images
- Add a FlushMem at the end of the main while loop in T3DSLoader.Load

Original Loading Time: 1451ms
Loading Time After Changes: 276ms


Vertex(Posted 2005) [#6]
Thank you!
I have done http://vertex.art-fx.org/dreide222.zip .

Before: 926 ms
Now: 76 ms

cu olli


LarsG(Posted 2005) [#7]
Hey Vertex... still going at it with DreiDe I see..
How's the progress coming along?!
Have you tested this with a larger project?
Any clues on the performance of the engine?


Panno(Posted 2005) [#8]
This is an ugly 3ds object vertex !!!! :)


FBEpyon(Posted 2005) [#9]
Is there plans to add in Cell Shading I was wanted to make a game using it.

Also I can seem to get the mod to work Im getting a error.
Can't find interface "pub.dreide"


Vertex(Posted 2005) [#10]
Panno: tzzzz :)

FBEpyon: Cell shading is easy as Blitz3D, but with supported VertexShader (a.k.a VertexPrograms) it runs faster.

You must copy the dreide.mod in the pub.mod directory, than open the BlitzMaxIDE and press Alt+D for build modules. I don't upload the compiled version, becouse other platforms as Windows.



This is the new version with SmoothNormal function, and fixed bug in the texturemodule.

I have found the bug in multitetxuring, but there are any complications. If I will fix this bug, then I will upload a new version of DreiDe.

cu olli


Vertex(Posted 2005) [#11]
New version http://vertex.art-fx.org/dreide230.zip .

- Multitexturing works correct
- Dot3 Bumppaing too I thing(I must make a example)
- New method "SmoothNormals" in the TSurface-Module
- Fixed bug in the TMaterial-Module

Example for Multitexturing:
Strict

Framework Pub.DreiDe
Import Brl.FileSystem
Import Brl.PNGLoader
Import Brl.Pixmap
Import Brl.System

Global Pixmap   : TPixmap
Global Texture  : TTexture[2]
Global Material : TMaterial

Global Mesh    : TMesh
Global Surface : TSurface
Global Camera  : TCamera

TDreiDe.Graphics3D(640, 480, 0, 0, False)

Pixmap = LoadPixmap("Layer0.png")
Texture[0] = New TTexture
Texture[0].SetPixmap(Pixmap)
Texture[0].SetBlendMode(DDD_TEXTURE_REPLACE)

Pixmap = LoadPixmap("Layer1.png")
Texture[1] = New TTexture
Texture[1].SetPixmap(Pixmap)
Texture[1].SetBlendMode(DDD_TEXTURE_ADD)

Pixmap = Null
FlushMem()

Material = New TMaterial
Material.SetTexture(Texture[0], 0)
Material.SetTexture(Texture[1], 1)

Mesh = New TMesh
Surface = Mesh.CreateSurface()

Surface.CreateVertex(-0.5,  0.5, 0.0, 0.0, 0.0)
Surface.CreateVertex( 0.5,  0.5, 0.0, 1.0, 0.0)
Surface.CreateVertex( 0.5, -0.5, 0.0, 1.0, 1.0)
Surface.CreateVertex(-0.5, -0.5, 0.0, 0.0, 1.0)

Surface.CreateTriangle(2, 1, 0)
Surface.CreateTriangle(0, 3, 2)

Surface.UpdateVertices()
Surface.UpdateTriangles()

Surface.SetMaterial(Material)

Camera = New TCamera
Camera.SetPosition(0.0, 0.0, 2.0)

While Not KeyDown(KEY_ESCAPE)
	Texture[0].Turn(0.1)
	Texture[1].Translate(0.001, 0.0)
	
	Camera.Render()
	TDreiDe.Flip()
	FlushMem()
Wend

TDreiDe.EndGraphics()
End


Layer0.png:


Layer1.png



LarsG(Posted 2005) [#12]
this engine is really coming along very well.... I like it..

Vertex: do you think you could perhaps find the time to make some more examples?
It seems like there's quite alot to this engine now, but you're only showing one or two examples..
I'm sure it would be enough to supply the sourcecode for the examples.. (and a shared media directory or something)
shouldn't add too much to the archive?!?


fredborg(Posted 2005) [#13]
Very good Vertex!

I added Modulate2X blendmode to the texture mod:



BlitzSupport(Posted 2005) [#14]
Looking good!


Vertex(Posted 2005) [#15]
Thx!

Fredborg: thank you! Thats a good blendmode for lightmaps.

http://vertex.art-fx.org/dreide231.zip
with fixed simple bug in the 3ds loader and added DDD_TEXTURE_MODULATE2X from Fredborg

http://vertex.art-fx.org/dreide_examples.zip
with media, show you how to use:
- 3ds loader
- cubemap
- fog
- info
- multitexturing
- parent-child
- spheremap
- surface

cu olli


orgos(Posted 2005) [#16]
I have problem installing Dreide module.

I copy the mod on the pub.mod folder but when i pres Alt+D the Ide show this message:

Building Modules
Compiling:blitz_app.c

Process complete


And when i see on the Dreide folder, no compiled files apear on it.

I have the lastest version of BMax.


LarsG(Posted 2005) [#17]
you've got MingW installed?


orgos(Posted 2005) [#18]
Nop, then when i post the message i supose that.


LarsG(Posted 2005) [#19]
hehe... take a look at Mark's installation instructions..

http://www.blitzbasic.com/Community/posts.php?topic=44537&hl=mingw


fredborg(Posted 2005) [#20]
Vertex, it seems the multitexturing is broken in the new version... In the example I get a black box which flashes.


Panno(Posted 2005) [#21]
yap multitexturing is broken .. same black box here

but the Pissvogel looks now much better :)


good work


fredborg(Posted 2005) [#22]
Hi,

Ok, found the problem with multitexuring.

- Fixed Multitexturing error (it was in TSurface.Render)
- Fixed DDD_TEXTURE_BLEND error in TTexture.Render()
- Added TTexture.SetCoordset() and TTexture.GetCoordset()

TTexture.SetCoordset allows you to set which uv set a texture uses. Same as Blitz3D TextureCoords. Only uvset 0 (default) and 1 is available (just like in Blitz3D)

Below is the code update:

Texture.bmx:


Surface.bmx:



orgos(Posted 2005) [#23]
I have some problem.

I install the MinGW, and then i set my path enviroment variable tha main MinGw path c:\MinGW and c:\MinGW\bin

When I see the menu, the options apear diabled, and when I press Alt+D has the same output.

Building Modules
Compiling:blitz_app.c

Process complete


And the module is not compiled.


Kev(Posted 2005) [#24]
this is looking great Vertex, im having problems with multitexturing example though, i just get a spinning black cube. im using latest drivers. my gfx is radeon 9550 256mb

*EDIT just seen other ppl also having this problem. fredborg code fixed it.

kev


fredborg(Posted 2005) [#25]
Hi,

I added some funky stuff :) The ability to use the Max2D commands in combination with DreiD, very cool. Only change you need to make to your source code is to use Flip and EndGraphics instead of the TDreiDe equivalents.

Here's the modified DreiDe.bmx:


And an example:

I slowed down the example because it's much too fast on my machine :)


Vertex(Posted 2005) [#26]
Wow, it's realy cool stuff Fredborg!

http://vertex.art-fx.org/dreide240.zip
http://vertex.art-fx.org/dreide_examples.zip

Whats new?
Fredborg:
- Fixed Multitexturing error (it was in TSurface.Render)
- Fixed DDD_TEXTURE_BLEND error in TTexture.Render()
- Added TTexture.SetCoordSet() and TTexture.GetCoordSet()

- TDreiDe.Flip() -> Flip()
- TDreiDe.EndGraphics() -> EndGraphics()
- Added TDreiDe.UseMax2D()

Vertex:
- New TVertexProgram Module
- Added some commands to TSurface for VertexAttributes to use in a VP
- Added SetVertexProgram(), GetVertexProgram() to TMaterial
- Just see the example in dreide_examples.zip

Toonshading:
!!ARBvp1.0

# Toonshader by Oliver Skawronek

# Matrices
PARAM ModelViewInv[4]        = { state.matrix.modelview.invtrans };
PARAM ModelViewProjection[4] = { state.matrix.mvp };

# Temporary variable
TEMP Position, EyeNormal, UVCoords, Cond, Result;

# Transform VertexPosition
DP4 Position.x, ModelViewProjection[0], vertex.position;
DP4 Position.y, ModelViewProjection[1], vertex.position;
DP4 Position.z, ModelViewProjection[2], vertex.position;
DP4 Position.w, ModelViewProjection[3], vertex.position;

# Transform VertexNormal
DP3 EyeNormal.x, ModelViewInv[0], vertex.normal;
DP3 EyeNormal.y, ModelViewInv[1], vertex.normal;
DP3 EyeNormal.z, ModelViewInv[2], vertex.normal;

# Copy VertexTexCoords in to UVCoords
MOV UVCoords, vertex.texcoord;

# U-Coord of Vertex = Dot Product between EyeNormal und LightDirection
DP3 UVCoords.x, EyeNormal, program.local[0];

# If UVCoord.x < 0.0 Then UVCoord.x = 0.0
MOV Cond.x, 0.0;
MOV Cond.y, UVCoords.y;
MOV Cond.z, UVCoords.z;
MOV Cond.w, UVCoords.w;

SGE Result, UVCoords, Cond;
MUL UVCoords, UVCoords, Result;

# Output the result
MOV result.position, Position;
MOV result.texcoord, UVCoords;
MOV result.color, vertex.color;
MOV result.color.w, 1.0;

END


Local Program Parameter 0 is the LightDirection see VertexProgram.SetLocalParameter().

Screenshot:


http://delphigl.com/script/do_show.php?name=gl_vertex_program_arb&action=2 <- german tutorial for VPs

Errors:
- Cubemapping does not work yet becouse Max2D(don't know why)

Bumpmap-VP and FragmentProgram-Support comming soon...

cu olli


fredborg(Posted 2005) [#27]
Hi,

Download link doesn't work!

Are you working on adding lights? Otherwise I'll add them (already have them working)...


Vertex(Posted 2005) [#28]
http://vertex.art-fx.org/dreide240.zip

Works now...

Tomorrow I will drive to my girlfriend for 4 days, than I will debug cubemapping and begin with the lightmodule becouse I have an old version of TLight.

Currently working on a Bumpmap-VP.

cu olli


Vertex(Posted 2005) [#29]
http://vertex.art-fx.org/dreide_examples.zip

Width bumpmapping example!



VP:
!!ARBvp1.0

# Bumpshader by Oliver Skawronek

# Matrices
PARAM ModelViewInv[4]        = { state.matrix.modelview.invtrans };
PARAM ModelViewProjection[4] = { state.matrix.mvp };

# Temporary variable
TEMP Position, EyeNormal, Distance, Dot3, Color;

# TFormPoint
DP4 Position.x, ModelViewProjection[0], vertex.position;
DP4 Position.y, ModelViewProjection[1], vertex.position;
DP4 Position.z, ModelViewProjection[2], vertex.position;
DP4 Position.w, ModelViewProjection[3], vertex.position;

# TFormNormal
DP3 EyeNormal.x, ModelViewInv[0], vertex.normal;
DP3 EyeNormal.y, ModelViewInv[1], vertex.normal;
DP3 EyeNormal.z, ModelViewInv[2], vertex.normal;

# Distance = LightPosition-VertexPosition
SUB Distance, Position, program.local[0];

# Normalize
DP3 Distance.w, Distance, Distance;     # w = x*x+y*y+z*z
RSQ Distance.w, Distance.w;             # w = 1.0/sqrt(w)
MUL Distance.xyz, Distance, Distance.w; # x = x*w, y = y*w, z = z*w

# DotProduct
DP3 Dot3.x, EyeNormal, Distance;

# If DotProduct# < 0.0 Then DotProduct# = 0.0
SGE Dot3.y, Dot3.x, 0.0;
MUL Dot3.x, Dot3.x, Dot3.y;

# Calculate Color
MUL Color.x, Distance.x, Dot3.x;
MUL Color.y, Distance.y, Dot3.x;
MUL Color.z, Distance.z, Dot3.x;
MOV Color.w, vertex.color.w;

ADD Color.x, Color.x, 1.0;
ADD Color.y, Color.y, 1.0;
ADD Color.z, Color.z, 1.0;

MUL Color.x, Color.x, 0.5;
MUL Color.y, Color.y, 0.5;
MUL Color.z, Color.z, 0.5;

# Output the result
MOV result.position, Position;
MOV result.color, Color;
MOV result.texcoord, vertex.texcoord;
MOV result.texcoord[1], vertex.texcoord[1];

END

Lightposition ist VP Local Parameter 0.

cu olli


Picklesworth(Posted 2005) [#30]
This is... happening fast.
How stable is it at the moment?


SillyPutty(Posted 2005) [#31]
wow guys, awsome stuff !


Vertex(Posted 2005) [#32]
Mr. Picklesworth: If it's run, it's stable :)

Deux: Thx!

http://vertex.art-fx.org/dreide241.zip
http://vertex.art-fx.org/dreide_examples.zip

Added FragmentProgram Support!
Added Plastic Example!


left DreiDe with ARBvp1.0 and ARBfp1.0, right RenderMonkey width VertexShader 2.0 and PixelShader 2.0.

http://www.devmaster.net/forums/index.php?showtopic=3570&pid=19079&st=0&
Water-Shader

cu olli


Red Ocktober(Posted 2005) [#33]
i second that... it really looks great guys...

question... what kind of visibility methodolgy are you using... is there any kinda scene graph... or is it totally GL occlusion stuff...

--Mike


degac(Posted 2005) [#34]
danm! new version give me this error when I try to compile module:

"Compile Error: Identifier "VPSupport" not found

AAARGH!!

[edit]

I resolve it. I've deleted the Dreide.mod and reinstalled the last version. It works!!!
Very good mod!!!


mongia2(Posted 2005) [#35]
Can't find interface for "module" "pub.dreide"

my problem

thanks

i copy a dir/
dreide.mod in
C:\BlitzMax\mod\pub.mod

mongia2


fredborg(Posted 2005) [#36]
mongia2 you need to press Alt+D to build the modules.


mongia2(Posted 2005) [#37]
i press a alt+d and:
Building Modules
Compiling:blitz_app.c

Process complete


but
Can't find interface for "module" "pub.dreide"


mongia2(Posted 2005) [#38]
and if i compiled a:

print 10+10
waitkey


Building untitled2
Compiling:untitled2.bmx
flat assembler version 1.51
3 passes, 1924 bytes.
Linking:untitled2.exe
C:/Programmi/BlitzMax/bin/ld.exe: cannot find C:/Programmi/BlitzMax/mod/pub.mod/dreide.mod/dreide.release.win32.a

Process complete


Panno(Posted 2005) [#39]
@mongia

www.blitzbasic.com/Community/posts.php?topic=44537&hl=mingw


patmaba(Posted 2005) [#40]
I have the same problem like mongia with dreide 241


mongia2(Posted 2005) [#41]
thanks panno
it work fine!!


orgos(Posted 2005) [#42]
Please some one can help me.

I have problem compiling the dreide module. I have actualy the same problema than mongia2, I install the MinGW and then set the enviroment path in this way.

SET PATH:.......;C:\MinGW;C:\MinGW\bin;

The ...... is the previous defined path by windows.

Some solution?

P.D. I have the 1.10 version.


podperson(Posted 2005) [#43]
Awesome work... this topic should be pinned!


mongia2(Posted 2005) [#44]
copy C:\MinGW\bin

in blitzmax\bin

and alt+d
compiled modules

it work fine!!

mongia2


ckob(Posted 2005) [#45]
this engine is awesome...super easy to use

When I load a 3ds it will not load the texture if it's a TGA ive only managed to get jpg to work with it.

EDIT: figured out that you have to change
Import Brl.JPGLoader

to
Import Brl.TGALoader


ckob(Posted 2005) [#46]
hope this project isnt dead:(


Vertex(Posted 2005) [#47]
No, but the features I have worked, does not work.

http://vertex.art-fx.org/dreide252.zip
http://vertex.art-fx.org/dreide_examples252.zip

Whats new?
- Speed up rendering
- Render to texture with MyTexture.GrabBackBuffer(X, Y)
- MyCamera.Project
- Fixed bug with cubemapping (now it works perfect)
- Fixed some little bugs

I will code a pixel/vertexshader with combine reflection, refraction (and dispersion) to show new cubemap and render to texture feature.

If projective texturing with MyTexture.AddRenderMode(DDD_TEXTURE_PROJECTIVE) works fine, than I can add DDD_TEXTURE_DEPTH to produce hardware Shadows!

The MD2 and B3D Loader does not work! Experimental for me only!

cu olli


Leiden(Posted 2005) [#48]
Wow this is looking awesome Vertex. Cant wait to try it out!


Booticus(Posted 2005) [#49]
Yeah its great! All I wanted was to display a planet map on a sphere, and wow! You made it easy! AND I'm able to blend it with the max2d as per the above example (somewhere above I meant) Thanks guys!! Your work is appreciated!


Vertex(Posted 2005) [#50]
http://vertex.art-fx.org/dreide255.zip
http://vertex.art-fx.org/dreide_examples255.zip
http://vertex.art-fx.org/dreide_examples255bin.zip (Win32)

With OpenGL Shading Language(glSlang) Support. The big Problem, my graphicscard does not support glSlang, so I can't test self.

glSlang works good, but testers say, that the uniform handshake does not work.

Just test glsl_test

cu olli


Mathieu A(Posted 2005) [#51]
The GlSl_Test dosn't work on my computer
excellent work though


Booticus(Posted 2005) [#52]
GlSl_Test doesnt work on mine neither, only because my graphics card is not uber enough. ;) The rest of the stuff is great. Im happy with it! Thanks Vertex!


Akat(Posted 2005) [#53]
working on linux just fine... btw, im just using wine, but it seems really2 fast:






Dreamora(Posted 2005) [#54]
glsl test does not work here either on a 9700 ...
So perhaps something wrong on source side?


Vertex(Posted 2005) [#55]
Thanks for testing!

Whats wrong Dreamora? Did you haven't the following extensions?:
- GL_ARB_shader_objects
- GL_ARB_vertex_shader
- GL_ARB_fragment_shader
- GL_ARB_shading_language_100
Just use THardwareInfo.DisplayInfo() to list your extensions.


Documentation will begin with Release v3.00, but firstly in german(you know, my english grammar is bad ;)) Maybe, I will pay for a english translation, but maybe :)

cu olli

Edit: If anyone can test glsl_test.bmx, can you say me, is the Quad white or colored? If is white, can you print out for me the var "Location" ?


Red Ocktober(Posted 2005) [#56]
Vertex... you really are into this, aren't you... :)

looks really good so far...

can i ask again... have you introduced any sort of scene graph or other code for determining the potential visibility set on a large 'level...

... andything beyond the default OpenGL culling?

thx

--Mike


slenkar(Posted 2005) [#57]
hvae you got all the standard blitz3D commands yet?


ckob(Posted 2005) [#58]
slenker: no and I dont think he means to. The commands are very easy to use even i figured it out :P

Vertex this is coming along very well any plans on adding Terrain support?


Dreamora(Posted 2005) [#59]
No it does not have. It has a different way of working, it is OO not procedural as Blitz3D


Garred(Posted 2005) [#60]
Vertex , I have the extensions and I tested it. The screen is white to me, so i think it is the quad. When it crash in debug mode ("Unhandled Exception: Unhandled Memory Exception Error" at line 57), Location value is 0.

If you want I can give you screenshots; My email is garred205-a-hotmail

You have done a excelent work, thank you!


ckob(Posted 2005) [#61]
all the examples work here


SillyPutty(Posted 2005) [#62]
Sheesh, awsome works as usual Vertex !


DirtBikeDude(Posted 2005) [#63]
how do you show fps? is'nt there some command?


Dreamora(Posted 2005) [#64]
with an ATI, you have an option for that in your driver, that is normally much more precise when it comes to real FPS
And that at no cost at all :-)


Vertex(Posted 2005) [#65]
Hi!

Red Ocktober: I just use OpenGL, GLEW(to have access to new commands like glUniform) and GLUT(just use for creation projective matrix).

Slenkar: DreiDe != Blitz3D. It is Blitz3D orientaded, but not compatible.

ckob: Terrains are the things, they are at the last of my to do list :) But I have a list with documentations of LOD based terrains algorithms like ROAMing.

http://vertex.art-fx.org/dreide256.zip
http://vertex.art-fx.org/dreide_examples256.zip
http://vertex.art-fx.org/dreide_examples256bin.zip

Please test again. My false was, that I have forgot to use a shader with a material :)

But fixed a little bug in GLSlang Module, now you can use transposed matrices with MyUniform.SetMatrixNxN.

cu olli


Sveinung(Posted 2005) [#66]
Got an error when rebuilding modules.


Any ideas???

Sveinung


Vertex(Posted 2005) [#67]
Please delete dreide.mod and copy the new version into.

cu olli


DirtBikeDude(Posted 2005) [#68]
what are the FPS for these demos?


Vertex(Posted 2005) [#69]
Yes, FPS, next examples update :)

http://vertex.art-fx.org/dreide257.zip

- All Types have a Remove-Function
- MyTexture.SetClamp is now known as MyTexture.SetWrap
- MyTexture.AddRenderMode(DDD_TEXTURE_COMPRESSED) now supported
- DDS Loader support uncompressed, compressed(DXT1, DXT3 and DXT5) textures with or without MIPMaps, with or without Cubemaps -> MyTexture = DDSLoader.Load("test.dds") ; MyTetxure.SetFilter(..., ...)
- Fixed bug in AdjustTexSize
- Fixed little bugs

The new DDS Loader is beta only!

cu olli


Leiden(Posted 2005) [#70]
Damn this is really progressing very nicely, I love it! Keep up the awesome work Vertex :P


Mathieu A(Posted 2005) [#71]
Hi,

In the Surface.bmx, I try to calculate the Normal of the Triangle. I code my own Vector3D type. But I always have an error at this line. I'd like to know where is the error?

Vertex1.Vector[0] = Self.GetVertexX( GetTriangleVertex( Triangle, 0))


MY FUNCTION

Method GetTriangleNormal:Vector3D(Triangle:Int)
If (Triangle < 0) Or (Triangle => Self.TriangleCount) Then
TDreiDeError.DisplayError("Triangle does not exist!")
Else

Local Normal:Vector3D, Vertex1 : Vector3D, Vertex2 : Vector3D, Vertex3 : Vector3D
Local Edge1 : Vector3D, Edge2 : Vector3D

' Calculate FaceNormal

' Get VertexPositions
Vertex1.Vector[0] = Self.GetVertexX( GetTriangleVertex( Triangle, 0))
Vertex1.Vector[1] = Self.GetVertexY( GetTriangleVertex( Triangle, 0))
Vertex1.Vector[2] = Self.GetVertexZ( GetTriangleVertex( Triangle, 0))

Vertex2.Vector[0] = Self.GetVertexX( GetTriangleVertex( Triangle, 1))
Vertex2.Vector[1] = Self.GetVertexY( GetTriangleVertex( Triangle, 1))
Vertex2.Vector[2] = Self.GetVertexZ( GetTriangleVertex( Triangle, 1))

Vertex3.Vector[0] = Self.GetVertexX( GetTriangleVertex( Triangle, 2))
Vertex3.Vector[1] = Self.GetVertexY( GetTriangleVertex( Triangle, 2))
Vertex3.Vector[2] = Self.GetVertexZ( GetTriangleVertex( Triangle, 2))

' Get EdgeVectors between Vertex1-Vertex0 and Vertex2-Vertex0
Edge1 = Vertex2.Substraction( Vertex1)
Edge2 = Vertex3.Substraction( Vertex2)

' Calculate the Normal by using the CrossProduct
Normal = Edge1.CrossProduct(Edge2)

'Normalize vector
Normal = Normal.Normalized()

Return Normal
EndIf
End Method


Dreamora(Posted 2005) [#72]
You should at least try to initialize your vectors before using them ... I assume that the error is a "null object access error" error in debug?


ckob(Posted 2005) [#73]
Vertex: in my freetime ive been using your engine to make a terrain system and it's coming along nicely once im finished with it I will gladly donate to your cause.


Mathieu A(Posted 2005) [#74]
Hum Hum...thank you Dreamora ;-)


Vectrex(Posted 2005) [#75]
nice. Is there a reason the Vectors are an array and not a type? Just seems a bit weird giong vector[0] for x and not vector.x :)


Mathieu A(Posted 2005) [#76]
It's a type Vector3D. I put the position of the vertex into a vector.

I use an array because it's more easy to use with matrix.

Here his my type Vector3D. If you have suggestion for a nicer code. I'm interested :-)

Type Vector3D

Field Vector : Float[3]

Method SetVector3D( x : Float, y : Float, z : Float)
Self.vector[0] = x
Self.vector[1] = y
Self.vector[2] = z
End Method

Method GetVectorX:Float()
Return Self.Vector[0]
End Method

Method GetVectorY:Float()
Return Self.Vector[1]
End Method

Method GetVectorZ:Float()
Return Self.Vector[2]
End Method

Method SetVectorX( X : Float)
Self.Vector[0] = X
End Method

Method SetVectorY( Y : Float)
Self.Vector[0] = Y
End Method

Method SetVectorZ( Z : Float)
Self.Vector[0] = Z
End Method

Method Addition:Vector3D( vector : Vector3D)
Self.Vector[0] = Self.Vector[0] + vector.Vector[0]
Self.Vector[1] = Self.Vector[1] + vector.Vector[1]
Self.Vector[2] = Self.Vector[2] + vector.Vector[2]
Return Self
End Method

Method Substraction:Vector3D( vector : Vector3D)
Self.Vector[0] = Self.Vector[0] - vector.Vector[0]
Self.Vector[1] = Self.Vector[1] - vector.Vector[1]
Self.Vector[2] = Self.Vector[2] - vector.Vector[2]
Return Self
End Method

Method Multiply:Vector3D( k : Float)
Self.Vector[0] = Self.Vector[0] * k
Self.Vector[1] = Self.Vector[1] * k
Self.Vector[2] = Self.Vector[2] * k
Return Self
End Method

Method Divide:Vector3D( k : Float)
Self.Vector[0] = Self.Vector[0] / k
Self.Vector[1] = Self.Vector[1] / k
Self.Vector[2] = Self.Vector[2] / k
Return Self
End Method

Method Equal:Byte( vector : Vector3D)
If (Self=vector) Return True
End Method

Method Negative:Vector3D( )
Self.Vector[0] = -Self.Vector[0]
Self.Vector[1] = -Self.Vector[1]
Self.Vector[2] = -Self.Vector[2]
Return Self
End Method

Method SquareMagnitude:Float()
Local Magnitude : Float
Magnitude = Self.Vector[0]*Self.Vector[0] + Self.Vector[1]*Self.Vector[1] + Self.Vector[2]*Self.Vector[2]
Return Magnitude
End Method

Method Magnitude:Float()
Return (sqr ( Self.SquareMagnitude()))
End Method

Method Normalized:Vector3D()
Return ( Self.divide (Self.Magnitude()))
End Method

Method CrossProduct:Vector3D( Vector1 : Vector3D)
Local result : Vector3D
result = New Vector3D
result.Vector[0] = Self.Vector[1]*Vector1.Vector[2] - Self.Vector[2]*Vector1.Vector[1]
result.Vector[1] = Self.Vector[2]*Vector1.Vector[0] - Self.Vector[0]*Vector1.Vector[2]
result.Vector[2] = Self.Vector[0]*Vector1.Vector[1] - Self.Vector[1]*Vector1.Vector[2]
Return result
End Method

Method DotProduct: Float( Vector1 : Vector3D)
Local result : Float
result = Self.Vector[0]*Vector1.Vector[0] + Self.Vector[1]*Vector1.Vector[1] + Self.Vector[2]*Vector1.Vector[2]
Return result
End Method

End type


Mathieu A(Posted 2005) [#77]
Hi,
I'd like to display Line and Point in Dreide 3D

I use simple code, like that :

glColor3f(1,1,1)
glPointSize( 10)
glBegin(GL_POINTS)
GlVertex3f(0,0,0)
glEnd

But It didn't work. I have to configure something to draw line ?


Mathieu A(Posted 2005) [#78]
sorry, it works


Vectrex(Posted 2005) [#79]
wesh: can't is just be

Type Vector3D
Field x#,y#,z#

? :)


Mathieu A(Posted 2005) [#80]
Yes, but as i say. it's more easy to use with matrix. We can index our vector with Matrix


Leiden(Posted 2005) [#81]
I found a possible bug...

When you translate the camera back 20 units and rotate it, the camera appears to rotate around the world center point (0,0,0) instead of the camera's position in the 3d world.

Needed Feature:

The one thing DreiDe is missing for me is the MoveEntity command like in Blitz3D. That would be nice to have in DreiDe ;)


ckob(Posted 2005) [#82]
bob: Setposition is the command I use to move stuff.


Vertex(Posted 2005) [#83]
If glTranslatef and so on are not hardware optimized, I will write a little mathmodule for DreiDe. Very bad to use like glGetFloatv(GL_MODELVIW_MATRIX, ...).

Bob Willis: I'am very confused now with the OpenGL Coordsystem. From view of a simple camera with no rotation, I can't see a triangle in counter clock wise.
Normaly, MyEntity.Move(X, Y, F) must be computed so: (X Y Z) x MyEntity.LocalMatrix. But from a standard camera, I must use the local inverse Matrix to let it looks right.

So my result is, that a standard camera must be turned about 180° of the y axis. But I have no possibility reasons for this.

The MD2 Loader will be replaced with an MD3 Loader. MD3 has easyer Mesh structure, becouse vertices have sepperate texcoords and sepperate normalcoords. Also the normaltable I don't must load from a file such as I can compute it self.

cu olli


Leiden(Posted 2005) [#84]
How is this going vertex, any progress with that weird Opengl inverted matrix for camera crap?


Vertex(Posted 2005) [#85]
Mathmodule comming soon.

I working actutally on the MD3 Loader:


I will not support complete Models with upper-, lower- and head.md3. Only loading animated MD3 Meshs. Maybe load skin files.

MyModel = TMD3Model.Load("test.md3", "test.skin")
or
MyModel = TMD3Model.Load("test.md3")
or
MyModel = TMD3Loader.Load("test.md3")

Animation with MyModel.CountFrames() and MyModel.SetFrame(Frame).

Cliff "PAPA LAZAROU" Harman has send me some code for creating primitives. I must convert to oop and DreiDe code style.

Dreamora have begun first steps for a SceneGraph Manager with Octrees and so on.

cu olli


REDi(Posted 2005) [#86]
Did you get the sphere email vertex? (just incase it got binned again.)

I was having a look at your surface code, and noticed you're using VBOs (very fast) but did you know that VBOs inside display lists are even faster?


Vertex(Posted 2005) [#87]
Papa Lazarou, yes, I have became... I must make a compare between static VBOs and DisplayLists.

http://vertex.art-fx.org/dreide258.zip
http://vertex.art-fx.org/dreide_examples258.zip
http://vertex.art-fx.org/dreide_examples258bin.zip

New Version with Quake3 MD3 Support:


MyModel = TMD3Model.Load("MyModel.md3", "MyModel.skin") (skin ist optional)

MyModel.CountFrames() returns the number of frames.

Mymodel.SetFrame() set current frame. Frames are linear interpolated, so you can set frames like 3.8 that use frame 3 and 4 but with more weighting on frame 4.

Sorry, I haven't time for the primitves, next update...

cu olli


Leiden(Posted 2005) [#88]
Ohh MD3'ness I likes! How is the scenegraph coming, will it feature node hierarchy rendering? What about the camera problem, hows that goin? :D


Vertex(Posted 2005) [#89]
At first I think, you have for example a class named by TBoundingVolume that can be a boundingsphere or a boundingbox (or a bounding cylinder). This bounding volume you can set to a parent or a child of another bounding volume. If the parent is out of the viewfrustum, then the childs(i.e. entitys or other bounding volumes) will not rendered or tested.

The camera problem is not solved. I haven't spend time in the last for DreiDe.

cu olli


Leiden(Posted 2005) [#90]
Ohhh scenegraph sounds awesome :D Keep up excellent work!


FBEpyon(Posted 2005) [#91]
@Vertex
Hey man are you going to add in a terrain matrix system with this engine..? and if so how easy is it goign to be to use??


Ferminho(Posted 2005) [#92]
I had a look at the examples and they are awesome! great work!

However I can't manage to install the mod. I'm on Windows 2k, 1.10, mingW installed, DreiDe 2.58, AMD Duron 800, Radeon 9600Pro...
When building modules I get this error:

Compile Error: Identifier 'glGetUniformLocation' not found
[C:/PROGS/blitzmax/mod/pub.mod/dreide.mod/GlSlang.bmx;171;4]

however, glsl_test.exe works (I see a square fading from black to white)...

(woah! post n. 10000)


Vertex(Posted 2005) [#93]
FBEpyon: Firstly I need a functionality Mathmodule. The Terrainsystem will be easy as Blitz3D. Creating a Terrian from a Highmap - Pixmap and so on.

Ferminho: You need the newest version of BMax. glGetUniformLocation is defined in pub.mod\glew.mod\glew.bmx as Global glGetUniformLocation:Int(programObj_:Int,name_:Byte Ptr)="__glewGetUniformLocation"

I'am currently working on the Mathmodule. I hope that is faster than the actually system.

If there is interests:
edited

(code will delete with new update of DreiDe)

cu olli


Ferminho(Posted 2005) [#94]
true, apparently my installation of bmax was somehow corrupted. Reinstalled and updated and worked fine. Thanks!


Leiden(Posted 2005) [#95]
Heya Vertex, how is DreiDe progressing, havn't heard much from ya in the last week :)


Nelvin(Posted 2005) [#96]
Olli,

your code might be way more efficient using basic fields instead of arrays for you structure components.

Using arrays in types, even for basic types like int or float and even if declared in the type with a constant size does generate an extra object for the array part. It is not embedded in the structure like for instance in C/C++.

The result is negative in several ways:
- your methods might be slower than possible because accessing each component needs reading the address of the components array followed by the final read of the component. That's more instructions than necessary *and* it has to read from another memory address which may lead to cache misses which easily may cost more cycles than the calculations.

- Alloc/Free of the types will be slower than necessary because of the additional array object used.

- Memory usage will be higher than necessary. BlitzMax' per alloc overhead is 8 byte, using for instance a TVector3 using 3 float fields x, y, z allocates 20bytes (3*4+8), using a float[3] field allocates 32bytes (2*8 +3*4 + 4 - the last used by the field pointing to the array)


Vertex(Posted 2005) [#97]
Lord Humongous: I'am working only on the Mathmodule. My method of transformation need only 6% of calculating.

Nelvin: Hmm, thats not good :(

The current mathmodule:
(OrthoNormalize and SetPerspective/SetOrtho does not work)

edited


cu olli


Leiden(Posted 2005) [#98]
Wow that is looking really clean Vertex, awesome work :D


GA(Posted 2005) [#99]
I think I have run into a bit of a problem on mac os, I keep getting "Attempt to access field or method of Null object" errors when trying to SetPosition,Turn,Move (or anything realy) an object.

Each time the error will take place right after the object has ment to be loaded i.e. after T3DSLoader.Load("media\dreezle\dreezle.3ds") or TMD3Model.Load("media\lara\lara_upper.md3", ..("media\lara\lara_upper.skin")

Any help?


Vertex(Posted 2005) [#100]
Ledo: Thx :)

GA: Sorry, I don't have a Mac :( Is there the same problem in the surface.bmx example? If not, then I think, there is a problem with the filesystem. Please use DebugStop() before T3DSLoader.Load(...) and stept in to the function until you find a call to "Return Null".

At all: I hate it :) The Math Module is ready and does work, but I must transform all parents of a child too. I didn't make any speedtests, but I think, the Math Module is fast like OpenGL self.

But to the problem of 180° turned camera()about the yaw angle): I think, the best way where to use the Direct3D Projection Matrix ?or.

3D coordinates where in OpenGL projected into window coordinates by:
(Xo Yo Zo Wo) x ModelViewMatrix = (Xe Ye Ze We)
(Xe Ye Ze We) x ProjectionMatrix = (Xc Yc Zc Wc)
(Xd Yd Zd) = (Xc/Wc Yc/Wc Zc/Wc)
Xw = ViewportWidth/2*Xd+(ViewportX+ViewportWidth/2)
Yw = ViewportHeight/2*Yd+(ViewportY+ViewportHeight/2)
Zw = ((f-n)/2)*Zd+(n+f)/2

Where Xo, Yo, Zo and Wo the object coordinates(local coordinates), Xe, Ye, Ze and We the eye coordinates(global coordinates), Xc, Yc, Zc and Wc the clipping coordinates, Xd, Yd, and Zd the normalized device coordinates, Xw, Yw and Zw the window coordinates, f the far and n the near position of viewfrustum.

I don't know, if Direct3D use the same windows coordinate projection.

cu olli


ckob(Posted 2005) [#101]
one thing I noticed is that if I load a 3DS file in, I get the model but it has 1 texture applied to the entire thing.


GA(Posted 2005) [#102]
Ok, done a little testing, the surface example works in Mac OS indicating the filesystem problem.

For the 3DS example, the error takes place at

Loader.ReadChunk()
If (Loader.ChunkID <> DDD_3DS_MAIN) Or (Loader.ChunkSize <> Size) Then
Loader.Stream.Close()
Return Null
EndIf

When CheckID = 19789 and chunksize = -752352512

In the md3 example, the error takes place at:

' Check Header
If Not Header.Check() Then
Stream.Close()
Return Null
EndIf

Hope this helps.


JaviCervera(Posted 2005) [#103]
To make it work on the Mac, replace all the calls to ReadFile(...) in the loaders by LittleEndianStream(ReadFile(...)). Remember to import the BRL.EndianStream module and everything will work :)


Vertex(Posted 2005) [#104]
Ahh, ok Mac uses Big Endian.

So, math module works correct. I use the OpenGL Coordinatesystem but with flipped faces.

I habe working actually on the primitive system:
...


I must only optimize something and add CreateCone.
This code is translated from Papa Lazarou's code for primitives. Hardest work was CreateSphere.

Here some screenshots:




cu olli


ckob(Posted 2005) [#105]
Vertex: Hey going good when do you think you'll be adding terrain support? I also have a problem with meshes loading them in as 3DS they only have one texture instead of all the textures they should have.


Leiden(Posted 2005) [#106]
Sounds awesome, how far away is the new version with the latest math module and primitive stuff implemented. Keep up the good work.


Vectrex(Posted 2005) [#107]
howdy, just thought you'd be interested to know I'm using this in a game development class I teach :)
It's a begginer class so I chose blitz and thankfully this engine fits in very well and is very neat! Unlike the Irrlicht wrapper which is powerful but messy (are the simple blitz wrappers still being worked on?)
A few suggestions. Things I'd like to see are simple 3ds animation. Simple bounding box collision tests and a cleaner way of using parent/child stuff. Good work!


Leiden(Posted 2005) [#108]
Hi,

I made some changes to THardwareInfo. THardwareInfo.DisplayInfo() now takes two boolean options. The first one tells DisplayInfo() to print the information to the console, and the seccond tells DisplayInfo() to print the information to a text file called "DreiDeLog.txt". I thought this was a good idea because people can then paste their system capabilities easier from a file. I also made some small changes to the syntax the information is printed in to make it more clearer.

Here is updated file:
   changed.



Vertex(Posted 2005) [#109]
ckob: I will debug the 3ds loader later...
Ledo: Hmm maybe, I will upload today, but there is no feature etc.
Vectrex: Year that sounds cool :) 3DS animation coming with key frameanimation support, collisiondetection with ODE Module but what you mean ist cleaner as MyEntity.SetParent(MyParent)?
Ledo: Ok, comming with the next update...


The first steps for loading Quake3 BSP Maps. (You see q3dm17.bsp) :) In the background all textures and lightmaps are allready loaded.

cu olli


Vertex(Posted 2005) [#110]
Many peaople quest about an update:
http://vertex.art-fx.org/dreide259.zip
http://vertex.art-fx.org/dreide_examples259.zip
http://vertex.art-fx.org/dreide_examples259bin.zip

- New mathmodule with flipped triangles but the same z axis.
- TPrimitive with CreateQuad, CreateDisc, CreateCube, CreateSphere, CreateCone and CreateCylinder
- Changes MyTexture.SetFilter(Min, Mag) to MyTexture.SetFilter(Filter) with new constants DDD_TEXTURE_POINTSAMPLING, DDD_TEXTURE_BILINEAR, DDD_TEXTURE_TRIILINEAR and DDD_TEXTURE_ANISOTROPIC
- THardware.DisplayInfo you can select if you print to console or into DreiDeLog.txt
- LittleEndian for all Platforms(please tell me, if it work)

cu olli


BlitzSupport(Posted 2005) [#111]
Great stuff. Everything works fine here except for the GLSL test: it just exits silently after opening its window. In debug mode I get "Unhandled Memory Exception Error" on this line:

Location = Shader.GetUniformLocation("SzeneColor")



GA(Posted 2005) [#112]
Seems to be working fine here too :)

A small problem, I tried out the move method in the 3ds example with the following addition, removing the turn command:

If KeyDown(KEY_right)
Mesh.Turn(0.0, -0.2, 0.0)
EndIf

If KeyDown(KEY_left)
Mesh.Turn(0.0, 0.2, 0.0)
EndIf

If KeyDown(KEY_1)
Mesh.Turn(-0.2, 0.0, 0.0)
EndIf

If KeyDown(KEY_2)
Mesh.Turn(0.2, 0.0, 0.0)
EndIf

If KeyDown(KEY_Up)
Mesh.Move(0.0, 0.0, 0.5)
EndIf

If KeyDown(KEY_down)
Mesh.Move(0.0, 0.0, -0.5)
EndIf

It does seem that the move command stop working correctly after a while, I did try to make a move command in the last version and ran into similar problems.


Vertex(Posted 2005) [#113]
BlitzSupport: Hmm ok, I will test this...
GA: Yes, I have see, that my transformation not work correctly :(


BSP Loader(without PVS actual, I must write the loader again)


ckob(Posted 2005) [#114]
hey vertex awesome work so far, I hate to keep bugging but any luck on 3ds loader?


Vertex(Posted 2005) [#115]
ckob: this update was not planned :) When I say to you, I will check the bug till version 2.60 sounds that ok?

Hmm I can't use transposed matrices again, I hope thats the bug only...


ckob(Posted 2005) [#116]
yeah thats fine :) appreciate the work your doing on this engine its looking awesome


Vectrex(Posted 2005) [#117]
howdy, I think there's a bug when setting the camera's parent to another object. It doesn't move relative (but it rotates ok), eg for a 3rd person camera.

ps any news on 3ds animation? :)


Vertex(Posted 2005) [#118]
ckob :)

Vectrex: Jup, I must debug the mathmodule, but firstly I would finished my Quake3 BSP Loader. 3DS Animation - hmmm :)

Here the actual state of loading Curved Surfaces:

When you loading BSP maps, you can say how much will a curved surface tesselate(bad hardware can choose low tesselation, high end hardware high resulution).

When I finished with correcting indices, I will make the PVS System ready.

cu olli


Leiden(Posted 2005) [#119]
Wow thats an interesting screen shot, Awesome work so far Vertex. Thanks for your continued work on DreiDe!


Vertex(Posted 2005) [#120]

(with Tesselation = 4)

I hope, I can finished the BSP Loader in 1 or 2 weeks.

cu olli


Leiden(Posted 2005) [#121]
Wow nice, thats lookin pretty slick. What about BSP occulsion and portaling, will it automatically hide portals that are not visible so it wont have to render the whole map if your staring at a wall in a tiny room ;)


Vertex(Posted 2005) [#122]
Yes, I will include PVS. I calculate in wich leaf is the camera, than using the vis cluster to detect which leaf is possible visible. This posissible visible leafs where using furstum clipping(by using boundingboxes). Reducing ca. 85% of the geometrie.


(1024*768)

Now, I can begin with the BSP Renderer.

cu olli


GA(Posted 2005) [#123]
That is looking great Vertex, very good work!

Do you know if it could be posible to create a working "move" and "point" entity command for the next release as well?


ckob(Posted 2005) [#124]
awesome work. I dont really see any use for BSP but looking very good.


Vectrex(Posted 2005) [#125]
can dreide use multitexures from a 3ds file? eg If I want to use 3dsmax texture baking for lightmap shadows? I notice the multitexturing demo can but can that info be read out of the file?
About the camera parent attach bug, is this easily fixed? Where should I look? A few students want to use it :)


Vertex(Posted 2005) [#126]
Ok, ok, tomorrow I will debugging the mathmodule.
GA, year, I hope, I can MyEntity.Point(X, Y, Z) do, but MyEntity.Move(X, Y, Z) where not the problem.

ckob: DreiDe will use in a new game that needs *.bsp support. I think BSP Maps are a simple method, to test any envirmonet effects such as realtime reflection(comming sooon in examples :))

Vectrex: 3DS will fixed soon, and add support for some new maps like bumpmap, alphamap etc.

My BSP Loader make some problems. If I use for a Q3Face a DreiDe Surface, all is OK. But when I calculate indices and vertices for a big "surface", than there big problems.
Actual testcase you can find at: http://nomorepasting.com/paste.php?pasteID=50050

cu olli


Leiden(Posted 2005) [#127]
Hey Vertex, how is this going? Havn't heard much from you in the last couple of weeks. Did you find those nasty bugs that were hiding in the Math module?

Thnx.


Alienforce(Posted 2005) [#128]
Wow! I have missed this one.
Vertex: What is the latest version ?? Do you still work on this ?


OJay(Posted 2005) [#129]
no he doesn't. (in the german boards) he said he will move more towards assembler and handheld programming...


Dubious Drewski(Posted 2005) [#130]
Hmm, that's too bad. Though it looks like he's left behind a
very nice 3D engine. As a newbie to 3D, would you guys
recommend I learn Driede or Irrlicht?


OJay(Posted 2005) [#131]
learning is always recommended ;)

but maybe to start with native dx/ogl is not the best option...try something simpler first. blitz3d does fine to teach the very basics of 3d, regarding to polygon and texture processing...


Vertex(Posted 2005) [#132]
Maybe, I wan't to start again at my christmas hollydays. Actually, I must wirte a script for my videoproject, and will finishing my assembler tutorials.

There are some ideas, like to base completly on ODE Physics.

But there is just some confusing about like animation and so on.

Hmmm hmmm hmmm, maybe, maybe, maybe :P

cu olli


gman(Posted 2005) [#133]
very good to hear Vertex! if you need any support just let me know.


Dubious Drewski(Posted 2005) [#134]
Ojay, I would really like to use blitz3D, but sadly, I only
have Blitzmax. I am now trying to build Driede, but with
no success.

I get this error when trying to build modules:

Build Error: failed to compile F:/Program Files/BlitzMax/mod/brl.mod/blitz.mod/blitz_app.c



I've copied driede.mod to the right folder, I've installed
Mingw, I have BMax 1.14 with synced mods. What else
am I missing?

[edit]
Do I need Gcc-3.3.3? I have no idea what it is or where to
find it (even on it's own site!), but is that what I'm missing?


OJay(Posted 2005) [#135]
hm, dunno...but one note: it reads DreiDe and is just the german meaning of ThreeD
;D


gman(Posted 2005) [#136]
@drew - not sure about the error you are getting, but i rebuilt DreiDe for Alienforce in another thread. its already compiled and ready to go for BMAX 1.14:

www.grandberg.us/pub.dreide/dreide259_BMAX_v114.zip


Dubious Drewski(Posted 2005) [#137]
Thank you very much, Gman. But, I replaced the 'dreide.mod'
folder completely and I still get the error.

And when I try to compile any example program from
"dreide_examples259.zip", I get this error:

Can't find interface for module 'pub.dreiDe'


gman(Posted 2005) [#138]
not sure about the compile error on the .c file. that wouldnt be related to the DreiDe mod. a couple things for the cant find interface error.

could you confirm that the following 4 files:

dreide.debug.win32.a
dreide.debug.win32.i
dreide.release.win32.a
dreide.release.win32.i

are located in the:

c:\blitzmax\mod\pub.mod\dreide.mod

folder (where c:\blitzmax is your bmax install)?

also... i know you already stated this, but this is just a double check. can you confirm that your folder path looks something like:

c:\blitzmax\mod\pub.mod\dreide.mod

and that it doesnt look something like:

c:\blitzmax\mod\pub.mod\dreide.mod\pub.mod\dreide.mod

or

c:\blitzmax\mod\pub.mod\dreide.mod\dreide.mod

thx.


Dubious Drewski(Posted 2005) [#139]
Oh geez, whattya know.

I had the driede.mod folder alongside the brl.mod and pub.mod, like I had to do with irrlight.

I didn't know it had to go inside the pub.mod folder! Haha.

It compiles and runs! Jump for joy!

Thank you very much Gman, I owe you.


gman(Posted 2005) [#140]

Thank you very much Gman, I owe you.


naw, just glad i could help... and your welcome :)


Dubious Drewski(Posted 2005) [#141]
I really like Dreide. It's pretty easy to grasp what's going on with this code.
We should start a section devoted to this. Or at least a new thread.

I was wondering about camera movement. How do I set the
center of rotation to be inside the camera itself? It seems to
default to the center of the world.


Dubious Drewski(Posted 2005) [#142]
Hmmm, I tried setting the Camera's parent to be a
cube(because all non-camera entities seem to rotate
locally, like I want). The camera moved along with
the cube, but when rotating, it ignored the cube
completely and just rotated around the center of the world
again.

This little problem is the only thing stopping me from doing
anything with this amazing Engine.

Anyone have any ideas? I see that this was discussed
above, but never resolved. Does that mean it's something
we have to live with?


gman(Posted 2005) [#143]
greetings drew. do you have some sample code?


Dubious Drewski(Posted 2005) [#144]
Sure. Here is an example of a camera moving around in a
Simple environment. The goal is to have simple first-person
controls. The problem lies in the fact that nothing seems
to change the camera's pivot point. It's always at (0,0,0).



I noticed that all mesh objects rotate at their local center,
like they're supposed to. So I though I might be able to
get the camera to do the same if I linked it to a mesh
object. (A terrible hack, if you ask me)



It doesn't work though. As you'll see, the camera translates
along with the cube just fine, but its pivot point is not the
cube, but the center of the world, so it rotates independantly.

The point of all this is to try to change the camera's pivot
point to anything but (0,0,0). Anything.


Kernle 32DLL_2(Posted 2005) [#145]
i cannot compile it under linux...what the hell!


Vertex(Posted 2005) [#146]
Yes, cameramovement is not correct. It is based on the error in the mathmodule.

FrEeMaN_MU: Hmm, do you use the version by gman? If not, then try it :) When this not working, then give me the error message.
You know, I hate Linux. Also I can't test it on Linux(big problems with bad graphicsdriver (just compile the kernel by installing a driver?! @#!*ing Linux :P ))

cu olli


Dubious Drewski(Posted 2005) [#147]
I'll bet this camera problem will end up being one of
those "Oh, of course!" errors. I get alot of those myself.

This engine is top-notch work. I really don't see many people
stick to a project like you have. For mine and your sake, I'd
love to see you keep this up!


Jeroen(Posted 2005) [#148]
hi! I cant compile the module (build module):

Compile Error: Can't find interface for module 'brl.blitzgl'
[/Applications/BlitzMax/mod/pub.mod/dreide.mod/Error.bmx;10;1]
Build Error: failed to compile /Applications/BlitzMax/mod/pub.mod/dreide.mod/Error.bmx
Process complete


Running MacOS 10.4.3


gman(Posted 2005) [#149]
@Jeroen - download the source i linked above and replace your current DreiDe mod source with it. i fixed the incompatibilities with BMAX 1.14. you can delete the win32.i andwin32.a files in there as you are Mac.


Jeroen(Posted 2005) [#150]
hi Gman, thanks! IT WORKS!
I had to remove the Flushmem in examples, but it works. Impressive engine, and a very nice, clean syntax. Irrlicht looks a bit messy as it is now.

What is the goal of this module? By delivering a complete engine (collisions, line picking, 3d sound...), or is this "render and entity handling only"?
I can imagine that the latter is the goal. The first goal might be "a bridge too far". With a seperate collision engine or physics library, Rakknet etc, you have a complete engine (okay, there is no 3d-sound support in the pipeline yet).

Suggestion to Vertex is to edit the first post in this thread and there add the links to the latest version, examples, etc.


gman(Posted 2005) [#151]

hi Gman, thanks! IT WORKS!


glad i could help :)


Kernle 32DLL_2(Posted 2005) [#152]
@Vertex, when i select compile all modules the compiler compiles all modules but not the dreide modul..and yes i downloaded the version of Gman

Fr3eMaN


gman(Posted 2005) [#153]
@FrEeMaN_MU - it sounds like the compiler is not finding the mod. a couple of things to try:

first try running of the the examples and see what error you get.

next, make sure that your directory structure looks like:

/blitzmax/mod/pub.mod/dreide.mod

(where /blitzmax is your blitzmax install folder) and that it doesnt look something like:

/blitzmax/mod/pub.mod/dreide.mod/pub.mod/dreide.mod

or

/blitzmax/mod/pub.mod/dreide.mod/dreide.mod

and finally, try to make the mod manually from the command line.

bmk makemods -d pub.dreide

i dont have a linux install but hopefully something above will either fix or lead to the fix.


Kernle 32DLL_2(Posted 2005) [#154]
ok, i tried on of your examples and got the message
can't find interface for module 'pub.dreide'
 
the path to dreide folder is :
[code]BlitzMax/mod/pub.mod/dreide.mod

and the content of this folder is:
Fr3eMaN@...; dir
insgesamt 1157
-rw-r--r--  1 Fr3eMaN users  11557 2005-12-16 18:50 Camera.bmx
-rw-r--r--  1 Fr3eMaN users   4687 2005-12-16 18:59 DreiDe.bmx
-rw-r--r--  1 Fr3eMaN users 721574 2005-12-16 18:50 dreide.debug.win32.a
-rw-r--r--  1 Fr3eMaN users  34353 2005-12-16 18:50 dreide.debug.win32.i
-rw-r--r--  1 Fr3eMaN users 186454 2005-12-16 18:50 dreide.release.win32.a
-rw-r--r--  1 Fr3eMaN users  34353 2005-12-16 18:50 dreide.release.win32.i
-rw-r--r--  1 Fr3eMaN users   5189 2005-12-16 18:50 Entity.bmx
-rw-r--r--  1 Fr3eMaN users    280 2005-12-16 18:50 Error.bmx
-rw-r--r--  1 Fr3eMaN users   3646 2005-12-16 18:50 FragmentProgram.bmx
-rw-r--r--  1 Fr3eMaN users  10767 2005-12-16 18:50 GlSlang.bmx
-rw-r--r--  1 Fr3eMaN users   4652 2005-12-16 18:50 HardwareInfo.bmx
-rw-r--r--  1 Fr3eMaN users     37 2005-12-16 18:50 Light.bmx
drwxr-xr-x  3 Fr3eMaN users    168 2005-12-16 18:57 Loaders
-rw-r--r--  1 Fr3eMaN users  10459 2005-12-16 18:50 Material.bmx
-rw-r--r--  1 Fr3eMaN users  27130 2005-12-16 18:50 Math.bmx
-rw-r--r--  1 Fr3eMaN users  10558 2005-12-16 18:50 MD3Model.bmx
-rw-r--r--  1 Fr3eMaN users   3732 2005-12-16 18:50 Mesh.bmx
-rw-r--r--  1 Fr3eMaN users    344 2005-12-16 18:50 Pivot.bmx
-rw-r--r--  1 Fr3eMaN users  13785 2005-12-16 18:50 Primitive.bmx
-rw-r--r--  1 Fr3eMaN users     37 2005-12-16 18:50 Quake3_BSP.bmx
-rw-r--r--  1 Fr3eMaN users   1908 2005-12-16 18:50 SceneManager.bmx
-rw-r--r--  1 Fr3eMaN users  23252 2005-12-16 18:50 Surface.bmx
-rw-r--r--  1 Fr3eMaN users     37 2005-12-16 18:50 Terrain.bmx
-rw-r--r--  1 Fr3eMaN users  14531 2005-12-16 18:50 Texture.bmx
-rw-r--r--  1 Fr3eMaN users   3587 2005-12-16 18:50 VertexProgram.bmx

you see, everything is correct, but i do not know whats wrong.
Last i tried to compile it with the console but no succes.

Fr3eMaN


gman(Posted 2005) [#155]
try deleting the win32.a and win32.i files. dont think they would cause a problem. what error does bmk return?


Dubious Drewski(Posted 2005) [#156]
Vertex! In regards to your camera bug, does this solve anything?


ThE_oMiKrOn_CaT(Posted 2005) [#157]
im getting the same problem as Fr3eMaN
did u find a fix for it?


Will(Posted 2005) [#158]
Hey, could you give a quick status post on DreiDe3D? Has it changed from the post at the top? What are you working on, what features are in place, etc. Thanks!


Vertex(Posted 2006) [#159]
I started the new version of DreiDe any time after :)

I'am working today on a completly new version of DreiDe. The new surfacesystem will be 2x faster by setting vertexposition etc. . Any think like TPrimitive I can copy.
If I can show some thing, I'll post a download link to a testversion.

cu olli


Diablo(Posted 2006) [#160]
oh man thats good to here vertex


Dubious Drewski(Posted 2006) [#161]
This news makes me happy!


Vertex(Posted 2006) [#162]
http://vertex.art-fx.org/dreide260.zip
3DS Loader, Quake3 Loader, DDS Loader, Shader are not includet, beouse I must work on new versions of there.
It is only a testversion.
cu olli


Dip(Posted 2006) [#163]
Trying it ASAP! Excellent work, looking forward to more!


Vertex(Posted 2006) [#164]
http://vertex.art-fx.org/dreide261.zip

My Testcode:

SuperStrict

Framework Pub.DreiDe

Global Cube      : TMesh
Global Animation : TAnimation
Global Keyframe  : TKeyframe
Global Camera    : TCamera
Global Frame     : Float

TDreiDe.Graphics3D(640, 480, 0, 100)

Cube = TPrimitive.CreateCube()

Animation = New TAnimation
Animation.SetEntity(Cube)

Keyframe = New TKeyframe
Keyframe.SetRotation(0.0, 0.0, 1.0, 0.0)
Keyframe.SetPosition(-4.0, 0.0, 5.0)
Keyframe.SetScale(1.0, 1.0, 1.0)
Animation.AddKeyframe(Keyframe, 0)

Keyframe = New TKeyframe
Keyframe.SetRotation(90.0, 0.0, 1.0, 0.0)
Keyframe.SetPosition(0.0, -2.0, -4.0)
Keyframe.SetScale(1.0, 1.0, 1.0)
Animation.AddKeyframe(Keyframe, 10)

Keyframe = New TKeyframe
Keyframe.SetRotation(-90.0, 0.0, 1.0, 0.0)
Keyframe.SetPosition(6.0, 1.0, 1.0)
Keyframe.SetScale(1.0, 5.0, 1.0)
Animation.AddKeyframe(Keyframe, 20)

Keyframe = New TKeyframe
Keyframe.SetRotation(0.0, 0.0, 1.0, 0.0)
Keyframe.SetPosition(-4.0, 0.0, 5.0)
Keyframe.SetScale(1.0, 1.0, 1.0)
Animation.AddKeyframe(Keyframe, 30)

Camera = New TCamera
Camera.SetClearColor(0.4, 0.6, 0.8)
Camera.SetPosition(0.0, 10.0, 25.0)

glEnable(GL_LIGHTING)
glEnable(GL_LIGHT0)

While Not KeyDown(KEY_ESCAPE)
    Frame :+ 0.1
    If Frame  > 30.0 Then Frame = 0.0

    Animation.SetFrame(Frame)

    Camera.Render()
    Flip()
Wend

EndGraphics()
End


cu olli


Panno(Posted 2006) [#165]
works perfect !

ENGAGE !!!!!


Brucey(Posted 2006) [#166]
On Mac with Geforce4 MX it crashes when any of these lines (in Material.bmx) are called :
' No Texture
glClientActiveTexture(GL_TEXTURE0)
glDisableClientState(GL_TEXTURE_COORD_ARRAY)
glActiveTexture(GL_TEXTURE0)
glDisable(GL_TEXTURE_2D)
glDisable(GL_TEXTURE_CUBE_MAP)

Commenting them out makes things work okay.


degac(Posted 2006) [#167]
keyframe...nice idea!


JohnK(Posted 2007) [#168]
links are death(((


TaskMaster(Posted 2007) [#169]
That because the thread is over a year old. o.O


Vertex(Posted 2007) [#170]
This downloads avariable:
http://vertex.dreamfall.at/dreide/dreide259.zip
http://vertex.dreamfall.at/dreide/dreide261.zip
http://vertex.dreamfall.at/dreide/dreide_examples259.zip
http://vertex.dreamfall.at/dreide/dreide_examples259bin.zip
(I have on my harddriver v1.50, v1.60, v2.00, v2.22, v2.23, v2.30, v2.31, v2.41, v2.52, v2.53, v2.54, v2.56, v2.57, v2.58, v2.59, v2.60 and v2.61 if anyone need this)

I know, my website has no content(laziness in CMS programming). There is also no support planned for higher versions of DreiDe. I'am only be interested to port DreiDe in C# to learn this language.

Actualy, MiniB3D is the best way I think.