WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 02-02-2015, 04:25 AM
seal seal is offline
Join Date: Oct 2013
Posts: 8
How to set the color of a group of points depending on their positions very quickly


I need to draw around 6000 points that are evenly and randomly distributed in a cubic shape volume. Most of them are white, but those that fall into some randomly located cylinder-shaped volumes (within the cubic volume) should be in other colors (e.g. green or red). I was wondering if there is a way of doing this very quickly rather than using an if-statement for each point as 6000 points may take a very long time to render in such a way?

This is how I draw the points:

import viz
import numpy as np

positions=np.random.uniform(low=-12/2, high=12/2, size=(number,3))

for i in range(number):	
In addition, I was wondering if there is a way of drawing all the points together rather than using a for-loop to do it individually?

Any advice would be highly appreciated.
Reply With Quote
Old 02-03-2015, 06:16 AM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,467
Do you only need to check if the points are within the cylinder shapes at the time of object creation? If so, that should be fine.
Reply With Quote

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 11:16 PM.

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