MiniB3d for FreeBasic
Re: MiniB3d for FreeBasic
I haven't yet tested, but atan2 return angles in radians (you wrote "+360" and "mod 360", so maybe you are assuming an angle in degrees).
Do you remember this post?
http://freebasic.net/forum/viewtopic.ph ... 70#p158170
Try multiplying the result by 57.
By the way, are you still working on your space simulation game?
Because I'm doing some experiments with LOD geospheres (aka spherical terrains).
Do you remember this post?
http://freebasic.net/forum/viewtopic.ph ... 70#p158170
Try multiplying the result by 57.
By the way, are you still working on your space simulation game?
Because I'm doing some experiments with LOD geospheres (aka spherical terrains).
Re: MiniB3d for FreeBasic
Damn it, why don't I remember I have already worked on that? :(
Thanks!
Thanks!
Of course: X-the forgotten battlesangros wrote:By the way, are you still working on your space simulation game?
Sounds like a great idea! Do they work already?angors wrote:Because I'm doing some experiments with LOD geospheres (aka spherical terrains).
Re: MiniB3d for FreeBasic
It still need some calibration, and some work for normals, but I hope it will be ready soon.
Re: MiniB3d for FreeBasic
Version 0.8 is online. I will soon post some example.
Re: MiniB3d for FreeBasic
Ok, a simple demo:

You need these files:
http://www.cartographersguild.com/attac ... 0x2700.jpg The heightmap
http://www.worldwidetelescope.org/docs/ ... fEarth.jpg The texture

Code: Select all
#include "openb3d.bi"
screen 18, 32, , &h10002
Graphics3d 640,480,32,1,1
var camera=createcamera(0)
'cameraclscolor camera,0,255,0
camerarange camera,.00001,10
'scalemesh cube,.5,.5,.5
var x=loadgeosphere("44778d1336904592-need-help-earth-obliquie-projection-srtm_ramp2.world.5400x2700.jpg")'
'var x=creategeosphere(300)
var light=createlight()
moveentity light,10,10,10
pointentity light,x
moveentity camera,0,0,-30
scaleentity x,.01,.01,.01
var tex=loadtexture("MapOfEarth.jpg")
scaletexture tex,2700,2700
entitytexture x,tex
'wireframe 1
entitypickmode x,2
Dim CurrentX As Integer
Dim CurrentY As Integer
Dim MouseButtons As Integer
var sphere=Createsphere()
scaleentity sphere,.1,.1,.1
entitycolor sphere,255,0,0
'x=camera
dim key as string
turnentity camera,80,0,0
do
GetMouse CurrentX, CurrentY, , MouseButtons
CameraPick (camera,CurrentX,480-CurrentY)
PositionEntity sphere,PickedX(),PickedY(),PickedZ()
key=inkey
if key=" " then moveentity camera,0,0,.08
if key="z" then moveentity camera,0,0,-.08:'freeentity x':end
if key=chr(255)+"H" then turnentity camera,1,0,0,0
if key=chr(255)+"P" then turnentity camera,-1,0,0,0
if key=chr(255)+"M" then turnentity camera,0,-1,0,0
if key=chr(255)+"K" then turnentity camera,0,1,0,0
updateworld 1
renderworld
sleep 1
flip
loop until key=chr(27)
http://www.cartographersguild.com/attac ... 0x2700.jpg The heightmap
http://www.worldwidetelescope.org/docs/ ... fEarth.jpg The texture
Re: MiniB3d for FreeBasic
What's the "Loadgeosphere"-function? I can't find it in my openb3d-header. :/
Re: MiniB3d for FreeBasic
Are you using the last version? If you have an header file from an older version, obviously there is no loadgeosphere because at time there was no such command!
If you download version 0.8 (for windows, or for linux) there is a newer file openb3d.bi with it.
If you download version 0.8 (for windows, or for linux) there is a newer file openb3d.bi with it.
Re: MiniB3d for FreeBasic
Is there a billboard system? I couldn't find it :-/
Re: MiniB3d for FreeBasic
What do you mean? A way to display text (scores, names of characters)? Or something else?
Re: MiniB3d for FreeBasic
Mainly graphic, with some transparency. Names/scores would be nice.
Re: MiniB3d for FreeBasic
sprites = billboards
Re: MiniB3d for FreeBasic
You can use sprites, or you can use the header 2d.bi that allow you to use normal freebasic commands over 3d screen
Re: MiniB3d for FreeBasic
Thanks. Did you implement also 2d part of the http://www.blitzbasic.com/b3ddocs/docs.php?
Re: MiniB3d for FreeBasic
No, and I'm not going to do in the future, because I think it's unnecessary: in fact, the gfx library included in FreeBasic already supplies the same features, or most of them, so implementing Blitz 2D commands would just confuse developers, with no gain in programming features (at least, in my opinion).
Most of the features (lines, ovals, rectangles, image buffers, pages) are implemented both in BlitzBasic and FreeBasic, you only have to replace a command with its equivalent. FreeBasic has some powerful features that are not available in Blitz (like the commands PAINT, or DRAW); Blitz, on the other hand, has a couple of features that are not natively implemented in FreeBasic: rotation/zoom of sprites (but you can use the MultiPut routine), and pixel perfect collision detection (there are some routines for that, too, in the forum)
Anyway, if you likes OpenB3D, and you are looking for something similar for 2d graphics, I also made another library called OpenB2D; the forum thread is here:
http://www.freebasic.net/forum/viewtopi ... 14&t=22081
It features sprites (with zoom and rotations), tilemaps (they can be zoomed and rotated, too), isometric maps, pixel perfect collision, all hardware accelerated by the GPU through opengl (BlitzBasic and FreeBasic gfx don't use the GPU for accelerare 2d mode, they just use fast blitting and mmx instructions); OpenB2D, instead, can use hardware acceleration even for collision detection, if available.
Most of the features (lines, ovals, rectangles, image buffers, pages) are implemented both in BlitzBasic and FreeBasic, you only have to replace a command with its equivalent. FreeBasic has some powerful features that are not available in Blitz (like the commands PAINT, or DRAW); Blitz, on the other hand, has a couple of features that are not natively implemented in FreeBasic: rotation/zoom of sprites (but you can use the MultiPut routine), and pixel perfect collision detection (there are some routines for that, too, in the forum)
Anyway, if you likes OpenB3D, and you are looking for something similar for 2d graphics, I also made another library called OpenB2D; the forum thread is here:
http://www.freebasic.net/forum/viewtopi ... 14&t=22081
It features sprites (with zoom and rotations), tilemaps (they can be zoomed and rotated, too), isometric maps, pixel perfect collision, all hardware accelerated by the GPU through opengl (BlitzBasic and FreeBasic gfx don't use the GPU for accelerare 2d mode, they just use fast blitting and mmx instructions); OpenB2D, instead, can use hardware acceleration even for collision detection, if available.
Re: MiniB3d for FreeBasic
Hi!
Can anyone point me in the right direction on normal mapping with openb3d?(e.g. a simple cube)
Edit:I've found that out already.
Can anyone point me in the right direction on normal mapping with openb3d?(e.g. a simple cube)
Edit:I've found that out already.