WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-24-2014, 08:59 AM
plogic plogic is offline
Member
 
Join Date: Oct 2014
Posts: 1
.bsp->.obj->.osgt map Collision Problem/Resources for free maps?

Hello everyone,

I started playing around with Vizard 5 (64bit version) and wanted to include a level/map that was a bit more extensive, so I looked into importing Half Life/Counterstrike maps in the (Valve) .bsp format.

If you have any suggestions on where to find scenery / levels that are natively supported by Vizard and take some time to explore, I would be very grateful, to hear from you!

My workflow was as follows:
Since the .bsp Format that Vizard can read is not the same as the one in Valve .bsp maps, I used Nem's Tools Crafty to convert a .bsp to a .obj File and extract the relevant Textures. (If I load that .obj file into Vizard, the y and z coordiantes of all vertices are 0)
Then I used blender and import the .obj File, scale the map down a bit and use the osgexport Plugin to export the complete model, including textures to .osgt which I then load into Vizard.

The model seems to load fine and most of the textures are visible. Using vizcam.WalkNavigate I can move around freely. Yet, when I enable collision I have two problems:
  • I can not choose a starting position
  • I am not affected by gravity

When collision is off, I can set a starting position with setPosition, but when collision is on, I start on the origin instead (outside of any rooms).
Using a vizact.onkeydown event to toggle collision, I can see that collision with the walls seem to work once I am inside a room. Yet, when I walk over stairs, I do not seem to fall down and always hover at the same height.

Here is a minimal example:
Code:
import viz, vizcam, vizact

viz.go()
viz.clearcolor(viz.SKYBLUE)

map = viz.add('maps/cs_office.osgt')

tracker = vizcam.addWalkNavigate(moveScale=10.0)
tracker.setPosition([15.62396, -0.36471, -13.66633])
viz.link(tracker,viz.MainView)
viz.MainView.collisionbuffer(0.2)
viz.MainView.gravity(9.8)
viz.MainView.collision( viz.ON )

#This function is called when a collision occurs
def mycollision(info):
	print 'Collided!'

#Create a callback for a collision event
viz.callback(viz.COLLISION_EVENT, mycollision)
Using a different model (eg. playground or ground + some entities) works fine. I experimented with different eyeheights, collisionbuffers and scales of the map (to an extend where one room was many times greater than the whole dojo model).

My questions now are the following:
What are the conditions for gravity affecting the viewpoint in Vizard? (Can I eg. go below my starting position?)
Does the collision of the viewpoint treat certain models differently than others?
Did anyone have a similar problem?
And again: does someone know of a good source of maps/levels are known to work with vizard?

Thank you all very much.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC