3D engine downloadBlitzMax Forums/OpenGL Module/3D engine download
| An alpha version of my 3d engine is now on googlecode. If you want to try it: the download contains a module and some samples.|
-Uses Ints instead of Short for triangle indices
-Abstracted GL functions, makes it easier to port.
-Loads B3D files with up to 8 bones.
-You can manually add bones
-Manual animation functions (SetAnimKey/AddAnimSeq)
I wrote the engine for a specific project: a 3d editor.
For this editor, I need to use Picking as well. It is not included yet,
but I will work on that. Other functions (ie. 2d overlays) will be
included if I need them.
If you need something, you could try to make a request. I'll look into
it, but I cannot promise I'll get to it. It is a rather large project
and it's due september.
The project should be easy enough to expand though. You could look into
the minib3d source, it uses the same rendering techniques.
The engine was built to be backwards compatible down to openGL 1.1, maybe
even 1.0. It was also written with portability in mind. The openGL layer
is placed in a single module, with more or less abstract wrapper functions.
An earlier version, I ported to DX9, as a test. With a bit of patching,
that took me two days.
All code is free to use, with certain limitations, that are covered in
the readme.txt file.
')Hopefully it all works as it should, and you can find a good use for it as well.
I appreciate any feedback: especially on if and how it performs. And bugs reports offcourse.
Last edited show_time('2011-05-10 17:08:43')
| Cool, i'll take a look!|
| Mmm, a ROAM implementation. |
Mind if I integrate into my engine?
| I won't mind, but it is not my code. It was written by Mark Duchaineau. The code is under MIT license. You can find the download here:|
That links comes from this page:
Besides the download, it offers a lot of information.
| @kfprimm: I'm trying your engine, but I have: Compile Error: Can't find interface for module 'sys87.newton'|
What is that sys87.newton?
| Let's not use my thread to discuss that. |
| Sorry |
| Clean code, very nice. Quite expandable.|
A couple random thoughts:
I didn't see alpha sorting, do you not need it for this or did you find that it was not needed? Or maybe you're doing it during a position/alpha state change.
I remember you discussing some performance problems, were you able to figure those out? I am curious because I wonder about BlitzMax's speed when calling other type methods, and you are calling quite a few in a loop during surface renders. Just curious as to how well Bmax optimizes those things compared to inlining code-- it may be negligible, I don't know.
Very nice job.
Last edited show_time('2011-04-26 18:23:37')
| outsider, check your email. |
| After that thread, I ported the engine to DX9. That really increased the speed on my computer. So, I've decided to accept the speed issues as being specific to my videocard. It just seems to emulate openGL. For instance, the most rendering time was consumed by glClear. The same program than runs about 50-60 fps in openGL, runs on 90-100 fps in DX9. Any testruns I've done on other PC's were much faster.|
The most optimisation I did when I wrote the math functions. I've eliminated the Matrix, Quaternion and Vector Types, and replaced them with Float arrays. I've also tried to avoid calling a function that calls a function. So if two matrices are multiplied in another Math function, I inlined the multiplication.
As far as using Type Methods, I think TEntity, TCamera and TMesh etc. should be Types. I'm convinced that there is a bit overhead for using them, but the advantages outweight the losses.
Thanks for your feedback, and for the alpha ordering suggestion. I haven't built in alpha blending, but I'll put it on my to-do list.
| Will you be adding lights?|
| There is one directional light included. It is however disabled.|
In Graphics->TOpenGL.bmx, search for "light disable". Two lines are commented out. If you uncomment them, a directional light should be there.
Next update, I'll include the lights from minib3d.
| Cool, looking forward to it!|
| Updated v0.0.2 alpha, with lights and alphablending. |
| Updated v0.0.3 alpha, with CameraPick, picking for terrains |
| Looking very interesting!|
I'm trying to compile, but get a compile error in
roamstep4d.c > line 66 #include <gl/gl.h>
"No such file or directory."
I'm on Mac, Snow Leopard, XCode Version 3.2.5, BlitzMax 1.42, GCC 4.2.1
Other openGl stuff compiles fine it seems.
| It's #include<Opengl/gl.h> on Macs.|
| Thanks jkrankie, that did it. :-)|
Everything looks good, except maybe
DebugLog:Error: could not find texture '../data/nskinbr.jpg'
DebugLog:Error: could not find texture '../data/nskingr.jpg'
DebugLog:Error: could not find texture '../data/nskinwh.jpg'
DebugLog:Error: could not find texture '../data/nskinrd.jpg'
on the mesh sample. (don't know if that's intentional)
| Partly: the ninja model has other skins (brown/green/white/red versions). I didn't supply them with the examples. You could download them from the original site here: http://www.psionic3d.co.uk/?page_id=25|
I will fix the Mac error in the next update. There is another issue concerning terrain frustum culling. The temp. fix is mentioned on the googlepage. I'm working on fixing it properly.
| Updated to v.0.0.6 alpha. It includes an adaptation of the 'bird demo' and a .b3d version of the original blitz3d 'castle1.x' model. |
| :P |
Wip: spheremaps, texture scaling, support for PMK B3D files. Currently I'm trying to implement 3ds matrix support.
| Wow, this is coming along nicely! Do you have any ideal list/set of features in mind?|
| Thanks! At this point, I'm trying to support loading both .b3d files and .3ds files as much as I can. After that, I don't have much of a plan. I would like to implement cubemaps, maybe sprites. Can't think of too much else. If you have suggestions, please tell me. Maybe I'm overlooking something very important? I'm mainly looking into minib3d and blitz3d for ideas.|
I was going for a leightweight engine with support for openGL 1.0 and up, that is portable - in the sense that all openGL related commands are kept in a separate include file, so they could in theory be replaced with another library in the future, if needed.
| Nice going with the screens =)|
It's easier said then done, but... here are my suggestions:
- Support the B3D format fully; while MiniB3D only reads KEYS chunks for bones, it is imperative to have your loader read this chunk type for the other kind of nodes as well: meshes and pivots.
- MiniB3D doesn't support bone scaling, which can be a useful feature and is available to the B3D format anyway.
- Allow for infinite bones to be in a B3D file. In other words, not limiting the total to 8.
- Make a generic particle class that is single-surface.
- Incorporate a tried-and-true physics engine; something like Bullet, Newton, ODE, PhysX or Tokamak. Any of them comes with report-only collisions (for triggers and such), and lightning fast ray-casting.
- Include a shader framework supporting GLSL and\or cgFX as an optional, advanced module.
That's all I can think of for now. Best of luck with development.
| Thanks for the suggestions. They seem fair enough, I'll see what I can do.|
As for that first point: bone scaling is possible. The loader allready loads keychunks for any type of object (mesh/bone). Do you know a model that uses this or either bone scaling? I would like to be able to try it out.
The latter, GLSL shaders, could become a real problem, since my videocard does not support shaders. It would be difficult writing something and not being able to test it.
Last edited show_time('2011-05-14 03:23:46')
| I don't know of any model that uses these, but I can sure make one: FeatureTest.B3D|
Inside the scene you'll see:
- A box named "Big Box", with vertex colors and a vertex-colored brush. This mesh is animated (a noise animation, it'll appear to be shaking), to test the KEYS support for non-bone nodes.
- A dummy\pivot named "Animated Helper". It's the animated pivot, to also put to test the support of KEYS for non-bone nodes.
- A second box named "Small Box" that is parented to the "Animated Helper". If the dummy animates properly you should see this "Small Box" animating as well since it inherits the animation. This "Small Box" is brushed with a FullBright FX brush.
- A cylinder named "Skinned Mesh", which is a mesh skinned with 10 bones. This cylinder has a brush with ADD blending, and this cylinder has its top part without smoothing groups (so the top polygons should look a bit flat-shaded - perhaps the ADD blending makes this difficult to see).
- Another mesh named "Name" just for the sake of control.
I tested it with Blitz3D and all the features worked as mentioned.
| That is very nice of you, thanks! I tested the model, and it seems to animate: The cube moves in a sine like curve and spins, as if being thrown across the model space, and the cylinder curls up, then resets.|
Brush fx are not supported, so both shapes are white. Vertex colors are supported and show.
When I load the model in blitz3d (1.105), only the small cube moves, the cylinder is just static. Also: the "Big Box" doesn't seem to move. I could find no KEYS tag for it.
With lights enabled, it shows the smoothing group:
Last edited show_time('2011-05-14 18:37:22')
| Oopsy... you're totally right. I added the animation to the "Big Box" but forgot to update the download file. Here it is: FeatureTest2.B3D|
About the skinned mesh: in Blitz3D, skinned meshes need to be animated exclusively to work, as they possess an 'ANIM' chunk themselves.
This means doing this:
Animate Scene,3 ;Animate the scene-root, which animates all nodes until additional ANIM chunks are met in the hierarchy.
Animate FindChild(Scene,"Skinned Mesh"),3 ;Animate this skinned node and all nodes it parents.
')With this the cylinder should animate in Blitz3D.
and the cylinder curls up, then resets.
Perhaps this should be looked further. In Blitz3D, playing the cylinder with a "one-shot" animation (type 3) leaves the scene stopped at frame 100 (with the cylinder totally curled).
If your engine leaves the scene at frame 0.0 after the animation ends then you might be traversing one extra frame at the end, or at least resetting the current frame.
Last edited show_time('2011-05-14 19:21:34')
| Okay, just did a weird tentacle thingy that slithers and scales by pure bone animation: BoneScale.B3D|
Has a mesh named "Tentacle", with normals but no vertex-colors and no brushes.
Has 8 bones, and the root bone animates in the scale from 100% to 0.0% (making the tentacle shrink to oblivion).
The tentacle starts up in the air.
| Any thoughts about adding shadows? |
| Thanks Kryzon, it all seems to work properly now. Your models are a great help. I've added additive blending, and improved the z-ordering somewhat. I've added better support for brush colors vs. surface colors and some of the brush fx. Finally, I noticed I forgot to flip the normals on b3d meshes.|
The tentacle model is very nice. And funny. The bone scaling works.
KronosUK, about shadows, thoughts indeed: I have considered it, and it boils down to the same question: how? I have no idea. I'm working with openGL 1.5 and only a limited amount of time (and brain capacity). Creating shadows seem to be difficult -mathwise, and as I understand, they require processor intensive calculations. I expect in the future, that shadows are part of the hardware accelleration. Maybe they are allready available, via shaders? I don't know. If shaders could provide shadows, perhaps that would be an option. However, it would go against one of the starting points of the project: overall compatibility.
| I'm sure a basic shadow mapping would go a long way.|
Here you can see it done only through fixed-function, without using any shaders: http://www.paulsprojects.net/tutorials/smt/smt.html
The demo shows it very nicely, and comes with the .EXE and C++ source.
| Hmm, I don't like to admit it, but my videocard doesn't seem to support it. I see just a basic scene without shadows. The docs mention ARB_depth_texture and ARB_shadow, so I suppose I don't have them. When I get to it, I will have a closer look. |
| Isn't there a semi-shadow implementation in the extended miniB3D? |
| Amazing stuff :) |
| The shadows present in klepto2's MiniB3D Extended are stencil-shadows - or rather an attempt at them because last time I ran the demo they were very slow and had cracks at the edges of shadowed faces (when compared to other stencil shadow demos from nVidia and others).|
Shadow maps might be as backward-compatible as stencil ones, but they are good for whatever complexity your scene might have (while shadow volumes don't scale well with highly complex scenes), and have the capability to be filtered in any of the many ways available.
| Shadow mapping would almost certainly be quicker even if you were rendering the scene 2-3 times although some care needs to be taken if you have alot of large meshes in your scene.|
I've been struggling with shadow maps for my own little engine for ages and getting nowhere. Most demos you see cover a specific area, normally a convenient square which you can clip to, I have no idea what else you would need to do for an unlimited area with a moving camera.
Its the one feature imo that minib3d could really use as pretty much everything else is now covered, eg terrains, shaders etc.
Kleptos shadows are indeed slow and I also noticed "extra" shadow images when I used it.
| :-) |
| Well, still working on this. I have spent most of the week trying to figure out the 3ds format. Simple models are fine, but I have trouble reading meshes with hierarchy. Static meshes now work (finally), so currently I'm struggeling with animated 3ds.|
Should look like Phineas from Phineas&Ferb.
| This exploded mesh problem only happens with the animated ones?|
Last edited show_time('2011-05-21 23:03:14')
| Yes, at first I had the same problem with static meshes as well: see the car in #22. |
| What a mess of a format. No wonder it's dead.|
I can only presume the issue is due to coordinate context; try considering the coordinates you read in parent-space, and then try to consider them in world-space just to see if there's any difference (for object positions, not vertices since you seem to be reading them correctly).
Last edited show_time('2011-05-22 19:46:30')
| (bookmarked) |
| looks amazing none the less and its come a long way since its started. I wish I had the time to spend coding like I used to :D |
| lib3DS, if this helps:|
| Looking very good :) |
| Anyone who is interested in lib3ds,|
sys87.lib3ds imports all the constants and functions. I'm going to begin integrating into my engine now.
I'll also begin making a libx module.
| Thanks! I uploaded the latest version, with the improved b3d loading. Also, I included klepto's Newton physics, and the slightly improved 3ds loader. (static hierarcy loads correct now) For now, I continue working on loading 3ds files somewhat more. Also, I noticed, in global space, the pitch seems to be reversed compared to Blitz3d. I would like to change that. Thanks for the lib, Kevin! And thanks for the link, Adam.|
Last edited show_time('2011-05-25 05:38:27')
| v0.1.0 - supports loading animated 3ds meshes. One testmodel didn't load properly (anim.rotation keys y/z are swapped and it's axis z negated), but blitz3d didn't load that model correctly, too. I also tried out different methods for swapping the z-axis in an attempt to change the 'pitch' direction, but ended up with simply negating the 'pitch' parameters in TEntity.bmx. |
| 8) |
| Next update will contain Sprites:|
And it can be more easily combined with MaxGUI:
(White area is an HtmlView and black area = Canvas+3D)
I'm now wresteling with PointEntity, it somehow keeps pointing the wrong way..
| excellent :P|
| Great work, stay with OpenGl, use Bullet, don't rush, don't promise, sell what you have produced, not what you wish to produce, otherwise you will lose friends and everything. |
following your progress keenly. On Mac OSX 10.6.6 version works OK however latest version fails with
realpath failed for Physics/inc/libnewton32.a
line in the interface file highlighted.
THe module built OK in IDE. Wrong lib maybe?
I note that there are two other libs in the directory.
| +1 for bullet over newton, although it might not be what you're intending.|
How are you doing sprites? you're batching them, right? They're super slow in MiniB3D.
The other libs are for either Linux or Win32. I can only test this on Windows, because I have no Mac with XCode available. I'm afraid I can't help much.
It is a strange issue, because neither that line, or that file have been changed. I did change the file TPhysics.bmx.
What does that error mean? Does it mean it can't find the file?
In a previous version, a filename case problem was reported, on Linux. I changed the file "phyics.bmx" to "Physics.bmx" to solve this.
Does libnewton32.a exists? Does the file have the correct case? (all lowercase?)
What you could try is to change the line so, that it contains the full path to the file, ie:
Else, I would try removing all the .bmx folders in that area, and do a rebuild.
Again else, I would try a previous version -one that works-, then replace all the folders, except the "Physics" folder and "TRenderer.bmx", with the latest update, and recompile. If it does, replace the file inside the Physics folder one by one to see where it goes wrong.
Well, Sprites are now experimental. I made a class called TSpriteRenderer. That is a mesh that contains a single surface and a list of Sprites. Each sprite is connected to a quad on this surface. When the TSpriteRenderer is rendered, all the quads are updated to where their counterpart Sprite is, with the same rotation as the camera. On my computer, I was able to draw 1200 sprites at 79 fps. (no debug enabled) That doesn't really say anything, really. My videocard is really bad.
I've added a shadowing system. However, it is not very fast, since it renders the scene several times over. If I have time, I'll try and look into another method.
For using shadows, your card must support stencil buffers.
Last edited show_time('2011-06-03 19:23:07')
| @Warner: Hi, what is your pc configuration? |
| There is no type id I can find, but this one looks pretty alike:|
| are they stencil shadows I see ;)|
Great stuff Warner :D
| Warner do you need some test? I have 4 machine with different type of graphic cards. |
| I'd much appreciate that, thanks! |
| The engine falls over with an absolute path error on the import "physics/Inc... I was wondering if there was a fix for this as the files are there but it don't seem to locate them.|
I will play around with it and see if I can get it to work
My specs are: osx 10.6.7, 1gb ram, intel 2ghz dual core, blitzmax 1.42
| Both MacOS and Linux seems to give problems when the .a files are placed in a subdirectory. If you move them up to the project's root, and change the line in TRenderer.bmx from|
The realpath trouble should be gone.
| Excellent stuff once I changed the paths over it works fine.|
One little snag is on the shadow render when the ninja models shadow gets rendered if the shadow is off the screen you get artifacts when its on the screen even as a single pixel its fine.
| Ah, thanks for reporting. I can't reproduce it, but I will look further into the shadow rendering. |
| Warner, great to see that you found the problem with Mac OS X. Had nothing to do with 32 versus 64 bit after all. Moving the newton lib fixed the problem for me also. Thanks.|
| I believe the problem is probably due to case-sensitivity issues. It shouldn't matter what directory you import the library archive from. |
| Hmm .. I will take a better look at it, kfprimm.|
About the shadow artifacts: it seems that the example is wrong. The "light" is positioned inside the wall. (cube=15x15x15, lightpos=0,15,-15) If you change the light position in the example, the artifacts should be gone, ie:
SetShadowLightPosition( shadow, 0, -45, 45, 1 )
| Excellent engine, now all I need is a LWO loader and its perfect :) |
| Hey Warner,|
You are very good at keeping things going and keep good work up :)
now all I need is a LWO loader
I usually go LWO->OBJ loader. Works for miniB3D, should work the same for this engine.
| For now, you could look into Biturn. It seems to be a very complete 3d converter that includes lwo and b3d. Haven't tested it very intensive. It is on the following page, a bit further down:|
| Latest version (warner_0_1_3.zip ) all examples 100% ok on Snow Leopard , Mac Mini, NVIDIA GeForce 9400.|
Great work, you seem to have made a really solid engine.
Do you know how it handles itself on low spec (office type) machines yet?
Last edited show_time('2011-06-16 02:34:32')
| I'm missing VertexCoords() for using assimp as a loader for warner.engine|
Is there a way to set vertex positions, or can you add that?
| That would be cool. To add VertexCoords, in "engine.bmx", add the following lines, then recompile:|
bbdoc: Sets the x,y,z position for a vertex
Function VertexCoords( surf:TSurface, index%, x#, y#, z# )
surf.vertices[index*3+0] = x
surf.vertices[index*3+1] = y
surf.vertices[index*3+2] = -z
Working on RenderToTexture:
Last edited show_time('2011-06-16 09:30:43')
| Looking cool. |
I got assimp example working.
I will clean it up and add it to blitzmax-assimp soon.
| Looks promising.|
Could you tell me if this RenderToTexture uses the hardware-way¹ or the Blitz3D hacky-way² of rendering?
¹Rendering directly to a Framebuffer object with a texture attachment (faster way, requires EXT_FrameBuffer_Object extension support).
²Rendering to the backbuffer and using CopyRect to a texture's buffer (slower way, but can be used as a fallback in systems that don't support framebuffer objects).
| @Difference I didn't realise how handy assimp is. Does it really load all those formats? Looking forward to it.|
@Kryzon I copied the MiniB3D BackBufferToTexture:
Method BackBufferToTexture(x%, y%, width%, height%, mipmap%=0)
glBindtexture GL_TEXTURE_2D, name
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, GL_height-y-height, width, height, 0)
So I suppose it is option 2, I realise I should have said "BackBufferToTexture" instead.
| From what I know that way is more compatible (glCopyTexImage2D requires at least GL 1.1, according to the online specs, so it's a wide range).|
I didn't know of the Assimp library; every game engine deserves one of these.
| I (almost) recommend adding both ways. Check for the EXT_FRAMEBUFFER_OBJECT and try rendering to texture that way, fallback is the other. You may find it useful for more robust appllcations (like shadows). |
| I think this should be on a separate forum section like minib3d is? |
| I'll get back on assimp-warner soon, but I'm swamped in work right now.|
Would anybody (more than one are welcome) be interested in joining the blitzmax-assimp project?
Would you Warner?
Ideally I'd add the interface to assimp and you'd write the blitz side of things.
It's quite solid and loads all those formats, but I've only been using it for static meshes.
Last edited show_time('2011-06-28 02:28:48')
| Hmm .. I don't think I have the time. I have a few weeks off soon. But I would like to use that time to complete the 3d editor that I wanted to use this engine on. |
| Ok, the door is always open. |
You might still decide your 3D editor needs all those input formats :-)
| Just uploaded a new version 0.1.4. It contains a number of added commands, some fixes again, and I've ported some of the |
samples from blitz3d, such as the 'head demo', and 'x fighter'.
| Wow, this is looking good. Just ran all 0.1.4 demos with no problems, with the exception of the render to texture examples, which don't show any textures for me. |
| Tried the latest, very cool!|
Couple of things: no texture on the little animated guy in the Mesh example (the one with the roman bath i think). Also no texture being rendered in either render 2 texture example.
Shadows are cool, but i guess still a work in progress. I added a shadow caster to the maplet mesh in the physics demo, and set the physics objects to cast shadows. It was super slow, and shadows appeared to be visible through walls etc.
Quick hypothetical question: if i wanted to switch from minib3d to this at some point, how much work would be involved in terms of changing code, given that i'm not doing anything too fancy with minib3d, but there is a lot of code in the project (about 73000 lines).
| Thanks for the feedback, guys. I'll look into it at work tomorrow. One of the machines there gives a similair result.|
If you want to convert from minib3d to this engine, there are a few differences. Especially sprites are done completely different, which could be an issue for your projects? Also, collisions and picking are done differently. I have been working on creating wrapper code to simulate the way minib3d handles collisions and picking, but I wasn't able to get it to work still. These routines are in engine.bmx, placed between comments.
So depending on the original code, it might be either very easy, or somewhat more work.
| Any way to export animated model from Blender and use it with Warner engine? I am using Blender-2.57b |
| The engine can load .3ds and .b3d models. I don't know Blender very well, but I assume it can save to .3ds? You could try a search for "Blender b3d", there might be an export script for it.|
The assimp library mentioned above comes with a convertor. You can convert many formats into others, such as .b3d. Google for assimp, then look on it's website.
Also, biturn -link in #74- can convert models to .b3d.
| Yeah i probably have to convert to .b3d because Blender exports to 3DS, but without animations. :/ |
| I can really vouch for it -I have not many modeling skills, but there seems to be a b3d exporter for Blender:|
I found a working link half down that thread:
| I would use that, but it's outdated and not working anymore. Someone needs to update it for Blender 2.5. |
| Problem is that the entire Blender API was updated (in much better ways than it was before), so the entire plugin would need to be reprogrammed from scratch.|
*Cough* Good thing, 'cause I think it was a mess *Cough*
Do you use 3DS Max?
Last edited show_time('2011-07-06 14:37:35')
| It would be a shame if you couldn't use Blender. How about the assimp viewer? Doesn't it offer any import format that is compatible with Blender? It can convert to .b3d |
| Assimp imports Collada (.dae) files with animations and everything. Here is picture:|
I am blind or does anyone see where is exporting?
Edit: I exported Makehuman (.mhx) model to Collada (.dae) and tried to import it to Assimp, but what is this?
Last edited show_time('2011-07-06 19:15:03')
Last edited show_time('2011-07-06 19:15:47')
| Looked at code in TOpenGL.bmx|
thought i'd play around.
'Have a look at the following lines in the following file from mediafire'
Just wanting to know why no one has released a Soil image loader ? " www.lonesock.net/soil.html ",bullet physics and and rapidxml modules for blitzmax.
Why freeimage ?
| @Arska, indeed, I must have misinterpreted the description "Due to its export interface, Assimp serves as general-purpose 3D model converter". I assumed they were speaking of the assimp viewer.|
Thanks @cr. It's better. I'll include the fixes in the 'official' version. About the other topic: I wouldn't know why no one did that. But if you really want to discuss that in-depth, I suggest making a post in the "General Topic" forum.
| Any way to get support for Collada? Makes my life lot easier. Or any other ways to get .B3D?|
Last edited show_time('2011-07-07 09:57:04')
| Ultimate Unwrap should be able to convert from Collada to b3d. And you could look into the Assimp mod from Difference. I don't know how others create .b3d files. It might be an idea to ask in the "General Help" forum. There might be folks there who know more about modeling (and thus exporting) than me.|
Edit: support? Hmm .. I will look into it, but I wouldn't hold my breath. It took me one or two weeks to implement reading animated .3ds files. And Collada seems to be a far more sophisticated format.
Last edited show_time('2011-07-07 10:13:43')
| Just quick question. How do i get entity rotation? |
I tried this:
Local rpos:Float = player.GetGlobalRotation()
rx = rpos ry = rpos rz = rpos
but it return values which is under 1. For example: 0.94837594.
I need to prevent entity to rotate too much.
| Yes, that function returns a quaternion. Instead, use EntityPitch, EntityYaw and EntityRoll. It might still be tricky to limit it's rotation, because the three degrees of freedom affect each other. |
| Engine definetly needs Blitz3D like EntityX, EntityY and EntityZ. I still need to prevent rotation, but i don't know how. :S |
| But it has that allready? You can look up the possible functions in "engine.bmx", or use 'rebuild docs'.|
I'll post an example of how to limit camera rotation.
I had a problem with Terrain samples - EXCEPTION_ACCESS_VIOLATION with LoadTerrain function (exactly roam_create(float *heightdata, int size)). I had one of the last Mingw version, now I installed older Mingw 5.1.3 and it works :). Maybe someone else had this problem.
| I had that problem myself. It traced back into the cpp file that creates the terrain. Strangely enough, the problem dissapeared when I recompiled. So hopefully the next update should take solve this issue?|
Edit: I have MinGW 5.1.4
Last edited show_time('2011-07-19 08:43:05')
| Sorry to bump, but does that problem dissapear when you add this line to the top of the Terrain example?|
It might be related to the garbage collection. The terrain uses memory that is alloced by C, rather than Bmax itself.
| I recompiled the mod in later Mingw with GCSetMode 2 but unfortunately it still does not work. When I recompiles with mingw 5.1.3 everything works well with and without GCSetMode 2.|
I know it's stupid but it may be Mingw version bug/problem.
Edit: By the way the engine looks really good :)
Last edited show_time('2011-07-20 07:28:55')
| This might be a solution? In roamstep4d.c, the lines 203-209 were in the wrong order:|
That could be the cause: the "roam" was used before it was created.
| It works :) |
| Yes! Finally .. thanks for letting me know. |
| v 0.1.5 is now available. It contains a number of fixes, and a few extra commands.|
- v 0.15 "physics objects reset to EntityScale 1,1,1" problem, should be fixed now
- number of bones pro surface is increased on demand
- added fixes by cr
- added EntityDistance
- fixed Terrain bug, where C roam struct was used before being created
- added EntityCollided - differs from Blitz3D, see the "Collision" sample that was added
- Note: BackBufferToTexture has not been changed yet. It has been reported that is doesn't work everywhere.
Edit: This weekend, I'm going on vacation for a couple of weeks. So during that time, I won't be able to give support or answer questions.
Last edited show_time('2011-07-21 07:20:07')
| So erm.. I'm back from my holiday. Just in case someone needs me. |
| Warner I need you!|
I can't seem to find BeginMax2D() in your engine, got anything similar to it? :o
UPDATE: Ok so I found GL_Begin2D() but It's acting very different from MiniB3D.
Using it the same way I do with BeginMax2D() produces some very odd graphical errors. :S
Last edited show_time('2011-09-05 08:45:51')
| Well, indeed, I didn't got GL_Begin2D to work as well as minib3d's BeginMax2D. Could you create a small example that demonstrates the problem?|
There might be a quick fix for it.
Edit: The original minib3d BeginMax2D stores a number of states before it starts off the 3d mode. I believe this happens in InitGraphics. Then, when BeginMax2D is called, it restores these states.
And when EndMax2D is called, it again stores these states and reinitializes the 3d settings (frustum etc.)
In my engine, GL_Begin2D just sets a number of states to enable 2d drawing. Then GL_End2D does the opposite. So some of the states needed for certain Max2D functions might not have been set.
I believe that this approach is to blame for any strange-looking 2d output.
Last edited show_time('2011-09-07 11:25:08')
| Probably... I haven't gotten around to making an example yet (Very busy >_>)|
But basically what happens is that the picture position is off, it's way to the left and up.
Think the alpha is weird too.. not sure. :S
If you've got any updates I'd be happy to be your Ginnie pig!
I'm trying to use your 3D engine is a pretty big framework I've made.
| Very Cool :) |
| format_code('Building Shadow|
Compile Error: Can't find interface for module 'warner.engine'
[C:/Program Files (x86)/BlitzMax/samples/Shadow.bmx;3;1]
Build Error: failed to compile C:/Program Files (x86)/BlitzMax/samples/Shadow.bmx
| asegurate de poner el "warner.mod" en el "mod" folder de BlitzMax y as un "Build modules" y por ultimo as un "Build" de "Shadow.bmx"|
Last edited show_time('2012-02-16 01:47:42')
| creo que debe ser por que trabajo con la 1.38, no esta activado "build modules".... =(|
Last edited show_time('2012-02-16 07:51:18')
| You could also try the command line from your BlitzMax install folder:|
| Hi Warner, I tried but nothing ...|
Sorry i'm now.
| you have to install MinGW(tienes que instalar MinGW):|
Last edited show_time('2012-02-16 10:27:13')
you have to install MinGW(tienes que instalar MinGW):
Gracias ya me pongo a instalar eso...
Edit: lo siento el traductor de google no me colabora mucho en la instalación, .... esto es una pesadilla.
Last edited show_time('2012-02-16 13:49:07')
| mi español no es muy bueno y no se como se traducen algunos funciones de windows a español. lo que tienes que a ser es instalar MinGW a la carpeta "c:\MinGW". Siguiente abre el "control Panel"(?) Y selecciona "Hardware and Sound"(?) -> "System and Security"(?) -> "System"(?) -> "Advanced System Settings"(?) - > "Environment Variables"(?)|
en la sección de arribal pincha "New.."(?) pare el nomber escribe "MinGW" y para el valor escribe "c:\MinGW" y presiona "Ok".
en la sección de abajo busca le entrada "Path"(?),selecciona y pincha la opción para editarla y agrega esto al final ";c:\MinGW\Bin" exacto con el semi-colon al principio y presiona el boton para aceptar.
no estoy seguro si necesitas volver a empezar Windows de nuevo pero por si las dudas as lo.
estas instrucciones son para windows 7. si tienes windows Vista dejame saber y agregare la ultima instrucción.
ojalá esto te sirva.
Last edited show_time('2012-02-16 16:05:57')
| I'am Use windows XP.|
See Image step.
| se ve bien. Funciona?|
Last edited show_time('2012-02-16 16:26:26')
| No, it's a shame it does not work ...|
| One moment i reset my computer. |
| After you restart, build modules then compile the code.|
Last edited show_time('2012-02-16 16:23:54')
| It seems that it will work, since the options of "Build ..." are already active in the menu ... for now is doing the Buil ... then I try to end it works. |
| Hey, I want to sincerely thank you for the time you've taken in helping me, really not knowing English hurts me greatly, but I try to do better with Google translator and help from people like you willing to collaborate.|
Actually use the version 1.38 and if I see the possibility that the next step is BlitzMax if I have money.
A greeting and thank you very much true.
I'am Happy =)
| One Tip from a 3D guru, "Lighting & Atmospherics"|
Try to improve it with more advanced lighting techniques such as Normal Mapping and Parralax Mapping. Then consider soft shadows. Then final area in this regard would be Post Processing.
These features will greatly improve the graphic output.
| Hi, I have a question, do things with this engine for OpenGL, Esti means you can work on other operating systems other than Windows? |
| Yes this engine should work under Windows, Mac, and Linux with Blitzmax. |
Yes this engine should work under Windows, Mac, and Linux with Blitzmax.
| Can this and minib3d both be installed at the same time? |
| Yes. They are in different module scopes so that isn't an issue. |
| Warner, Do collisions work? How? |
| Yes, use UpdateCollision(source:TEntity, target:TList, method, response)|
Where source should be the moving Entity, and target should be a TList, containing all static entities that you want to collide with. Method and response are the same as in B3D's Collision command.
The Terrain sample uses this command.
| Okay. I was confused when the Collisions(mesh_type, mesh2_type, 2, 2) didn't work for me. Thanks! :D |
| How much support for this Warner B3D now?|
How does it compare with say miniB3D, MaxB3D and the Irrlight wrapper for Blitzmax?