JV-ODE identify top & bottom of car & apply nums

Blitz3D Forums/Blitz3D Userlibs/JV-ODE identify top & bottom of car & apply nums

Blitzplotter(Posted 2008) [#1]
I've tried to identify the top and bottom of a car after it has been created and apply some number code in something like the following manner. I've referred to the JV-ODE wiki and have not had much joy. Can anyone shed any light on how I would identify the top & bottom of a car once created in JV-ODE and apply images to the top & bottom?




VIP3R(Posted 2008) [#2]
Hmm, the JV-ODE/ODE manuals or wiki won't help much, what you are attempting is all Blitz3D stuff only.

The easiest way is to create a texture with your numbers, then paint the texture straight onto the cube surface of the car (this is the 'ode\mesh' not 'ode\geom'). This will paint all sides of the cube though.

Another way is to create two textured quads, parent them to the cube and position them slightly above the surface on the top and bottom of the cube.

The 'proper' way is to map the texture coordinates to the faces of the cube. It's much easier to do this in an editor/uv mapper, but to do it in code you need to look at the following functions of Blitz...

AddVertex ( surface,x#,y#,z#[,u#][,v#][,w#] )
VertexTexCoords surface,index,u#,v#[,w#][,coord_set]


...paying particular attention to the optional u#,v#,w# parameters.


Blitzplotter(Posted 2008) [#3]
Thanks for this VIP3R, I have a copy of Ultimate Unwrap that I may get to grips with now, I just needed a reason. I'll export my car texture from my car demo then make my 100 car textures.


Alternatively The ADDvertex looks a good pointer for reverting to the original plan of justing using 10 images 0 to 9 to form the numbers to be pasted on, I really think I'll go for the easy option however, KISS and all! (Keep it simple....)


Blitzplotter(Posted 2008) [#4]
Well have created my own little car in wings now, however when I load it B3D is only loading the one entity, instead of creating cube, I'm equating the ode/mesh to the one entity.

This led to an interesting bugette (caused by my poor coding)whereby the size of my one car body was HUGE upon creation of say 20 cars....


I suspect I am going to have to load the entity however many times in relation to the amount of cars requested, then assign the enitity from an array of entities to the individual car. i think. yep, that worked.


VIP3R(Posted 2008) [#5]
The size of the mesh can be adjusted in code with ScaleMesh() or you can shrink it down in Wings. As a guide, the size of the JV-ODE demo car is 3 x 1 x 4 units.


Santiworld(Posted 2008) [#6]
hi, i made two surface in the top of the car...

and each surface have a texture numbres (0 to 9)

if i have the car number "23"
the left top surface, have the number "2", with alpha...
the right... have the number "3"


i make the bmp, black background, and withe number, and n(i) = loadimage("x",2)

if you want i can send the images and the example by mail...
works very fine..



each number is a poly child of the car ode\mesh


Blitzplotter(Posted 2008) [#7]
@Latatoy, this looks like a great example. I like the look of your cars by the way!


Santiworld(Posted 2008) [#8]
thanks... :)...


Blitzplotter(Posted 2008) [#9]
Just started looking at blender - first impressions are it looks very powerful. Thanks for the tip Latatoy :0)