Code: Select all
CameraClsColor(cam3, 0.8, 0.5, 0.7)
CameraFogColor(cam3, 0.1, 0.5, 0.9)
It will not fix the camera problem, seems a bug to me.
Same on LibOpenB3D version.
Code: Select all
CameraClsColor(cam3, 0.8, 0.5, 0.7)
CameraFogColor(cam3, 0.1, 0.5, 0.9)
Code: Select all
if(fog==-1) glFogf(GL_FOG_MODE,GL_LINEAR); // once only
Code: Select all
glFogf(GL_FOG_MODE,GL_LINEAR);
Code: Select all
#include "openb3d.bi"
screen 18, 32, , &h10002
Graphics3d 640,480,32,1,1
var camera=CreateCamera()
var light=createlight()
turnentity light,0,45,0
moveentity camera,0,0,-10
var sphere=createsphere()
var cube=createcube()
moveentity cube,.6,.3,0
var csg=meshcsg(sphere,cube,3)
entitycolor csg,255,0,0
entityorder csg,-1
entityparent csg,sphere
freeentity cube
'freeentity sphere
do
turnentity sphere,0,.5,0
renderworld
flip
loop until multikey (1)
Sorry i did not know, and yes i got the last 1.3 version.The decal mesh is supposed to be on the sphere
Code: Select all
#include "openb3d.bi"
screenres 1920,1080, 32, , &h10002
Graphics3d 1920,1080,32,1,1
var camera=CreateCamera()
var light=createlight()
turnentity light,0,45,0
moveentity camera,0,0,-3
var sphere=createsphere()
var cube=createcube()
moveentity cube, 0.6, 0.3, 0
'positionentity cube, 0.6, 0.6, 0.6
var csg=meshcsg(sphere, cube,2)
entitycolor csg,255,0,0
entityorder csg,-1
entityparent csg,sphere
freeentity cube
moveentity csg, 1,0,0
'updatenormals csg
'wireframe 1
do
turnentity sphere,0,.5,0
renderworld
flip
loop until multikey (1)
It is, if you use 0 as third parameter. If you use 1 it will sum the meshes. If you use 2, it will produce the intersection (that is what your program does). Version 1.3 also allow you to use 3, that produces the decal mesh.Gunslinger wrote: ↑Feb 10, 2024 9:59 Ah yes got it now
First i did think csg function is for subtracting mesh shapes from 2 bodies.
From the manual:Gunslinger wrote: ↑Feb 10, 2024 9:59 I'm working as a engineer with 3D cad software a lot, where sometimes i use to subtract/add or intersect 3D bodies.
I was mistaken this is the same idea. it's not.
MESH* MESHCSG(MESH* M1, MESH* M2, INT METHOD = 1)
m1 first mesh
m2 second mesh
method CSG operation:
0: subtraction
1: union
2: intersection
3: decal
Description
Creates a new mesh by performing a CSG (Constructive Solid Geometry) operation on two given meshes m1 and m2. Those meshes are not modified, and might need to be removed with FreeEntity at the end of the CSG operations.
The method parameter specifies which CSG operation must be performed: a subtraction removes the second mesh from the first, basically creating a hole inside m1, shaped like m2; an union combines the two meshes into one, removing all the superfluous geometry: in that, it differs from AddMesh, that includes also the intersecting parts of meshes, that should never be visible anyway (if you use this operation to add many boxes and cylinders, then you flip the result with FlipMesh, you will get a set of corridors/dungeon); an intersection creates a mesh that is made only by theintersecting parts of m1 and m2 (the intersection of two spheres can be used to produce a lens shaped mesh, for example); a decal produces a decal mesh, that is basically a very thin mesh that adheres to the surface of m1, and is delimited by m2: by setting a negative rendering order with EntityOrder it’s possible to render it after m1, so it will always be visible over it, and it can be useful to apply a different texture or material to a selected part of a mesh.
Thank you! The reason I didn't include examples is that OpenB3D can be used in other languages, too (although FreeBasic is the one I have in mind as target)Gunslinger wrote: ↑Feb 10, 2024 9:59 Maybe it's a good idea to pack some of your simpel examples of openB3D in freebasic with the download of libs.
I think openB3D is the best 3D lib that fits with the freebasic style and is easy to read.