A few questions.

Blitz3D Forums/Blitz3D Programming/A few questions.

Eviltoes(Posted 2007) [#1]
1.) What are the benefits of b3d's over other model types?


2.) How do you load b3d's?


3.) how do you perform polygon-specific operations ona terrain, or any any mesh?



4.) How would I go about making a single polygon look brighter than other polygons ona mesh or terrain.


5.)how would I get a single polygon on a mesh to glow like it's being hit by a very bright light?




Thanks for any answers!


H&K(Posted 2007) [#2]
"Polygon"?

Its not been polygons since 3d hardware acceleration happened, its all Triangles now

1) Blitz 3d can load them in
2) Loadmesh "name.b3d"
3) You can move the verticies of a mesh, and you can reasign which vertices connect.
4) Err, make another mesh exactly the same shape as the one you want to make brighter, and put that ontop of the "Polygon". Or.. change the part of the texture that applies to that bit brighter. (Probably add a new texture layer on the brush, and reaply it)
5) See 4


Eviltoes(Posted 2007) [#3]
umm...


how do i move the vertices and reassign them?


and


what I'm trying to do is make the triangles on a terrain near a certain location brighter and those farther from it darker, in real time, so what you're suggesting wouldn't really work, do you know how I could do this?
I also need to do this with single faces on a cube.
I'm trying to make my own lighting, because blitz3d's lighting, umm.. sucks.


And thanks for the polygon-triangle thing.


Subirenihil(Posted 2007) [#4]
TerrainShading terrain, enable

allows lighting to affect terrain.

I assume you are dissapointed at the gradation of shading from one corner to the opposite corner of a cube (It doesn't look right). That is a problem with vertex shading. To fix it, use:

EntityFX entity, 4

This sets the entity to be flat shaded instead of vertex shaded.


Rob Farley(Posted 2007) [#5]
Also look at camerafog to make stuff darker in the distance.


jfk EO-11110(Posted 2007) [#6]
And if you really want to darken certain triangles, alter the VertexColor of the triangles vertices - although with shared vertices this will also affect the surrounding triangles, resulting in a gradient that may or may not be useful (this could be solved by unwelding the mesh right after loading).

I assume you read about the vertex controlling commands as some useful basics.

create a mesh, assign a surface to it, and a brush to the surface, and some vertices (=vertexes), then add some triangles (using the previously added vertices), then color them individually and maybe also try Vertex Alpha.


Eviltoes(Posted 2007) [#7]
what I'm doing is making my own lights(not blitz3d lights) so terrain sheding and entityfx stuff won't do, I'm using:

if entitydistance(single_vertex,my_light)=<10 then
entityfx single_vertex_or_triangle,16
if abs(entitydistance(single_vertex,my_light)-10)=<1 then
darken(single_vertex)
endif
endif

on every vertex\triangle on a flat terrain before the level begins, for a good floor lighting effect, I will also have any npc's or monsters or whatever within the range of the light to have fog disabled, all together to make an at least mediocre lighting effect.


Stevie G(Posted 2007) [#8]

if entitydistance(single_vertex,my_light)=<10 then
entityfx single_vertex_or_triangle,16
if abs(entitydistance(single_vertex,my_light)-10)=<1 then
darken(single_vertex)
endif
endif



Eh? You are disabling backface culling ( fx16 ) on individual vertices or triangles. This can't be possible unless you're using individual meshes for each triangle which is major overkill.

Are you building your own mesh terrain or are you using the createterrain function? Can you show some demo code or a screenshot of the effect you're trying to achieve 'cos I can't help but think there will be a much simpler way.

Stevie


Eviltoes(Posted 2007) [#9]
sorry, I got my entityfx mixed up, I am trying to disable fog, not backface culling.


Eviltoes(Posted 2007) [#10]
I tried to load a b3d file and it gave me an "Entity doesn't exist"

I loaded it like this:

mesh=loadmesh "name.b3d"

and

mesh=loadmesh("name.b3d")


neither worked.


any ideas?


b32(Posted 2007) [#11]
Try Print FileType("name.b3d") instead, if it is 1, the file exists.
Then, try Print LoadMesh("name.b3d"), if it is zero, the file is not compatible with Blitz, else the mesh is loaded.
And you have to load meshes after setting Graphics3D.


Eviltoes(Posted 2007) [#12]
This returns a 1 for filetype, but a zero for the loadmesh

but the file is a b3d, It says that in the properties of the file, and you would think that blitz3d would be able to load a file created specifically for it. I exported with DeleD, I didn't save it first, I just exported it,could this be the problem?
The file is only 3kb also, so, something seems fishy.